summaryrefslogtreecommitdiffstats
path: root/arch/arm/cpu/armv7/mx7
diff options
context:
space:
mode:
authorPeng Fan <peng.fan@nxp.com>2016-01-28 16:51:25 +0800
committerStefano Babic <sbabic@denx.de>2016-02-04 10:13:45 +0100
commit62d8cce9f37c12ff92a47414484997a74d038440 (patch)
tree7d13defef8d5c2a3397cd1a5f2fb3c4868b2dfe6 /arch/arm/cpu/armv7/mx7
parent9e30ba2d75b2f4a4880080fc1f9795e9bf59408e (diff)
downloadblackbird-obmc-uboot-62d8cce9f37c12ff92a47414484997a74d038440.tar.gz
blackbird-obmc-uboot-62d8cce9f37c12ff92a47414484997a74d038440.zip
imx: mx7dsabresd: move mmc_get_env_devno to soc code
Move mmc_get_env_devno to soc.c and rename to mmc_get_env_dev to match the one in common/env_mmc.c. Introduce a weak function board_mmc_get_env_dev. Different boards can implement this according to sdhc controller which is used by the board. Signed-off-by: Peng Fan <peng.fan@nxp.com> Cc: Stefano Babic <sbabic@denx.de>
Diffstat (limited to 'arch/arm/cpu/armv7/mx7')
-rw-r--r--arch/arm/cpu/armv7/mx7/soc.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/arch/arm/cpu/armv7/mx7/soc.c b/arch/arm/cpu/armv7/mx7/soc.c
index 1d8e470971..a6ab551a4a 100644
--- a/arch/arm/cpu/armv7/mx7/soc.c
+++ b/arch/arm/cpu/armv7/mx7/soc.c
@@ -288,6 +288,27 @@ enum boot_device get_boot_device(void)
return boot_dev;
}
+#ifdef CONFIG_ENV_IS_IN_MMC
+__weak int board_mmc_get_env_dev(int devno)
+{
+ return CONFIG_SYS_MMC_ENV_DEV;
+}
+
+int mmc_get_env_dev(void)
+{
+ struct bootrom_sw_info **p =
+ (struct bootrom_sw_info **)ROM_SW_INFO_ADDR;
+ int devno = (*p)->boot_dev_instance;
+ u8 boot_type = (*p)->boot_dev_type;
+
+ /* If not boot from sd/mmc, use default value */
+ if ((boot_type != BOOT_TYPE_SD) && (boot_type != BOOT_TYPE_MMC))
+ return CONFIG_SYS_MMC_ENV_DEV;
+
+ return board_mmc_get_env_dev(devno);
+}
+#endif
+
void s_init(void)
{
#if !defined CONFIG_SPL_BUILD
OpenPOWER on IntegriCloud