u-boot: load a kernel that's in a ubi volume
anoo
anoo at linux.vnet.ibm.com
Mon Aug 7 13:39:09 AEST 2017
Hi Joel,
Per our discussion, here are the details of what we’re trying to do
and the things I’ve tried.
Goal: Have u-boot load a kernel that's in a ubi volume.
1. Added ubi support to uboot by adding the following macros to
include/configs/ast-g5-ncsi.h temporarily for testing purposes (a new
config header would probably need to be created for a final
implementation):
| +#define CONFIG_CMD_UBI
| +#define CONFIG_CMD_UBIFS
| +#define CONFIG_RBTREE
| +#define CONFIG_MTD_DEVICE
| +#define CONFIG_MTD_PARTITIONS
| +#define CONFIG_CMD_MTDPARTS
| +#define CONFIG_LZO
2. Built a romulus image with the above u-boot change plus commit
https://gerrit.openbmc-project.xyz/#/c/5812/ which is the top-most
commit for a set of changes to remove the initramfs and create a flash
image that builds the kernel and rootsfs into ubi volumes.
3. Used the generated obmc-phosphor-image-romulus.ubi.mtd to boot qemu.
4. To be able to use ubi in u-boot, the mtdparts and mtdids variables
need to be set (reference:
https://fossies.org/linux/qemu/roms/u-boot/doc/README.ubi).
Here is where I’ve been unable to get u-boot to recognize the existing
mtd. I’ve tried multiple combinations for mtdids, such as nor0=bmc,
nor0=<addr>.flash, etc etc. But when running “mtdparts” command from
u-boot, or a ubi command, always get "Device nor0 not found!”. Ex:
ast# mtdparts
Device nor0 not found!
ast# ubi part kernel0
Device nor0 not found!
Error initializing mtdparts!
I’ve also taken a stab at adding the romulus device tree to u-boot to
see if that may be the reason, by copying from the kernel and adding to
u-boot the files arch/arm/dts/aspeed-g5.dtsi,
aspeed-bmc-opp-flash-layout.dtsi, aspeed-bmc-opp-romulus.dts, and adding
the dts to the Makefile. Also added a CONFIG_DEFAULT_DEVICE_TREE macro.
This might not be the correct or complete way to add the device tree to
the openbmc version of u-boot.
Let me know if you need additional details and thanks in advance for
your insight.
More information about the openbmc
mailing list