*/
#include <asm/arch/imx-regs.h>
+#include <asm/arch/sys_proto.h>
#include <asm/global_data.h>
#include <asm/io.h>
+#include <asm/mach-imx/boot_mode.h>
#include <efi.h>
#include <efi_loader.h>
+#include <env_internal.h>
#include <fdt_support.h>
#include <linux/errno.h>
#include <linux/kernel.h>
{
return 0;
}
+
+enum env_location env_get_location(enum env_operation op, int prio)
+{
+ enum boot_device boot_dev = get_boot_device();
+
+ if (prio)
+ return ENVL_UNKNOWN;
+
+ /*
+ * Make sure that the environment is loaded from
+ * the MMC if we are running from SD card or eMMC.
+ */
+ if (CONFIG_IS_ENABLED(ENV_IS_IN_MMC) &&
+ (boot_dev == SD1_BOOT || boot_dev == SD2_BOOT))
+ return ENVL_MMC;
+
+ if (CONFIG_IS_ENABLED(ENV_IS_IN_SPI_FLASH))
+ return ENVL_SPI_FLASH;
+
+ return ENVL_NOWHERE;
+}
+
+#if defined(CONFIG_ENV_IS_IN_MMC)
+int board_mmc_get_env_dev(int devno)
+{
+ return devno;
+}
+#endif