Configuring U-Boot to use eMMC.

Apologies. Reposting because I forgot to fill out the type/categories…

I’m comfortable with raw mode booting for SPL/MLO and U-Boot. I’d like to configure U-Boot to pull the kernel and DTB from an EXT4 partition on the eMMC.

Using strings I decoded the default state of the variables and worked back from $bootcmd (please see below).

Must U-Boot be built with mmcdev set to 1? Is there some kind of configuration option for this (I’m using the stock Yocto/Poky/Pyro source).

Is another path to use saveenv to store this information in one of the hidden eMMC boot sectors (assuming this is where U-Boot grabs this information)?

Related: Is there a clever way of partitioning, formatting, dd’ing the eMMC without having to load Linux from an SD card and using its tools? Or creating an image and writing it raw?

Thanks,

Kenny

envboot=mmc dev ${mmcdev}; if mmc rescan; then echo SD/MMC found on device ${mmcdev};if run loadbootscript; then run bootscript;else if run loadbootenv; then echo Loaded env from${bootenvfile};run importbootenv;fi;if test -n $uenvcmd; then echo Running uenvcmd ...;run uenvcmd;fi;fi;fi;

mmcdev=0

loadbootscript=load mmc ${mmcdev} ${loadaddr} boot.scr

bootscript=echo Running bootscript from mmc${mmcdev} ...; source ${loadaddr}

loadbootenv=fatload mmc ${mmcdev} ${loadaddr} ${bootenvfile}

bootenvfile=uEnv.txt

importbootenv=echo Importing environment from mmc${mmcdev} ...; env import -t ${loadaddr}${filesize}

Adding that I want MLO, U-Boot, and the EXT-4 all on the eMMC. Will be using the SD card as a FAT32 for data only.

Thanks,

Kenny