]> git.sur5r.net Git - u-boot/commitdiff
omap5_common: Re-work mmc boot to try SD and eMMC, correct root device
authorTom Rini <trini@ti.com>
Wed, 9 Oct 2013 14:59:33 +0000 (10:59 -0400)
committerTom Rini <trini@ti.com>
Wed, 9 Oct 2013 18:13:43 +0000 (14:13 -0400)
OMAP5 boards may have both eMMC (on MMC2) and an SD slot (on MMC1).  We
Update the default bootcmd to match what happens on AM335x where we try
SD first, and then eMMC.  In this case however, the hardware layout used
for powering both of these means that in the kernel eMMC shall be found
first as it is powered by a fixed regulator and SD found second as SD is
powered via the palmas which will result in deferred probing.

Tested-by: Aparna Balasubramanian <aparnab@ti.com>
Signed-off-by: Tom Rini <trini@ti.com>
include/configs/omap5_common.h

index 98ba559c86d134f2158c1d047ab3a018d12c911a..eade6375cdb9c8609f09e1dc6cf11cb2e3298fbc 100644 (file)
@@ -83,7 +83,7 @@
        "partitions=" PARTS_DEFAULT "\0" \
        "optargs=\0" \
        "mmcdev=0\0" \
-       "mmcroot=/dev/mmcblk0p2 rw\0" \
+       "mmcroot=/dev/mmcblk1p2 rw\0" \
        "mmcrootfstype=ext4 rootwait\0" \
        "mmcargs=setenv bootargs console=${console} " \
                "${optargs} " \
        "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 loadbootenv; then " \
+                               "echo Loaded environment from ${bootenv};" \
+                               "run importbootenv;" \
+                       "fi;" \
+                       "if test -n $uenvcmd; then " \
+                               "echo Running uenvcmd ...;" \
+                               "run uenvcmd;" \
+                       "fi;" \
+                       "if run loadimage; then " \
+                               "run loadfdt; " \
+                               "echo Booting from mmc${mmcdev} ...; " \
+                               "run mmcargs; " \
+                               "bootz ${loadaddr} - ${fdtaddr}; " \
+                       "fi;" \
+               "fi;\0" \
        "findfdt="\
                "if test $board_name = omap5_uevm; then " \
                        "setenv fdtfile omap5-uevm.dtb; fi; " \
 
 #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; " \
+       "setenv mmcroot /dev/mmcblk0p2 rw; " \
+       "run mmcboot;" \
 
 
 /*