Skip to contentSkip to conversation

omap5_common: Re-work mmc boot to try SD and eMMC, correct root device

PATCH New Tom Rini 1 participant 2 messages Oct 9, 2013 – Oct 10, 2013

lore
Share & tools
lore

Tom Rini

author
#0 lore raw

PATCH 1/1 omap5_common: Re-work mmc boot to try SD and eMMC, correct root device

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.

---
 include/configs/omap5_common.h |   45 +++++++++++++++++++++-------------------
 1 file changed, 24 insertions(+), 21 deletions(-)
include/configs/omap5_common.h +24 -21
index 98ba559..eade637 100644
@@ -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} " \
@@ -97,9 +97,24 @@
 	"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; " \
@@ -111,23 +126,11 @@
 
 #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;" \
 
 
 /*
Signature · 1 line
1.7.9.5
author
#1 lore raw

PATCH 1/1 omap5_common: Re-work mmc boot to try SD and eMMC, correct root device

Quoted 9 lines · Tom Rini

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.

Applied to u-boot/master.

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20131010/cb1cf1d3/attachment.pgp>