diff mbox

[U-Boot,v3,51/62] rockchip: Move the MMC setup check earlier

Message ID 1467655123-29441-52-git-send-email-sjg@chromium.org
State Accepted
Delegated to: Simon Glass
Headers show

Commit Message

Simon Glass July 4, 2016, 5:58 p.m. UTC
When the boot ROM sets up MMC we don't need to do it again. Remove the
MMC setup code entirely.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

Changes in v3: None
Changes in v2: None

 arch/arm/mach-rockchip/rk3288-board-spl.c | 23 ++++++++++++-----------
 1 file changed, 12 insertions(+), 11 deletions(-)

Comments

Simon Glass July 15, 2016, 4 a.m. UTC | #1
On 4 July 2016 at 11:58, Simon Glass <sjg@chromium.org> wrote:
> When the boot ROM sets up MMC we don't need to do it again. Remove the
> MMC setup code entirely.
>
> Signed-off-by: Simon Glass <sjg@chromium.org>
> ---
>
> Changes in v3: None
> Changes in v2: None
>
>  arch/arm/mach-rockchip/rk3288-board-spl.c | 23 ++++++++++++-----------
>  1 file changed, 12 insertions(+), 11 deletions(-)

Applied to u-boot-dm
diff mbox

Patch

diff --git a/arch/arm/mach-rockchip/rk3288-board-spl.c b/arch/arm/mach-rockchip/rk3288-board-spl.c
index 15f1266..d8c9ca7 100644
--- a/arch/arm/mach-rockchip/rk3288-board-spl.c
+++ b/arch/arm/mach-rockchip/rk3288-board-spl.c
@@ -114,7 +114,6 @@  static void configure_l2ctlr(void)
 #ifdef CONFIG_SPL_MMC_SUPPORT
 static int configure_emmc(struct udevice *pinctrl)
 {
-#if !defined(CONFIG_TARGET_ROCK2) && !defined(CONFIG_TARGET_FIREFLY_RK3288)
 	struct gpio_desc desc;
 	int ret;
 
@@ -144,7 +143,6 @@  static int configure_emmc(struct udevice *pinctrl)
 		debug("gpio value ret=%d\n", ret);
 		return ret;
 	}
-#endif
 
 	return 0;
 }
@@ -247,15 +245,18 @@  void spl_board_init(void)
 		goto err;
 	}
 #ifdef CONFIG_SPL_MMC_SUPPORT
-	ret = pinctrl_request_noflags(pinctrl, PERIPH_ID_SDCARD);
-	if (ret) {
-		debug("%s: Failed to set up SD card\n", __func__);
-		goto err;
-	}
-	ret = configure_emmc(pinctrl);
-	if (ret) {
-		debug("%s: Failed to set up eMMC\n", __func__);
-		goto err;
+	if (!IS_ENABLED(CONFIG_TARGET_ROCK2) &&
+	    !IS_ENABLED(CONFIG_TARGET_FIREFLY_RK3288)) {
+		ret = pinctrl_request_noflags(pinctrl, PERIPH_ID_SDCARD);
+		if (ret) {
+			debug("%s: Failed to set up SD card\n", __func__);
+			goto err;
+		}
+		ret = configure_emmc(pinctrl);
+		if (ret) {
+			debug("%s: Failed to set up eMMC\n", __func__);
+			goto err;
+		}
 	}
 #endif