Skip to content
Snippets Groups Projects
Commit a3aa70af authored by Justin Waters's avatar Justin Waters Committed by Tom Rini
Browse files

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: default avatarJustin Waters <justin.waters@timesys.com>
parent 2c7c03be
No related branches found
No related tags found
No related merge requests found
......@@ -131,9 +131,23 @@
"loadramdisk=load mmc ${mmcdev} ${rdaddr} ramdisk.gz\0" \
"loaduimage=load mmc ${bootpart} ${loadaddr} ${bootdir}/${bootfile}\0" \
"loadfdt=load mmc ${bootpart} ${fdtaddr} ${bootdir}/${fdtfile}\0" \
"mmcboot=echo Booting from mmc ...; " \
"run mmcargs; " \
"bootm ${loadaddr} - ${fdtaddr}\0" \
"mmcboot=mmc dev ${mmcdev}; " \
"if mmc rescan; then " \
"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 ...; " \
"run spiargs; " \
"sf probe ${spibusno}:0; " \
......@@ -165,23 +179,11 @@
#define CONFIG_BOOTCOMMAND \
"run findfdt; " \
"mmc dev ${mmcdev}; if mmc rescan; then " \
"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 mmcboot;" \
"fi;" \
"else " \
"run nandboot;" \
"fi;" \
"run mmcboot;" \
"setenv mmcdev 1; " \
"setenv bootpart 1:2; " \
"run mmcboot;" \
"run nandboot;"
/* Clock Defines */
#define V_OSCK 24000000 /* Clock output from T2 */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment