Question

In U-Boot (from Denx), is there a possibility to influence in the SPL part what uImage file gets loaded from the U-Boot part?

No correct solution

OTHER TIPS

Yes, it is possible. Not much information you have provided, so I can't tell exactly how, but I'll give you an example what could be done on am335x board using NAND disk that stores multiple images.

1) Find boot scripts your board is using. Usually they are located in ./configs/yourboardname.h The lines of interest should look something like:

    #define CONFIG_EXTRA_ENV_SETTINGS \
<..>
    "nandsrcaddr=0x280000\0" \
    "nandimgsize=0x500000\0" \
    "nandboot=echo Booting from nand ...; " \
        "run nandargs; " \
        "nand read ${loadaddr} ${nandsrcaddr} ${nandimgsize}; " \
        "bootm ${loadaddr}\0" \
<...>

...that translates to "copy a kernel image from nandsrcaddr location on NAND to ram and try to run it from there".

2) Since environmental variables are stored on NAND in a static location, you can easily write a simple function in SPL that manually overwrites nandsrcaddr using it's address (I'm not going into details how to find out that address, again, it depends on your configuration). After that, recalculate CRC and write it too. See the structure of environmentals - struct environment_s.

3) Add a switch to SPL board_init_r function (./common/spl/spl.c) so when a certain condition is met (button press during boot, jumper settings etc.) your function (see 2) is called and the address of a kernel image is changed.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top