summaryrefslogtreecommitdiff
path: root/cpu
diff options
context:
space:
mode:
authorJason Liu <r64343@freescale.com>2013-02-04 10:43:28 +0800
committerJason Liu <r64343@freescale.com>2013-03-27 17:44:07 +0800
commitf85867638e24e78f9fdaf9dd05b403e5f45cfda8 (patch)
tree46857a4f1f3d082e193465fec60e9b24f7423f8d /cpu
parentd26f29ac28fa628c9b0ac87d3cb7576bb0440e50 (diff)
downloadu-boot-imx-f85867638e24e78f9fdaf9dd05b403e5f45cfda8.zip
u-boot-imx-f85867638e24e78f9fdaf9dd05b403e5f45cfda8.tar.gz
u-boot-imx-f85867638e24e78f9fdaf9dd05b403e5f45cfda8.tar.bz2
ENGR00243038: make get_mmc_env_devno to be a generic function
Currently, each board has one same function called get_mmc_env_devno, this will make the code a little bit duplication. We can make the get_mmc_env_devno to be a generic function, thus we can remove all the scattered function definition in each board file. And the patch also remove the boot check. Firstly, this check is needless, secondly, this will break the second boot support,for example: first boot from SPI, then switch to SD/MMC boot. Signed-off-by: Jason Liu <r64343@freescale.com>
Diffstat (limited to 'cpu')
-rw-r--r--cpu/arm_cortexa8/mx6/generic.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/cpu/arm_cortexa8/mx6/generic.c b/cpu/arm_cortexa8/mx6/generic.c
index c82f689..748a2cf 100644
--- a/cpu/arm_cortexa8/mx6/generic.c
+++ b/cpu/arm_cortexa8/mx6/generic.c
@@ -1470,3 +1470,13 @@ void get_board_serial(struct tag_serialnr *serialnr)
imx_otp_read_one_u32(CPU_UID_HIGH_FUSE_INDEX, &serialnr->high);
}
#endif
+
+#ifdef CONFIG_DYNAMIC_MMC_DEVNO
+int get_mmc_env_devno(void)
+{
+ uint soc_sbmr = readl(SRC_BASE_ADDR + 0x4);
+
+ /* BOOT_CFG2[3] and BOOT_CFG2[4] */
+ return (soc_sbmr & 0x00001800) >> 11;
+}
+#endif