Patchwork [U-Boot,v3,3/3] am335x_evm: Add more variables and switch to DT booting.

login
register
mail settings
Submitter Tom Rini
Date March 14, 2013, 3:55 p.m.
Message ID <1363276521-11283-4-git-send-email-trini@ti.com>
Download mbox | patch
Permalink /patch/227725/
State Accepted
Delegated to: Tom Rini
Headers show

Comments

Tom Rini - March 14, 2013, 3:55 p.m.
From: Koen Kooi <koen@dominion.thruhere.net>

Make bootcmd run findfdt so that we know what dtb file to load.  Add a
loadfdt command to load this file in.  Make mmcboot pass in ${fdtaddr}
and make the mmc section of bootcmd run loadfdt.

Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
Signed-off-by: Tom Rini <trini@ti.com>
---
 include/configs/am335x_evm.h |   10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)
Peter Korsgaard - March 14, 2013, 4:01 p.m.
>>>>> "Tom" == Tom Rini <trini@ti.com> writes:

 Tom> From: Koen Kooi <koen@dominion.thruhere.net>
 Tom> Make bootcmd run findfdt so that we know what dtb file to load.  Add a
 Tom> loadfdt command to load this file in.  Make mmcboot pass in ${fdtaddr}
 Tom> and make the mmc section of bootcmd run loadfdt.

 Tom> Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
 Tom> Signed-off-by: Tom Rini <trini@ti.com>

Acked-by: Peter Korsgaard <jacmet@sunsite.dk>

Patch

diff --git a/include/configs/am335x_evm.h b/include/configs/am335x_evm.h
index c0e4724..6a842e0 100644
--- a/include/configs/am335x_evm.h
+++ b/include/configs/am335x_evm.h
@@ -54,7 +54,8 @@ 
 	"fdtaddr=0x80F80000\0" \
 	"fdt_high=0xffffffff\0" \
 	"rdaddr=0x81000000\0" \
-	"bootfile=/boot/uImage\0" \
+	"bootdir=/boot\0" \
+	"bootfile=uImage\0" \
 	"fdtfile=\0" \
 	"console=ttyO0,115200n8\0" \
 	"optargs=\0" \
@@ -77,10 +78,11 @@ 
 		"root=${ramroot} " \
 		"rootfstype=${ramrootfstype}\0" \
 	"loadramdisk=load mmc ${mmcdev} ${rdaddr} ramdisk.gz\0" \
-	"loaduimage=load mmc ${bootpart} ${loadaddr} ${bootfile}\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}\0" \
+		"bootm ${loadaddr} - ${fdtaddr}\0" \
 	"ramboot=echo Booting from ramdisk ...; " \
 		"run ramargs; " \
 		"bootm ${loadaddr}\0" \
@@ -95,6 +97,7 @@ 
 			"setenv fdtfile am335x-evmsk.dtb; fi\0" \
 
 #define CONFIG_BOOTCOMMAND \
+	"run findfdt; " \
 	"mmc dev ${mmcdev}; if mmc rescan; then " \
 		"echo SD/MMC found on device ${mmcdev};" \
 		"if run loadbootenv; then " \
@@ -106,6 +109,7 @@ 
 			"run uenvcmd;" \
 		"fi;" \
 		"if run loaduimage; then " \
+			"run loadfdt;" \
 			"run mmcboot;" \
 		"fi;" \
 	"fi;" \