From: Patrick Delaunay Date: Fri, 21 Jun 2019 15:21:52 +0200 Subject: [U-Boot] [PATCH 14/16] stm32mp1: add check for presence of environment in boot device In-Reply-To: <1561123314-709-1-git-send-email-patrick.delaunay@st.com> References: <1561123314-709-1-git-send-email-patrick.delaunay@st.com> Message-ID: <1561123314-709-15-git-send-email-patrick.delaunay@st.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de For boot from flash, check presence of default environment to force save env. Signed-off-by: Patrick Delaunay --- include/configs/stm32mp1.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/configs/stm32mp1.h b/include/configs/stm32mp1.h index 1d385e0..6c74b4b 100644 --- a/include/configs/stm32mp1.h +++ b/include/configs/stm32mp1.h @@ -112,6 +112,7 @@ "if test ${boot_device} = serial || test ${boot_device} = usb;" \ "then stm32prog ${boot_device} ${boot_instance}; " \ "else " \ + "run env_check;" \ "if test ${boot_device} = mmc;" \ "then env set boot_targets \"mmc${boot_instance}\"; fi;" \ "if test ${boot_device} = nand;" \ @@ -143,6 +144,9 @@ "ramdisk_addr_r=0xc4400000\0" \ "fdt_high=0xffffffff\0" \ "initrd_high=0xffffffff\0" \ + "env_default=1\0" \ + "env_check=if test $env_default -eq 1;"\ + " then env set env_default 0;env save;fi\0" \ STM32MP_BOOTCMD \ STM32MP_MTDPARTS \ BOOTENV -- 2.7.4