summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin Waters <justin.waters@timesys.com>2013-07-09 14:07:41 -0400
committerJustin Waters <justin.waters@timesys.com>2013-08-05 14:27:08 -0400
commit581c14508f5b1d379d3dcbb6e776c53448772446 (patch)
tree1285811ae1ecd3fac232a810d83e512d39efb0da
parent38565d64cc7952afe6d0e548c5e88695345d0b7e (diff)
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>
-rw-r--r--include/configs/am335x_evm.h42
1 files changed, 22 insertions, 20 deletions
diff --git a/include/configs/am335x_evm.h b/include/configs/am335x_evm.h
index ea68b57d1b..0df0e7ac41 100644
--- a/include/configs/am335x_evm.h
+++ b/include/configs/am335x_evm.h
@@ -128,9 +128,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; " \
@@ -162,23 +176,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 */