]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
armv8: fsl : create bootcmd and mcinitcmd as per boot source
authorWasim Khan <wasim.khan@nxp.com>
Mon, 2 Aug 2021 08:34:52 +0000 (10:34 +0200)
committerPriyanka Jain <priyanka.jain@nxp.com>
Wed, 18 Aug 2021 10:25:15 +0000 (15:55 +0530)
NXP platforms expect custom bootcmd and mcinitcmd to be
updated as per boot source with default environment.
Check env variable fsl_bootcmd_mcinitcmd_set to prepare
bootcmd and mcinitcmd

Fixes: cbf77d201870 (armv8: fsl-layerscape: Fix automatic
setting of bootmcd with TF-A)

Signed-off-by: Wasim Khan <wasim.khan@nxp.com>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
arch/arm/cpu/armv8/fsl-layerscape/soc.c

index 1641b657990a892cc4c92be7389ad9487f42c469..42a096854629164ac583185960e463160783cfd5 100644 (file)
@@ -953,12 +953,15 @@ int board_late_init(void)
 #endif
 #ifdef CONFIG_TFABOOT
        /*
-        * Set bootcmd and mcinitcmd if they don't exist in the environment.
+        * Set bootcmd and mcinitcmd if "fsl_bootcmd_mcinitcmd_set" does
+        * not exists in env
         */
-       if (!env_get("bootcmd"))
+       if (env_get_yesno("fsl_bootcmd_mcinitcmd_set") <= 0) {
+               // Set bootcmd and mcinitcmd as per boot source
                fsl_setenv_bootcmd();
-       if (!env_get("mcinitcmd"))
                fsl_setenv_mcinitcmd();
+               env_set("fsl_bootcmd_mcinitcmd_set", "y");
+       }
 #endif
 #ifdef CONFIG_QSPI_AHB_INIT
        qspi_ahb_init();