summaryrefslogtreecommitdiff
path: root/arch/arm/mach-imx/mx7ulp
diff options
context:
space:
mode:
authorPeng Fan <peng.fan@nxp.com>2019-07-22 01:24:37 +0000
committerStefano Babic <sbabic@denx.de>2019-10-08 16:35:16 +0200
commite92fca66a3966c54d86977539fabe57596b62d76 (patch)
tree60f35a77c40e185b3162da18780a96f929cacc89 /arch/arm/mach-imx/mx7ulp
parentb1f955cb4d5ba10e422e08d1d7577be71a39ac00 (diff)
imx: i.MX7ULP: add get_boot_device
Add get_boot_device for i.MX7ULP Signed-off-by: Peng Fan <peng.fan@nxp.com> Tested-by: Fabio Estevam <festevam@gmail.com>
Diffstat (limited to 'arch/arm/mach-imx/mx7ulp')
-rw-r--r--arch/arm/mach-imx/mx7ulp/soc.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/arch/arm/mach-imx/mx7ulp/soc.c b/arch/arm/mach-imx/mx7ulp/soc.c
index c72f0ed3fc..6015c11869 100644
--- a/arch/arm/mach-imx/mx7ulp/soc.c
+++ b/arch/arm/mach-imx/mx7ulp/soc.c
@@ -6,6 +6,7 @@
#include <asm/arch/clock.h>
#include <asm/arch/imx-regs.h>
#include <asm/arch/sys_proto.h>
+#include <asm/mach-imx/boot_mode.h>
#include <asm/mach-imx/hab.h>
static char *get_reset_cause(char *);
@@ -244,3 +245,29 @@ int mmc_get_env_dev(void)
return board_mmc_get_env_dev(devno);
}
#endif
+
+enum boot_device get_boot_device(void)
+{
+ struct bootrom_sw_info **p =
+ (struct bootrom_sw_info **)ROM_SW_INFO_ADDR;
+
+ enum boot_device boot_dev = SD1_BOOT;
+ u8 boot_type = (*p)->boot_dev_type;
+ u8 boot_instance = (*p)->boot_dev_instance;
+
+ switch (boot_type) {
+ case BOOT_TYPE_SD:
+ boot_dev = boot_instance + SD1_BOOT;
+ break;
+ case BOOT_TYPE_MMC:
+ boot_dev = boot_instance + MMC1_BOOT;
+ break;
+ case BOOT_TYPE_USB:
+ boot_dev = USB_BOOT;
+ break;
+ default:
+ break;
+ }
+
+ return boot_dev;
+}