arm: omap5: dra7xx: Rework bootcmd to handle two MMC devs
[glsdk/glsdk-u-boot.git] / 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