LS1046ARDB patching u-boot-qoriq bootcmd in yocto does not work as expected

Showing results for 
Show  only  | Search instead for 
Did you mean: 

LS1046ARDB patching u-boot-qoriq bootcmd in yocto does not work as expected

Contributor II


I'm trying to patch the u-boot config. The patch changes the CONFIG_BOOTCOMMAND and CONFIG_BOOTDELAY in the .config used for the build tmp/work/ls1046ardb-fsl-linux/u-boot-qoriq/2022.04+AUTOINC+1c881f4da8+fslgit-r0/build/ls1046ardb_tfa_defconfig/.config

When booting the board with the u-boot from the new yocto build on my SD card, I can verify that the CONFIG_BOOTDELAY changes worked, as printenv bootdelay prints the patched bootdelay. But printenv bootcmd prints the unpatched bootcmd. When executing env default -a  before printenv bootcmd it prints the patched bootcmd and the bootdelay is also still the patched one. So it seems like there are two environments in the fip_uboot.bin file I'm using. Any environment that's used by default and the "default" environment that's beeing used after executing env default -a. 

The questions I have are:

1. What are these two environments? When the board is booting I get the message "Loading Environment from MMC... *** Warning - bad CRC, using default environment" but this is not the same "default" environment that's loaded when typing "env default -a"

2. Why is the .config only affecting the bootdelay and not the bootcmd of the environment that's used?

3. What would be the right approach to patch the u-boot in yocto in general? I added a u-boot-qoriq_%.bbappend file that's patching the .config file in the do_configure step as follows







SRC_URI:append = " \
    file://boot_sd_defconfig \

do_configure:append() {
    cat ${WORKDIR}/boot_sd_defconfig >> ${B}/ls1046ardb_tfa_defconfig/.config






The  boot_sd_defconfig file only contains the following two lines:

CONFIG_BOOTCOMMAND="setenv kerneladdr 0x80000000;setenv fdtaddr 0x90000000;setenv ramdiskaddr 0xa0000000;mmc read ${fdtaddr} 0x4840 0x3d;mmc read ${kerneladdr} 0x487d 0x15651;mmc read ${ramdiskaddr} 0x19ece 0x6d41;setenv bootargs console=ttyS0,115200 root=/dev/ram0 rw rootdelay=5;booti ${kerneladdr} ${ramdiskaddr} ${fdtaddr}"

Additional infos:

I attached the uboot prompt showing the two environments.

0 Kudos
0 Replies