It did not rightaway but it gave me enough help to fix the issue, mine now looks like:
Well, if you want, you can also expand it to make it simply conditional:
Code:
setenv bootargs_nand 'console=ttyS0,115200 ubi.mtd=1 root=ubi0:rootfs rootfstype=ubifs'
setenv bootcmd_nand 'setenv bootargs $(bootargs_nand) $(mtdpartitions); nand read.e 0x00800000 0x00100000 0x00400000; bootm 0x00800000'
setenv bootargs_sd console=ttyS0,115200
setenv bootcmd_sd 'mmcinit; ext2load mmc 0 0x0800000 /uInitrd; ext2load mmc 0 0x400000 /uImage'
setenv mmcbootcmd 'setenv bootargs $(bootargs_sd); run bootcmd_sd; bootm 0x400000 0x0800000'
setenv runsystem 'if itest $kernel -eq 1 then run mmcbootcmd || run bootcmd_nand; else run bootcmd_nand || mmcbootcmd; fi'
setenv kernel 1
setenv bootcmd 'run runsystem || echo boot failed'
setenv bootcmd_nand 'setenv bootargs $(bootargs_nand) $(mtdpartitions); nand read.e 0x00800000 0x00100000 0x00400000; bootm 0x00800000'
setenv bootargs_sd console=ttyS0,115200
setenv bootcmd_sd 'mmcinit; ext2load mmc 0 0x0800000 /uInitrd; ext2load mmc 0 0x400000 /uImage'
setenv mmcbootcmd 'setenv bootargs $(bootargs_sd); run bootcmd_sd; bootm 0x400000 0x0800000'
setenv runsystem 'if itest $kernel -eq 1 then run mmcbootcmd || run bootcmd_nand; else run bootcmd_nand || mmcbootcmd; fi'
setenv kernel 1
setenv bootcmd 'run runsystem || echo boot failed'
This way, you have a variable to select what you want to boot. Boots from mmc if kernel is set to 1, otherwise from NAND. It should post a message on serial if neither of them worked. Note that it will try the other boot if the other one failed. You're setting a preference with the kernel value.
I hope I got it correct; I quickly adapted my embedded boot logic to your examples. The or in the bootcmd is typically disaster recover; I go about erasing the u-boot variables and reset (was previously mentioned). In that case, it will default back to the hardcoded values.
In our development environment, this is further expanded with a NFS version that will fetch the kernel over TFTP with DHCP (DHCP filename entry) , boot the kernel and then mount a NFS system with that particular version (kernel value 0).
This way, you can maintain lots of development systems with several NFS filesystems and kernel files without much customisation of the U-Boot variables and offloading the customisation to a central DHCP server config file.
Got a note that my Sheevas got shipped beginning of this week, so I'll be trying this out next week or so; need to port it fully. If there is interest, I could add more info about that later on.





