All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH v2] ts4800: update environment to boot with device tree
@ 2016-04-21 21:34 Damien Riegel
  2016-05-24 13:06 ` Stefano Babic
  0 siblings, 1 reply; 2+ messages in thread
From: Damien Riegel @ 2016-04-21 21:34 UTC (permalink / raw)
  To: u-boot

This commit updates the environment variables to be able to boot with a
device tree. The expected partition layout on the SD card is:
 - partition 1: type 0xDA, contains u-boot.bin
 - partition 2: type 0xC (fat), contains zImage and device tree
 - partition 3: type 0x83, root filesystem.

Signed-off-by: Damien Riegel <damien.riegel@savoirfairelinux.com>
---
Changes in v2:
 - do not mess with LOADADDR anymore

 include/configs/ts4800.h | 17 +++++++++++++----
 1 file changed, 13 insertions(+), 4 deletions(-)

diff --git a/include/configs/ts4800.h b/include/configs/ts4800.h
index fcc9d80..b369b27 100644
--- a/include/configs/ts4800.h
+++ b/include/configs/ts4800.h
@@ -106,19 +106,28 @@
 
 #define CONFIG_EXTRA_ENV_SETTINGS \
 	"script=boot.scr\0" \
-	"image=uImage\0" \
+	"image=zImage\0" \
+	"fdt_file=imx51-ts4800.dtb\0" \
+	"fdt_addr=0x90fe0000\0" \
 	"mmcdev=0\0" \
-	"mmcpart=1\0" \
-	"mmcargs=setenv bootargs root=/dev/mmcblk0p2 rootwait rw\0" \
+	"mmcpart=2\0" \
+	"mmcroot=/dev/mmcblk0p3 rootwait rw\0" \
+	"mmcargs=setenv bootargs root=${mmcroot}\0" \
 	"addtty=setenv bootargs ${bootargs} console=ttymxc0,${baudrate}\0" \
 	"loadbootscript=" \
 		"fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};\0" \
 	"bootscript=echo Running bootscript from mmc ...; " \
 		"source\0" \
 	"loadimage=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${image};\0" \
+	"loadfdt=fatload mmc ${mmcdev}:${mmcpart} ${fdt_addr} ${fdt_file}\0" \
 	"mmcboot=echo Booting from mmc ...; " \
 		"run mmcargs addtty; " \
-                "bootm; "
+		"if run loadfdt; then " \
+			"bootz ${loadaddr} - ${fdt_addr}; " \
+		"else " \
+			"echo ERR: cannot load FDT; " \
+		"fi; "
+
 
 #define CONFIG_BOOTCOMMAND \
 	"mmc dev ${mmcdev}; if mmc rescan; then " \
-- 
2.5.0

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [U-Boot] [PATCH v2] ts4800: update environment to boot with device tree
  2016-04-21 21:34 [U-Boot] [PATCH v2] ts4800: update environment to boot with device tree Damien Riegel
@ 2016-05-24 13:06 ` Stefano Babic
  0 siblings, 0 replies; 2+ messages in thread
From: Stefano Babic @ 2016-05-24 13:06 UTC (permalink / raw)
  To: u-boot

On 21/04/2016 23:34, Damien Riegel wrote:
> This commit updates the environment variables to be able to boot with a
> device tree. The expected partition layout on the SD card is:
>  - partition 1: type 0xDA, contains u-boot.bin
>  - partition 2: type 0xC (fat), contains zImage and device tree
>  - partition 3: type 0x83, root filesystem.
> 
> Signed-off-by: Damien Riegel <damien.riegel@savoirfairelinux.com>
> ---
> Changes in v2:
>  - do not mess with LOADADDR anymore
> 
>  include/configs/ts4800.h | 17 +++++++++++++----
>  1 file changed, 13 insertions(+), 4 deletions(-)
> 
> diff --git a/include/configs/ts4800.h b/include/configs/ts4800.h
> index fcc9d80..b369b27 100644
> --- a/include/configs/ts4800.h
> +++ b/include/configs/ts4800.h
> @@ -106,19 +106,28 @@
>  
>  #define CONFIG_EXTRA_ENV_SETTINGS \
>  	"script=boot.scr\0" \
> -	"image=uImage\0" \
> +	"image=zImage\0" \
> +	"fdt_file=imx51-ts4800.dtb\0" \
> +	"fdt_addr=0x90fe0000\0" \
>  	"mmcdev=0\0" \
> -	"mmcpart=1\0" \
> -	"mmcargs=setenv bootargs root=/dev/mmcblk0p2 rootwait rw\0" \
> +	"mmcpart=2\0" \
> +	"mmcroot=/dev/mmcblk0p3 rootwait rw\0" \
> +	"mmcargs=setenv bootargs root=${mmcroot}\0" \
>  	"addtty=setenv bootargs ${bootargs} console=ttymxc0,${baudrate}\0" \
>  	"loadbootscript=" \
>  		"fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};\0" \
>  	"bootscript=echo Running bootscript from mmc ...; " \
>  		"source\0" \
>  	"loadimage=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${image};\0" \
> +	"loadfdt=fatload mmc ${mmcdev}:${mmcpart} ${fdt_addr} ${fdt_file}\0" \
>  	"mmcboot=echo Booting from mmc ...; " \
>  		"run mmcargs addtty; " \
> -                "bootm; "
> +		"if run loadfdt; then " \
> +			"bootz ${loadaddr} - ${fdt_addr}; " \
> +		"else " \
> +			"echo ERR: cannot load FDT; " \
> +		"fi; "
> +
>  
>  #define CONFIG_BOOTCOMMAND \
>  	"mmc dev ${mmcdev}; if mmc rescan; then " \
> 

Applied to u-boot-imx, thanks !

Best regards,
Stefano Babic

-- 
=====================================================================
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-05-24 13:06 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-04-21 21:34 [U-Boot] [PATCH v2] ts4800: update environment to boot with device tree Damien Riegel
2016-05-24 13:06 ` Stefano Babic

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.