[U-Boot] configs: omap4_common: support load from uEnv.txt

Submitted by Nishanth Menon on Jan. 11, 2013, 8:39 p.m.

Details

Message ID 1357936790-27543-1-git-send-email-nm@ti.com
State Rejected
Delegated to: Tom Rini
Headers show

Commit Message

Nishanth Menon Jan. 11, 2013, 8:39 p.m.
if traditionally used boot.scr is not found see if uEnv.txt
is available to load environment. uenvcmd is executed after load
of uEnv.txt if it is defined in the environment text file

Signed-off-by: Nishanth Menon <nm@ti.com>
---
 include/configs/omap4_common.h |   12 ++++++++++++
 1 file changed, 12 insertions(+)

Comments

Nishanth Menon Jan. 11, 2013, 8:50 p.m.
On 14:39-20130111, Nishanth Menon wrote:
> if traditionally used boot.scr is not found see if uEnv.txt
> is available to load environment. uenvcmd is executed after load
> of uEnv.txt if it is defined in the environment text file
> 
> Signed-off-by: Nishanth Menon <nm@ti.com>
> ---
>  include/configs/omap4_common.h |   12 ++++++++++++
>  1 file changed, 12 insertions(+)
> 
> diff --git a/include/configs/omap4_common.h b/include/configs/omap4_common.h
> index a32369a..8b71beb 100644
> --- a/include/configs/omap4_common.h
> +++ b/include/configs/omap4_common.h
> @@ -159,6 +159,10 @@
>  	"loadbootscript=fatload mmc ${mmcdev} ${loadaddr} boot.scr\0" \
>  	"bootscript=echo Running bootscript from mmc${mmcdev} ...; " \
>  		"source ${loadaddr}\0" \
> +	"bootenv=uEnv.txt\0" \
> +	"loadbootenv=fatload mmc ${mmcdev} ${loadaddr} ${bootenv}\0" \
> +	"importbootenv=echo Importing environment from mmc ...; " \
> +		"env import -t $loadaddr $filesize\0" \
>  	"loaduimage=fatload mmc ${mmcdev} ${loadaddr} uImage\0" \
>  	"mmcboot=echo Booting from mmc${mmcdev} ...; " \
>  		"run mmcargs; " \
> @@ -169,6 +173,14 @@
>  		"if run loadbootscript; then " \
>  			"run bootscript; " \
>  		"else " \
> +			"if run loadbootenv; then " \
> +				"echo Loaded environment from ${bootenv};" \
> +				"run importbootenv;" \
> +				"if test -n $uenvcmd; then " \
> +					"echo Running uenvcmd ...;" \
> +					"run uenvcmd;" \
> +				"fi;" \
> +			"fi;" \
>  			"if run loaduimage; then " \
>  				"run mmcboot; " \
>  			"fi; " \
> -- 
> 1.7.9.5
> 
Thanks to Tom pointing in IRC, patch
http://patchwork.ozlabs.org/patch/209925/
prefer that patch be merged instead of mine.

Patch hide | download patch | download mbox

diff --git a/include/configs/omap4_common.h b/include/configs/omap4_common.h
index a32369a..8b71beb 100644
--- a/include/configs/omap4_common.h
+++ b/include/configs/omap4_common.h
@@ -159,6 +159,10 @@ 
 	"loadbootscript=fatload mmc ${mmcdev} ${loadaddr} boot.scr\0" \
 	"bootscript=echo Running bootscript from mmc${mmcdev} ...; " \
 		"source ${loadaddr}\0" \
+	"bootenv=uEnv.txt\0" \
+	"loadbootenv=fatload mmc ${mmcdev} ${loadaddr} ${bootenv}\0" \
+	"importbootenv=echo Importing environment from mmc ...; " \
+		"env import -t $loadaddr $filesize\0" \
 	"loaduimage=fatload mmc ${mmcdev} ${loadaddr} uImage\0" \
 	"mmcboot=echo Booting from mmc${mmcdev} ...; " \
 		"run mmcargs; " \
@@ -169,6 +173,14 @@ 
 		"if run loadbootscript; then " \
 			"run bootscript; " \
 		"else " \
+			"if run loadbootenv; then " \
+				"echo Loaded environment from ${bootenv};" \
+				"run importbootenv;" \
+				"if test -n $uenvcmd; then " \
+					"echo Running uenvcmd ...;" \
+					"run uenvcmd;" \
+				"fi;" \
+			"fi;" \
 			"if run loaduimage; then " \
 				"run mmcboot; " \
 			"fi; " \