summaryrefslogtreecommitdiff
path: root/arch/arm/cpu/armv8
diff options
context:
space:
mode:
authorPankit Garg <pankit.garg@nxp.com>2018-11-05 18:02:31 +0000
committerYork Sun <york.sun@nxp.com>2018-12-06 14:37:19 -0800
commitade32bb47375bdfaf52e151d904e2da5b4eb4344 (patch)
tree12f4a29e939eb58567c612f0c36bf2b1820677d3 /arch/arm/cpu/armv8
parentc5e6637f6889c0f7a45ad5ecd8f90a5268e5e067 (diff)
armv8: fsl-layerscape: add support of MC framework for TFA
Add support of MC framework for TFA Make MC framework independent of boot source. Signed-off-by: Rajesh Bhagat <rajesh.bhagat@nxp.com> Signed-off-by: Pankit Garg <pankit.garg@nxp.com> Reviewed-by: York Sun <york.sun@nxp.com>
Diffstat (limited to 'arch/arm/cpu/armv8')
-rw-r--r--arch/arm/cpu/armv8/fsl-layerscape/soc.c53
1 files changed, 52 insertions, 1 deletions
diff --git a/arch/arm/cpu/armv8/fsl-layerscape/soc.c b/arch/arm/cpu/armv8/fsl-layerscape/soc.c
index c0a8e301a5..0092a22394 100644
--- a/arch/arm/cpu/armv8/fsl-layerscape/soc.c
+++ b/arch/arm/cpu/armv8/fsl-layerscape/soc.c
@@ -747,6 +747,54 @@ int fsl_setenv_bootcmd(void)
}
return 0;
}
+
+int fsl_setenv_mcinitcmd(void)
+{
+ int ret = 0;
+ enum boot_src src = get_boot_src();
+
+ switch (src) {
+#ifdef IFC_MC_INIT_CMD
+ case BOOT_SOURCE_IFC_NAND:
+ case BOOT_SOURCE_IFC_NOR:
+ ret = env_set("mcinitcmd", IFC_MC_INIT_CMD);
+ break;
+#endif
+#ifdef QSPI_MC_INIT_CMD
+ case BOOT_SOURCE_QSPI_NAND:
+ case BOOT_SOURCE_QSPI_NOR:
+ ret = env_set("mcinitcmd", QSPI_MC_INIT_CMD);
+ break;
+#endif
+#ifdef XSPI_MC_INIT_CMD
+ case BOOT_SOURCE_XSPI_NAND:
+ case BOOT_SOURCE_XSPI_NOR:
+ ret = env_set("mcinitcmd", XSPI_MC_INIT_CMD);
+ break;
+#endif
+#ifdef SD_MC_INIT_CMD
+ case BOOT_SOURCE_SD_MMC:
+ ret = env_set("mcinitcmd", SD_MC_INIT_CMD);
+ break;
+#endif
+#ifdef SD2_MC_INIT_CMD
+ case BOOT_SOURCE_SD_MMC2:
+ ret = env_set("mcinitcmd", SD2_MC_INIT_CMD);
+ break;
+#endif
+ default:
+#ifdef QSPI_MC_INIT_CMD
+ ret = env_set("mcinitcmd", QSPI_MC_INIT_CMD);
+#endif
+ break;
+ }
+
+ if (ret) {
+ printf("Failed to set mcinitcmd: ret = %d\n", ret);
+ return ret;
+ }
+ return 0;
+}
#endif
#ifdef CONFIG_BOARD_LATE_INIT
@@ -758,9 +806,12 @@ int board_late_init(void)
#ifdef CONFIG_TFABOOT
/*
* check if gd->env_addr is default_environment; then setenv bootcmd
+ * and mcinitcmd.
*/
- if (gd->env_addr + gd->reloc_off == (ulong)&default_environment[0])
+ if (gd->env_addr + gd->reloc_off == (ulong)&default_environment[0]) {
fsl_setenv_bootcmd();
+ fsl_setenv_mcinitcmd();
+ }
#endif
#ifdef CONFIG_QSPI_AHB_INIT
qspi_ahb_init();