Hi Patrick

On 3/31/20 6:04 PM, Patrick Delaunay wrote:
> Imply CONFIG_VERSION_VARIABLE for stm32mp1 target
> and test U-Boot version ($env_ver) when the environment was
> saved for the last time and to display warning trace.
>
> Signed-off-by: Patrick Delaunay <patrick.delau...@st.com>
> ---
>
>  arch/arm/mach-stm32mp/Kconfig |  1 +
>  include/configs/stm32mp1.h    | 11 ++++++++---
>  2 files changed, 9 insertions(+), 3 deletions(-)
>
> diff --git a/arch/arm/mach-stm32mp/Kconfig b/arch/arm/mach-stm32mp/Kconfig
> index 032facff31..a86288cb76 100644
> --- a/arch/arm/mach-stm32mp/Kconfig
> +++ b/arch/arm/mach-stm32mp/Kconfig
> @@ -67,6 +67,7 @@ config TARGET_ST_STM32MP15x
>       imply DISABLE_CONSOLE
>       imply PRE_CONSOLE_BUFFER
>       imply SILENT_CONSOLE
> +     imply VERSION_VARIABLE
>       help
>               target the STMicroelectronics board with SOC STM32MP15x
>               managed by board/st/stm32mp1:
> diff --git a/include/configs/stm32mp1.h b/include/configs/stm32mp1.h
> index 42717c167e..ae060fbc4b 100644
> --- a/include/configs/stm32mp1.h
> +++ b/include/configs/stm32mp1.h
> @@ -222,9 +222,14 @@
>       "splashimage=0xc4300000\0"  \
>       "ramdisk_addr_r=0xc4400000\0" \
>       "altbootcmd=run bootcmd\0" \
> -     "env_default=1\0" \
> -     "env_check=if test $env_default -eq 1;"\
> -             " then env set env_default 0;env save;fi\0" \
> +     "env_check=" \
> +             "env exists env_ver || env set env_ver ${ver};" \
> +             "if env info -p -d -q; then env save; fi;" \

Is option "-q" exist ? i can't find anything about it into source code


> +             "if test \"$env_ver\" != \"$ver\"; then" \
> +             " echo \"*** Warning: old environment ${env_ver}\";" \
> +             " echo '* set default: env default -a; env save; reset';" \
> +             " echo '* update current: env set env_ver ${ver}; env save';" \
> +             "fi;\0" \
>       STM32MP_BOOTCMD \
>       STM32MP_MTDPARTS \
>       STM32MP_DFU_ALT_RAM \

Reply via email to