[PATCH 0/2] Add save_uenv command

Adding this command for easier development to update uEnv.txt from u-boot on the u-boot prompt and track the variables being updated in uEnv.txt as well.
Signed-off-by: Manorit Chawdhry m-chawdhry@ti.com --- Manorit Chawdhry (2): env: ti: mmc: add save_uenv command doc: k3: update documentation for uEnv.txt
doc/board/ti/k3.rst | 24 ++++++++++++++---------- include/env/ti/mmc.env | 3 +++ 2 files changed, 17 insertions(+), 10 deletions(-) --- base-commit: f28a77589e7505535a4eebdc7269df98f67dbe68 change-id: 20240124-b4-upstream-save_uenv-1784463fe4da
Best regards,

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}; mmcloados= if test ${boot_fdt} = yes || test ${boot_fdt} = try; then if run get_fdt_mmc; then

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

Add the information for the save_uenv command and refactor the documentation to remove the eMMC information that was wrong.
Signed-off-by: Manorit Chawdhry m-chawdhry@ti.com --- doc/board/ti/k3.rst | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-)
diff --git a/doc/board/ti/k3.rst b/doc/board/ti/k3.rst index 7dfe39c5fa57..e95779e32566 100644 --- a/doc/board/ti/k3.rst +++ b/doc/board/ti/k3.rst @@ -594,20 +594,21 @@ Refer (:ref:`U-boot ARMV8 build <k3_rst_include_start_build_steps_uboot>`) Saving environment ------------------
-SAVEENV is disabled by default and for the new flow uses Uenv.txt as the default -way for saving the environments. This has been done as Uenv.txt is more granular -then the saveenv command and can be used across various bootmodes too. +CONFIG_CMD_SAVEENV is disabled by default and for the new flow uses +uEnv.txt as the default way for saving the environments. This has been done +as uEnv.txt is more granular then the saveenv command and can be used +across various bootmodes too.
-**Writing to MMC/EMMC** +**Writing to MMC**
.. prompt:: bash =>
- env export -t $loadaddr <list of variables> - fatwrite mmc ${mmcdev} ${loadaddr} ${bootenvfile} ${filesize} + setenv save_to_env <variables to be saved in uEnv.txt> + run save_uenv
-**Reading from MMC/EMMC** +**Reading from MMC**
-By default run envboot will read it from the MMC/EMMC partition ( based on +By default run envboot will read it from the MMC partition ( based on mmcdev) and set the environments.
If manually needs to be done then the environment can be read from the @@ -615,8 +616,11 @@ filesystem and then imported
.. prompt:: bash =>
- fatload mmc ${mmcdev} ${loadaddr} ${bootenvfile} - env import -t ${loadaddr} ${filesize} + run envboot + +To read from eMMC, the save_uenv and envboot commands would need to be +changed to pickup the bootenvfile from eMMC. Mainly the write and read +commands would change to eMMC.
.. _k3_rst_refer_openocd:
participants (2)
-
Manorit Chawdhry
-
Nishanth Menon