[U-Boot] [PATCH] PXA: Kill last remnants of set_GPIO_mode function

Marek Vasut marek.vasut at gmail.com
Mon Dec 12 16:34:03 CET 2011


GPIO configuration shall never be done inside a driver, never.

Signed-off-by: Marek Vasut <marek.vasut at gmail.com>
Cc: Anatolij Gustschin <agust at denx.de>
Cc: Albert ARIBAUD <albert.u.boot at aribaud.net>
---
 board/lubbock/lubbock.c |    6 ++++++
 drivers/mmc/pxa_mmc.c   |    5 -----
 2 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/board/lubbock/lubbock.c b/board/lubbock/lubbock.c
index 437f944..3527b38 100644
--- a/board/lubbock/lubbock.c
+++ b/board/lubbock/lubbock.c
@@ -28,6 +28,8 @@
 #include <common.h>
 #include <netdev.h>
 #include <asm/arch/pxa.h>
+#include <asm/arch/pxa-regs.h>
+#include <asm/io.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -47,6 +49,10 @@ int board_init (void)
 	/* adress of boot parameters */
 	gd->bd->bi_boot_params = 0xa0000100;
 
+	/* Configure GPIO6 and GPIO8 as OUT, AF1. */
+	setbits_le32(GPDR0, (1 << 6) | (1 << 8));
+	clrsetbits_le32(GAFR0_L, (3 << 12) | (3 << 16), (1 << 12) | (1 << 16));
+
 	return 0;
 }
 
diff --git a/drivers/mmc/pxa_mmc.c b/drivers/mmc/pxa_mmc.c
index 2b58a98..80c4445 100644
--- a/drivers/mmc/pxa_mmc.c
+++ b/drivers/mmc/pxa_mmc.c
@@ -560,11 +560,6 @@ mmc_legacy_init(int verbose)
 	/* Reset device interface type */
 	mmc_dev.if_type = IF_TYPE_UNKNOWN;
 
-#if defined(CONFIG_LUBBOCK) || \
-	(defined(CONFIG_GUMSTIX) && !defined(CONFIG_CPU_PXA27X))
-	set_GPIO_mode(GPIO6_MMCCLK_MD);
-	set_GPIO_mode(GPIO8_MMCCS0_MD);
-#endif
 #ifdef CONFIG_CPU_MONAHANS	/* pxa3xx */
 	writel(readl(CKENA) | CKENA_12_MMC0 | CKENA_13_MMC1, CKENA);
 #else	/* pxa2xx */
-- 
1.7.7.1



More information about the U-Boot mailing list