]> git.ipfire.org Git - people/ms/u-boot.git/commitdiff
ti: boot: Register the MMC controllers in SPL in the same way as in u-boot
authorJean-Jacques Hiblot <jjhiblot@ti.com>
Wed, 1 Feb 2017 10:39:14 +0000 (11:39 +0100)
committerTom Rini <trini@konsulko.com>
Mon, 20 Mar 2017 02:17:14 +0000 (22:17 -0400)
To keep a consistent MMC device mapping in SPL and in u-boot, let's
register the MMC controllers the same way in u-boot and in the SPL.
In terms of boot time, it doesn't hurt to register more controllers than
needed because the MMC device is initialized only prior being accessed for
the first time.
Having the same device mapping in SPL and u-boot allows us to use the
environment in SPL whatever the MMC boot device.

Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
27 files changed:
arch/arm/mach-omap2/am33xx/board.c
arch/arm/mach-omap2/boot-common.c
board/BuR/common/common.c
board/amazon/kc1/kc1.c
board/compulab/cm_t35/cm_t35.c
board/compulab/cm_t3517/cm_t3517.c
board/compulab/cm_t54/cm_t54.c
board/corscience/tricorder/tricorder.c
board/gumstix/duovero/duovero.c
board/htkw/mcx/mcx.c
board/isee/igep00x0/igep00x0.c
board/lg/sniper/sniper.c
board/logicpd/am3517evm/am3517evm.c
board/logicpd/omap3som/omap3logic.c
board/quipos/cairo/cairo.c
board/technexion/tao3530/tao3530.c
board/ti/am3517crane/am3517crane.c
board/ti/am57xx/board.c
board/ti/beagle/beagle.c
board/ti/dra7xx/evm.c
board/ti/evm/evm.c
board/ti/ks2_evm/board_k2g.c
board/ti/omap5_uevm/evm.c
board/ti/panda/panda.c
board/ti/sdp4430/sdp.c
board/ti/ti814x/evm.c
board/timll/devkit8000/devkit8000.c

index 190310fd00792ee461dffae46b26a3314c502f86..2bfc8649d5de97d37659ee4617460a5afe232cfb 100644 (file)
@@ -111,7 +111,7 @@ static const struct gpio_bank gpio_bank_am33xx[] = {
 const struct gpio_bank *const omap_gpio_bank = gpio_bank_am33xx;
 #endif
 
-#if defined(CONFIG_MMC_OMAP_HS) && !defined(CONFIG_SPL_BUILD)
+#if defined(CONFIG_MMC_OMAP_HS)
 int cpu_mmc_init(bd_t *bis)
 {
        int ret;
index 7ae3d8041c48ee61c3c332e79004217537a34936..29c8f231917b265fdf52222ab7b4c144ba99a30b 100644 (file)
@@ -205,21 +205,6 @@ void spl_board_init(void)
 #endif
 }
 
-__weak int board_mmc_init(bd_t *bis)
-{
-       switch (spl_boot_device()) {
-       case BOOT_DEVICE_MMC1:
-               omap_mmc_init(0, 0, 0, -1, -1);
-               break;
-       case BOOT_DEVICE_MMC2:
-       case BOOT_DEVICE_MMC2_2:
-               omap_mmc_init(0, 0, 0, -1, -1);
-               omap_mmc_init(1, 0, 0, -1, -1);
-               break;
-       }
-       return 0;
-}
-
 void __noreturn jump_to_image_no_args(struct spl_image_info *spl_image)
 {
        typedef void __noreturn (*image_entry_noargs_t)(u32 *);
index e947e54c39f86db03a2147bb9820f062aa9bdaec..876150402c8f5fe5d3500555464074d329063c63 100644 (file)
@@ -684,7 +684,7 @@ int board_eth_init(bd_t *bis)
        return rv;
 }
 #endif /* defined(CONFIG_DRIVER_TI_CPSW) && !defined(CONFIG_SPL_BUILD) */
-#if defined(CONFIG_GENERIC_MMC) && !defined(CONFIG_SPL_BUILD)
+#if defined(CONFIG_GENERIC_MMC)
 int board_mmc_init(bd_t *bis)
 {
        return omap_mmc_init(1, 0, 0, -1, -1);
index 469a83eeef38a2346f9363f49f2696d6e846e0b9..b3fa7896c5fb6bb84da38bcc697a57ba464caa1c 100644 (file)
@@ -166,12 +166,10 @@ int fb_set_reboot_flag(void)
        return omap_reboot_mode_store("b");
 }
 
-#ifndef CONFIG_SPL_BUILD
 int board_mmc_init(bd_t *bis)
 {
        return omap_mmc_init(1, 0, 0, -1, -1);
 }
-#endif
 
 void board_mmc_power_init(void)
 {
index ec21955b3911ff94e3f3428b0cbafc63716217e3..2d9dd9d808b01758042d4bebc949fbe0d126806b 100644 (file)
@@ -372,7 +372,7 @@ void set_muxconf_regs(void)
                cm_t3730_set_muxconf();
 }
 
-#if defined(CONFIG_GENERIC_MMC) && !defined(CONFIG_SPL_BUILD)
+#if defined(CONFIG_GENERIC_MMC)
 #define SB_T35_WP_GPIO 59
 
 int board_mmc_getcd(struct mmc *mmc)
index 50312b126c2f3133193c56baa7846292f11a1b7a..b55ded054af79a2a025d6217c8060db796a1c469 100644 (file)
@@ -115,7 +115,7 @@ int misc_init_r(void)
        return 0;
 }
 
-#if defined(CONFIG_GENERIC_MMC) && !defined(CONFIG_SPL_BUILD)
+#if defined(CONFIG_GENERIC_MMC)
 #define SB_T35_CD_GPIO 144
 #define SB_T35_WP_GPIO 59
 
index b4f5d4065478ecdf8478d7e2ccb9239d3c39d926..7b58fcd21f4ab1197245c167a4f45d163e92095b 100644 (file)
@@ -96,7 +96,7 @@ uint mmc_get_env_part(struct mmc *mmc)
 }
 #endif
 
-#if defined(CONFIG_GENERIC_MMC) && !defined(CONFIG_SPL_BUILD)
+#if defined(CONFIG_GENERIC_MMC)
 #define SB_T54_CD_GPIO 228
 #define SB_T54_WP_GPIO 229
 
index e8260c63a08c2d5485f54cab6973e6d0bf94461d..48d65e8b4fb8b44e2c6e98fbe5d46aaf31dc2181 100644 (file)
@@ -140,7 +140,7 @@ void set_muxconf_regs(void)
        MUX_TRICORDER();
 }
 
-#if defined(CONFIG_GENERIC_MMC) && !(defined(CONFIG_SPL_BUILD))
+#if defined(CONFIG_GENERIC_MMC)
 int board_mmc_init(bd_t *bis)
 {
        return omap_mmc_init(0, 0, 0, -1, -1);
index c9cd62e3344e1f6d2227fbe6a83235ed54a6bcf2..11d2d7f45f1e080c9da7cfae0b70828e90a24189 100644 (file)
@@ -110,17 +110,19 @@ void set_muxconf_regs(void)
                   sizeof(struct pad_conf_entry));
 }
 
-#if !defined(CONFIG_SPL_BUILD) && defined(CONFIG_GENERIC_MMC)
+#if defined(CONFIG_GENERIC_MMC)
 int board_mmc_init(bd_t *bis)
 {
        return omap_mmc_init(0, 0, 0, -1, -1);
 }
 
+#if !defined(CONFIG_SPL_BUILD)
 void board_mmc_power_init(void)
 {
        twl6030_power_mmc_init(0);
 }
 #endif
+#endif
 
 #if defined(CONFIG_CMD_NET)
 
index 1ac9d663c8b6aacc4a10b3d38ed9c56bd222efbe..12358f1b619886d503865d83d7ab292fedee9a15 100644 (file)
@@ -100,7 +100,7 @@ void set_muxconf_regs(void)
        MUX_MCX();
 }
 
-#if defined(CONFIG_MMC_OMAP_HS) && !defined(CONFIG_SPL_BUILD)
+#if defined(CONFIG_MMC_OMAP_HS)
 int board_mmc_init(bd_t *bis)
 {
        return omap_mmc_init(0, 0, 0, -1, -1);
index e032f313a6958cc611afc9fd1c85779318290f16..d3914a1884711b06c88d2fe1868ea1c91231c7d8 100644 (file)
@@ -199,7 +199,7 @@ int board_eth_init(bd_t *bis)
 static inline void setup_net_chip(void) {}
 #endif
 
-#if defined(CONFIG_GENERIC_MMC) && !defined(CONFIG_SPL_BUILD)
+#if defined(CONFIG_GENERIC_MMC)
 int board_mmc_init(bd_t *bis)
 {
        return omap_mmc_init(0, 0, 0, -1, -1);
index b2b8f8861f11caf07508ceb0d30cba27ed711d66..f924645dc0788cd5fadf9cef090a7384aa0a5d36 100644 (file)
@@ -179,12 +179,10 @@ int fb_set_reboot_flag(void)
        return omap_reboot_mode_store("b");
 }
 
-#ifndef CONFIG_SPL_BUILD
 int board_mmc_init(bd_t *bis)
 {
        return omap_mmc_init(1, 0, 0, -1, -1);
 }
-#endif
 
 void board_mmc_power_init(void)
 {
index a6aff4e6df3e2802c967bc3f4a68ff3095f6690a..1aaeb8d75f3399cf640329b4f8fcf2bae46c169e 100644 (file)
@@ -152,7 +152,7 @@ void set_muxconf_regs(void)
        MUX_AM3517EVM();
 }
 
-#if defined(CONFIG_GENERIC_MMC) && !defined(CONFIG_SPL_BUILD)
+#if defined(CONFIG_GENERIC_MMC)
 int board_mmc_init(bd_t *bis)
 {
        return omap_mmc_init(0, 0, 0, -1, -1);
index b2fcc28f8b4bf77d2d78cd6ab0d0c970bcc0ade4..4ad496e5e2b8beb9ad29518a9f9c513cdef000de 100644 (file)
@@ -231,7 +231,7 @@ int board_late_init(void)
 }
 #endif
 
-#if defined(CONFIG_GENERIC_MMC) && !defined(CONFIG_SPL_BUILD)
+#if defined(CONFIG_GENERIC_MMC)
 int board_mmc_init(bd_t *bis)
 {
        return omap_mmc_init(0, 0, 0, -1, -1);
index 6b366dc43f1f102d6ad7cecfe8953230fac8fd8a..7a1a61e3869745da5f3c9026b5265ca7d1b4b8dd 100644 (file)
@@ -62,7 +62,7 @@ void set_muxconf_regs(void)
        MUX_CAIRO();
 }
 
-#if defined(CONFIG_GENERIC_MMC) && !defined(CONFIG_SPL_BUILD)
+#if defined(CONFIG_GENERIC_MMC)
 int board_mmc_init(bd_t *bis)
 {
        return omap_mmc_init(0, 0, 0, -1, -1);
index d51b5d940c2e04798f7ac8cbb5050c4ed7924a85..cba48d48fcfcf279cfae15bc3d55b4bf11e4a68a 100644 (file)
@@ -179,7 +179,7 @@ void set_muxconf_regs(void)
 #endif
 }
 
-#if defined(CONFIG_GENERIC_MMC) && !defined(CONFIG_SPL_BUILD)
+#if defined(CONFIG_GENERIC_MMC)
 int board_mmc_init(bd_t *bis)
 {
        omap_mmc_init(0, 0, 0, -1, -1);
index 8d1c390e5d02eaaf24720dd8e4005319610c4475..faa95d7da84de87bef6b3386b8e6772f85ea6d8a 100644 (file)
@@ -63,7 +63,7 @@ void set_muxconf_regs(void)
        MUX_AM3517CRANE();
 }
 
-#if defined(CONFIG_GENERIC_MMC) && !defined(CONFIG_SPL_BUILD)
+#if defined(CONFIG_GENERIC_MMC)
 int board_mmc_init(bd_t *bis)
 {
        return omap_mmc_init(0, 0, 0, -1, -1);
index 1611514417026c98270fe5368950e277e6684f9b..df9039c7692a299e48c57ccb00239f5025baa5f9 100644 (file)
@@ -559,7 +559,7 @@ err:
 }
 #endif
 
-#if !defined(CONFIG_SPL_BUILD) && defined(CONFIG_GENERIC_MMC)
+#if defined(CONFIG_GENERIC_MMC)
 int board_mmc_init(bd_t *bis)
 {
        omap_mmc_init(0, 0, 0, -1, -1);
index a6908d4bed5bfe5e11de4b66628c69a5cb1cdf82..e90fe1aba81e0c89e1c9a1ef661b23e3c24ddece 100644 (file)
@@ -524,7 +524,7 @@ void set_muxconf_regs(void)
        MUX_BEAGLE();
 }
 
-#if defined(CONFIG_GENERIC_MMC) && !defined(CONFIG_SPL_BUILD)
+#if defined(CONFIG_GENERIC_MMC)
 int board_mmc_init(bd_t *bis)
 {
        return omap_mmc_init(0, 0, 0, -1, -1);
index bd1c80942e03ebb684033c919052dc98558f40fd..de6fc19cb0d6c66d8d67a13426d9f6c3dc3a39e8 100644 (file)
@@ -679,7 +679,7 @@ err:
 }
 #endif
 
-#if !defined(CONFIG_SPL_BUILD) && defined(CONFIG_GENERIC_MMC)
+#if defined(CONFIG_GENERIC_MMC)
 int board_mmc_init(bd_t *bis)
 {
        omap_mmc_init(0, 0, 0, -1, -1);
index ff3971dda8adf6167b08ecfeaa28b274a3a7ab00..4f132e5107e332d1392241cc05db389a69d63164 100644 (file)
@@ -259,7 +259,7 @@ int board_eth_init(bd_t *bis)
 }
 #endif /* CONFIG_CMD_NET */
 
-#if defined(CONFIG_GENERIC_MMC) && !defined(CONFIG_SPL_BUILD)
+#if defined(CONFIG_GENERIC_MMC)
 int board_mmc_init(bd_t *bis)
 {
        return omap_mmc_init(0, 0, 0, -1, -1);
index 40edbaa33f86cde12f1c1196db6b95582a48b3e6..372fc35a5c666144c179784bb480b62eaed2b850 100644 (file)
@@ -102,7 +102,7 @@ s16 divn_val[16] = {
        -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
 };
 
-#if !defined(CONFIG_SPL_BUILD) && defined(CONFIG_GENERIC_MMC)
+#if defined(CONFIG_GENERIC_MMC)
 int board_mmc_init(bd_t *bis)
 {
        if (psc_enable_module(KS2_LPSC_MMC)) {
index b5d5ba9bdf9b6aabedada02236a710fd70fa5dc5..64d772ca6e74d1593c6a41d67fa6c5ec2003e740 100644 (file)
@@ -211,7 +211,7 @@ void set_muxconf_regs(void)
                   sizeof(struct pad_conf_entry));
 }
 
-#if !defined(CONFIG_SPL_BUILD) && defined(CONFIG_GENERIC_MMC)
+#if defined(CONFIG_GENERIC_MMC)
 int board_mmc_init(bd_t *bis)
 {
        omap_mmc_init(0, 0, 0, -1, -1);
index 13b5dafe82f2d0f4baed353bc91f8e7b34d7ec0e..187ff3cff4c4e4af4e64a9b2e12a99d478c11d71 100644 (file)
@@ -287,17 +287,19 @@ void set_muxconf_regs(void)
                           sizeof(struct pad_conf_entry));
 }
 
-#if !defined(CONFIG_SPL_BUILD) && defined(CONFIG_GENERIC_MMC)
+#if defined(CONFIG_GENERIC_MMC)
 int board_mmc_init(bd_t *bis)
 {
        return omap_mmc_init(0, 0, 0, -1, -1);
 }
 
+#if !defined(CONFIG_SPL_BUILD)
 void board_mmc_power_init(void)
 {
        twl6030_power_mmc_init(0);
 }
 #endif
+#endif
 
 #ifdef CONFIG_USB_EHCI
 
index 6037cdd6c195cebce3a92d48ea2953aa577e9cf5..0eb60e4271eee5f10a78364e1c977e5083e877df 100644 (file)
@@ -73,7 +73,7 @@ void set_muxconf_regs(void)
                                 sizeof(struct pad_conf_entry));
 }
 
-#if !defined(CONFIG_SPL_BUILD) && defined(CONFIG_GENERIC_MMC)
+#if defined(CONFIG_GENERIC_MMC)
 int board_mmc_init(bd_t *bis)
 {
        omap_mmc_init(0, 0, 0, -1, -1);
@@ -81,12 +81,14 @@ int board_mmc_init(bd_t *bis)
        return 0;
 }
 
+#if !defined(CONFIG_SPL_BUILD)
 void board_mmc_power_init(void)
 {
        twl6030_power_mmc_init(0);
        twl6030_power_mmc_init(1);
 }
 #endif
+#endif
 
 /*
  * get_board_rev() - get board revision
index e406dabfc0d8c53f921bc199fd84f096992ad8a7..e85794c60e964e0682806c4cf605a2f129b92562 100644 (file)
@@ -111,7 +111,7 @@ int board_init(void)
        return 0;
 }
 
-#if !defined(CONFIG_SPL_BUILD) && defined(CONFIG_GENERIC_MMC)
+#if defined(CONFIG_GENERIC_MMC)
 int board_mmc_init(bd_t *bis)
 {
        omap_mmc_init(1, 0, 0, -1, -1);
index b2f060b2ddbfa8a3f05e61c2bbdcf86f94b03c15..5f57956ca3d634b360f069c8cb70723e321d0e72 100644 (file)
@@ -131,7 +131,7 @@ void set_muxconf_regs(void)
        MUX_DEVKIT8000();
 }
 
-#if defined(CONFIG_GENERIC_MMC) && !defined(CONFIG_SPL_BUILD)
+#if defined(CONFIG_GENERIC_MMC)
 int board_mmc_init(bd_t *bis)
 {
        return omap_mmc_init(0, 0, 0, -1, -1);