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-02-04 10:58:39 +0800
commit550a56fb56a2c3c70def51f7a2bfdbe27bcb07f0 (patch)
treea4d8473c204ae61331edd33cb1e65e05d8e357a9 /cpu
parent69867900d85e71737f6760c57c86d911625cd61c (diff)
downloadu-boot-imx-550a56fb56a2c3c70def51f7a2bfdbe27bcb07f0.zip
u-boot-imx-550a56fb56a2c3c70def51f7a2bfdbe27bcb07f0.tar.gz
u-boot-imx-550a56fb56a2c3c70def51f7a2bfdbe27bcb07f0.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.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/cpu/arm_cortexa8/mx6/generic.c b/cpu/arm_cortexa8/mx6/generic.c
index fbba7ff..8f0f1e6 100644
--- a/cpu/arm_cortexa8/mx6/generic.c
+++ b/cpu/arm_cortexa8/mx6/generic.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2010-2012 Freescale Semiconductor, Inc.
+ * Copyright (C) 2010-2013 Freescale Semiconductor, Inc.
*
* See file CREDITS for list of people who contributed to this
* project.
@@ -1541,3 +1541,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