am335x_evm: Rework bootcmd to handle two MMC devs

The BeagleBone Black can boot from either the MMC card
or eMMC chip on board. We should try both interfaces.

This modification also allows a graceful fallback if
a device exists but boot images are not present on it.

Changes for v2:

* Fix boot partition - it should always show up as mmcblk0p2
* Fix missing FDT load

Signed-off-by: Justin Waters <justin.waters@timesys.com>
This commit is contained in:
Justin Waters 2013-07-11 09:55:00 -04:00 committed by Tom Rini
parent 2c7c03bed1
commit a3aa70afb7

View file

@ -131,9 +131,23 @@
"loadramdisk=load mmc ${mmcdev} ${rdaddr} ramdisk.gz\0" \ "loadramdisk=load mmc ${mmcdev} ${rdaddr} ramdisk.gz\0" \
"loaduimage=load mmc ${bootpart} ${loadaddr} ${bootdir}/${bootfile}\0" \ "loaduimage=load mmc ${bootpart} ${loadaddr} ${bootdir}/${bootfile}\0" \
"loadfdt=load mmc ${bootpart} ${fdtaddr} ${bootdir}/${fdtfile}\0" \ "loadfdt=load mmc ${bootpart} ${fdtaddr} ${bootdir}/${fdtfile}\0" \
"mmcboot=echo Booting from mmc ...; " \ "mmcboot=mmc dev ${mmcdev}; " \
"run mmcargs; " \ "if mmc rescan; then " \
"bootm ${loadaddr} - ${fdtaddr}\0" \ "echo SD/MMC found on device ${mmcdev};" \
"if run loadbootenv; then " \
"echo Loaded environment from ${bootenv};" \
"run importbootenv;" \
"fi;" \
"if test -n $uenvcmd; then " \
"echo Running uenvcmd ...;" \
"run uenvcmd;" \
"fi;" \
"if run loaduimage; then " \
"run loadfdt;" \
"run mmcargs; " \
"bootm ${loadaddr} - ${fdtaddr};" \
"fi;" \
"fi;\0" \
"spiboot=echo Booting from spi ...; " \ "spiboot=echo Booting from spi ...; " \
"run spiargs; " \ "run spiargs; " \
"sf probe ${spibusno}:0; " \ "sf probe ${spibusno}:0; " \
@ -165,23 +179,11 @@
#define CONFIG_BOOTCOMMAND \ #define CONFIG_BOOTCOMMAND \
"run findfdt; " \ "run findfdt; " \
"mmc dev ${mmcdev}; if mmc rescan; then " \ "run mmcboot;" \
"echo SD/MMC found on device ${mmcdev};" \ "setenv mmcdev 1; " \
"if run loadbootenv; then " \ "setenv bootpart 1:2; " \
"echo Loaded environment from ${bootenv};" \ "run mmcboot;" \
"run importbootenv;" \ "run nandboot;"
"fi;" \
"if test -n $uenvcmd; then " \
"echo Running uenvcmd ...;" \
"run uenvcmd;" \
"fi;" \
"if run loaduimage; then " \
"run loadfdt;" \
"run mmcboot;" \
"fi;" \
"else " \
"run nandboot;" \
"fi;" \
/* Clock Defines */ /* Clock Defines */
#define V_OSCK 24000000 /* Clock output from T2 */ #define V_OSCK 24000000 /* Clock output from T2 */