summaryrefslogtreecommitdiff
path: root/arch/arm/cpu/armv7
diff options
context:
space:
mode:
authorPeng Fan <peng.fan@nxp.com>2016-01-28 16:51:26 +0800
committerStefano Babic <sbabic@denx.de>2016-02-04 10:13:49 +0100
commit216d286c7e3d3d83d4d8ccaf0415192e1b1040c0 (patch)
treec04d68d7fa5727bbff584dc9c396a0633eac23db /arch/arm/cpu/armv7
parent62d8cce9f37c12ff92a47414484997a74d038440 (diff)
downloadu-boot-imx-216d286c7e3d3d83d4d8ccaf0415192e1b1040c0.zip
u-boot-imx-216d286c7e3d3d83d4d8ccaf0415192e1b1040c0.tar.gz
u-boot-imx-216d286c7e3d3d83d4d8ccaf0415192e1b1040c0.tar.bz2
imx: mx6: implement mmc_get_env_dev
Implement mmc_get_env_dev, devno can be got from smbr1 of SRC. Introduce a weak function board_mmc_get_env_dev, different boards can implement it according to different sdhc controllers that 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')
-rw-r--r--arch/arm/cpu/armv7/mx6/soc.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/arch/arm/cpu/armv7/mx6/soc.c b/arch/arm/cpu/armv7/mx6/soc.c
index ebe42b8..8aeeaec 100644
--- a/arch/arm/cpu/armv7/mx6/soc.c
+++ b/arch/arm/cpu/armv7/mx6/soc.c
@@ -349,6 +349,38 @@ int arch_cpu_init(void)
return 0;
}
+#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 src *src_regs = (struct src *)SRC_BASE_ADDR;
+ u32 soc_sbmr = readl(&src_regs->sbmr1);
+ u32 bootsel;
+ int devno;
+
+ /*
+ * Refer to
+ * "i.MX 6Dual/6Quad Applications Processor Reference Manual"
+ * Chapter "8.5.3.1 Expansion Device eFUSE Configuration"
+ * i.MX6SL/SX/UL has same layout.
+ */
+ bootsel = (soc_sbmr & 0x000000FF) >> 6;
+
+ /* If not boot from sd/mmc, use default value */
+ if (bootsel != 1)
+ return CONFIG_SYS_MMC_ENV_DEV;
+
+ /* BOOT_CFG2[3] and BOOT_CFG2[4] */
+ devno = (soc_sbmr & 0x00001800) >> 11;
+
+ return board_mmc_get_env_dev(devno);
+}
+#endif
+
int board_postclk_init(void)
{
set_ldo_voltage(LDO_SOC, 1175); /* Set VDDSOC to 1.175V */