diff mbox series

[1/2] env: ti: mmc: add save_uenv command

Message ID 20240124-b4-upstream-save_uenv-v1-1-4a4dfbd3eca9@ti.com
State Rejected
Delegated to: Tom Rini
Headers show
Series Add save_uenv command | expand

Commit Message

Manorit Chawdhry Jan. 24, 2024, 7:26 a.m. UTC
This is to make easier development with uEnv.txt to update from the
board on the fly from u-boot to MMC boot media.

Signed-off-by: Manorit Chawdhry <m-chawdhry@ti.com>
---
 include/env/ti/mmc.env | 3 +++
 1 file changed, 3 insertions(+)

Comments

Nishanth Menon Jan. 24, 2024, 6:13 p.m. UTC | #1
On 12:56-20240124, Manorit Chawdhry wrote:
> This is to make easier development with uEnv.txt to update from the
> board on the fly from u-boot to MMC boot media.
> 
> Signed-off-by: Manorit Chawdhry <m-chawdhry@ti.com>
> ---
>  include/env/ti/mmc.env | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/include/env/ti/mmc.env b/include/env/ti/mmc.env
> index 0256a2d2aaca..886e4cab36fe 100644
> --- a/include/env/ti/mmc.env
> +++ b/include/env/ti/mmc.env
> @@ -34,6 +34,9 @@ envboot=if mmc dev ${mmcdev}; then
>  		fi;
>  	fi;
>    fi;
> +save_uenv=
> +	env export -t $loadaddr $save_to_env save_to_env;
> +	fatwrite mmc ${mmcdev} ${loadaddr} ${bootenvfile} ${filesize};

Please NO! saveenv has ability.. why not use that? it is better to
improve the commands themselves.

>  mmcloados=
>  	if test ${boot_fdt} = yes || test ${boot_fdt} = try; then
>  		if run get_fdt_mmc; then
> 
> -- 
> 2.43.0
>
diff mbox series

Patch

diff --git a/include/env/ti/mmc.env b/include/env/ti/mmc.env
index 0256a2d2aaca..886e4cab36fe 100644
--- a/include/env/ti/mmc.env
+++ b/include/env/ti/mmc.env
@@ -34,6 +34,9 @@  envboot=if mmc dev ${mmcdev}; then
 		fi;
 	fi;
   fi;
+save_uenv=
+	env export -t $loadaddr $save_to_env save_to_env;
+	fatwrite mmc ${mmcdev} ${loadaddr} ${bootenvfile} ${filesize};
 mmcloados=
 	if test ${boot_fdt} = yes || test ${boot_fdt} = try; then
 		if run get_fdt_mmc; then