aboutsummaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorYe Li2022-04-06 14:30:30 +0800
committerStefano Babic2022-04-12 19:10:43 +0200
commitc41ffaa253aa462e3e60019f430776db9bf4bf3f (patch)
tree4a703763e9424e3d4fe1d17997ad0a7b7fc45ccb /arch
parent4b33383feefbcfc689163c0387e9a38d2ce27172 (diff)
imx: imx8ulp_evk: Enable multiple env storage devices
Enable multiple storages for u-boot env: MMC or SPI flash or NOWHERE for usb so u-boot can runtime select the storage flash according to boot device. Signed-off-by: Ye Li <ye.li@nxp.com> Signed-off-by: Peng Fan <peng.fan@nxp.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/mach-imx/imx8ulp/soc.c36
1 files changed, 36 insertions, 0 deletions
diff --git a/arch/arm/mach-imx/imx8ulp/soc.c b/arch/arm/mach-imx/imx8ulp/soc.c
index 25b4fbd294e..35020c9714d 100644
--- a/arch/arm/mach-imx/imx8ulp/soc.c
+++ b/arch/arm/mach-imx/imx8ulp/soc.c
@@ -27,6 +27,8 @@
#include <fuse.h>
#include <thermal.h>
#include <linux/iopoll.h>
+#include <env.h>
+#include <env_internal.h>
DECLARE_GLOBAL_DATA_PTR;
@@ -787,3 +789,37 @@ u32 spl_arch_boot_image_offset(u32 image_offset, u32 rom_bt_dev)
return image_offset;
}
+
+enum env_location env_get_location(enum env_operation op, int prio)
+{
+ enum boot_device dev = get_boot_device();
+ enum env_location env_loc = ENVL_UNKNOWN;
+
+ if (prio)
+ return env_loc;
+
+ switch (dev) {
+#ifdef CONFIG_ENV_IS_IN_SPI_FLASH
+ case QSPI_BOOT:
+ env_loc = ENVL_SPI_FLASH;
+ break;
+#endif
+#ifdef CONFIG_ENV_IS_IN_MMC
+ case SD1_BOOT:
+ case SD2_BOOT:
+ case SD3_BOOT:
+ case MMC1_BOOT:
+ case MMC2_BOOT:
+ case MMC3_BOOT:
+ env_loc = ENVL_MMC;
+ break;
+#endif
+ default:
+#if defined(CONFIG_ENV_IS_NOWHERE)
+ env_loc = ENVL_NOWHERE;
+#endif
+ break;
+ }
+
+ return env_loc;
+}