Enable UBI support for a platform

Deepak Kodihalli dkodihal at linux.vnet.ibm.com
Sat Sep 5 22:49:26 AEST 2020


Hi Kun,

On 05/09/20 5:32 am, Kun Zhao wrote:
> Hi Team,
> 
> My platform is based on ast2500, and I’ve already been able to built out 
> the ubi image. But when I tried to test it with qemu, it just stopped at 
> u-boot because ‘can’t get kernel image,
> 
> qemu-system-arm: Aspeed iBT has no chardev backend
> 
> U-Boot 2016.07 (Sep 04 2020 - 19:47:48 +0000)
> 
>         Watchdog enabled
> 
> DRAM:  496 MiB
> 
> Flash: 32 MiB
> 
> *** Warning - bad CRC, using default environment
> 
> In:    serial
> 
> Out:   serial
> 
> Err:   serial
> 
> Net:   MAC0 : RGMII
> 
> MAC1 : RGMII
> 
> FTGMAC100#0
> 
> Error: FTGMAC100#0 address not set.
> 
> , FTGMAC100#1
> 
> Error: FTGMAC100#1 address not set.
> 
> Hit any key to stop autoboot:  0
> 
> Wrong Image Format for bootm command
> 
> ERROR: can't get kernel image!
> 
> ast#
> 
> And I found the bootargs is not right,
> 
> ast# print
> 
> baudrate=115200
> 
> bootargs=console=ttyS4,115200n8 root=/dev/ram rw
> 
> bootcmd=bootm 20080000
> 
> bootdelay=2
> 
> Checked in the build folder for 
> tmp/work/myplatform-openbmc-linux-gnueabi/u-boot-aspeed/1_v2016.07+gitAUTOINC+1ded9fa3a2-r0/ 
> and found the none of the following patches are there,
> 
> 0002-config-ast-common-hack-bootopts.patch
> 
> 0003-config-ast-common-Add-bootopts-to-support-ubi-and-mt.patch
> 
> 0004-config-ast-common-Add-conditional-factory-reset-comm.patch
> 
> 0005-config-ast-common-Fall-back-to-secondary-flash-on-fa.patch
> 
> I think that’s why the bootargs is not correct.
> 
> This is the details of how I enabled the ubi support in my platform recipes,
> 
> 1. In meta-myplatform/conf/distro/openbmc-myplatform.conf, I added,
> 
> require conf/distro/include/phosphor-base.inc
> 
> require conf/distro/include/phosphor-ubi.inc

You should just need the one line above, plus a device tree change for 
your system. The default openbmc-flash-layout.dtsi doesn't make a ubifs 
partition. You can for eg look at witherspoon's dts, which uses ubifs.

Does anyone know why the default is static partitions, and not ubifs?

Regards,
Deepak

> 2. In meta-myplatform/conf/machine/myplatform.conf, I added,
> 
> IMAGE_FSTYPES += " mtd-ubi mtd-ubi-tar"
> 
> OBMC_MACHINE_FEATURES += " obmc-ubi-fs"
> 
> Do I miss anything?
> 
> Thanks.
> 
> Best regards,
> 
> Kun Zhao
> 
> /*
> 
> zkxz at hotmail.com <mailto:zkxz at hotmail.com>
> 
> */
> 



More information about the openbmc mailing list