arm: omap5: dra7xx: Rework bootcmd to handle two MMC devs ti2013.04.02.prod.13.08.001
authoralaganraj <alaganraj.s@ti.com>
Tue, 6 Aug 2013 15:18:07 +0000 (20:48 +0530)
committerSomnath Mukherjee <somnath@ti.com>
Thu, 8 Aug 2013 13:05:34 +0000 (18:35 +0530)
omap5_uevm and dra7xx_evm both 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.

This is adopted from am335x_evm patch.

Signed-off-by: alaganraj <alaganraj.s@ti.com>
include/configs/omap5_common.h

index f2c4c70323ee93a3998a954ef06c0b1719ddcbaa..323649e38f2cee2e45e1efa5ca170414deb029f1 100644 (file)
        "importbootenv=echo Importing environment from mmc${mmcdev} ...; " \
                "env import -t ${loadaddr} ${filesize}\0" \
        "loadimage=load mmc ${bootpart} ${loadaddr} ${bootdir}/${bootfile}\0" \
-       "mmcboot=echo Booting from mmc${mmcdev} ...; " \
-               "run mmcargs; " \
-               "bootz ${loadaddr} - ${fdtaddr}\0" \
+       "mmcboot=mmc dev ${mmcdev}; " \
+               "if mmc rescan; then " \
+                       "echo SD/MMC found on device ${mmcdev};" \
+                       "if run loadbootscript; then " \
+                               "run bootscript; " \
+                       "else " \
+                               "if run loadbootenv; then " \
+                                       "run importbootenv; " \
+                               "fi;" \
+                               "if test -n ${uenvcmd}; then " \
+                                       "echo Running uenvcmd ...;" \
+                                       "run uenvcmd;" \
+                               "fi;" \
+                       "fi;" \
+                       "if run loadimage; then " \
+                               "run loadfdt; " \
+                               "run mmcargs; " \
+                               "bootz ${loadaddr} - ${fdtaddr};" \
+                       "fi; " \
+               "fi;\0" \
        "findfdt="\
                "if test $board_name = omap5_uevm; then " \
                        "setenv fdtfile omap5-uevm.dtb; fi;\0 " \
 
 #define CONFIG_BOOTCOMMAND \
        "run findfdt; " \
-       "mmc dev ${mmcdev}; if mmc rescan; then " \
-               "if run loadbootscript; then " \
-                       "run bootscript; " \
-               "else " \
-                       "if run loadbootenv; then " \
-                               "run importbootenv; " \
-                       "fi;" \
-                       "if test -n ${uenvcmd}; then " \
-                               "echo Running uenvcmd ...;" \
-                               "run uenvcmd;" \
-                       "fi;" \
-               "fi;" \
-               "if run loadimage; then " \
-                       "run loadfdt; " \
-                       "run mmcboot; " \
-               "fi; " \
-       "fi"
+       "run mmcboot;" \
+       "setenv mmcdev 1; " \
+       "setenv bootpart 1:2; " \
+       "run mmcboot;" \
 
 #define CONFIG_AUTO_COMPLETE           1