public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] PXA: Fix building for lubbock board
@ 2011-12-12 15:15 Anatolij Gustschin
  2011-12-12 15:23 ` Marek Vasut
  2011-12-12 15:34 ` [U-Boot] [PATCH] PXA: Kill last remnants of set_GPIO_mode function Marek Vasut
  0 siblings, 2 replies; 10+ messages in thread
From: Anatolij Gustschin @ 2011-12-12 15:15 UTC (permalink / raw)
  To: u-boot

Fix:
drivers/mmc/libmmc.o: In function `mmc_legacy_init':
drivers/mmc/pxa_mmc.c:565: undefined reference to `set_GPIO_mode'
drivers/mmc/pxa_mmc.c:566: undefined reference to `set_GPIO_mode'

Re-add set_GPIO_mode() which has been removed by commit
d10237d275300562bbfecbbe2f59a97cfb9dc180 (PXA: Separate
PXA2xx CPU init).

Signed-off-by: Anatolij Gustschin <agust@denx.de>
Cc: Marek Vasut <marek.vasut@gmail.com>
---
 arch/arm/cpu/pxa/pxa2xx.c |   25 +++++++++++++++++++++++++
 1 files changed, 25 insertions(+), 0 deletions(-)

diff --git a/arch/arm/cpu/pxa/pxa2xx.c b/arch/arm/cpu/pxa/pxa2xx.c
index 09e8177..42fb4fc 100644
--- a/arch/arm/cpu/pxa/pxa2xx.c
+++ b/arch/arm/cpu/pxa/pxa2xx.c
@@ -299,3 +299,28 @@ void reset_cpu(ulong ignored)
 	for (;;)
 		;
 }
+
+#ifndef CONFIG_CPU_MONAHANS
+void set_GPIO_mode(int gpio_mode)
+{
+	int gpio = gpio_mode & GPIO_MD_MASK_NR;
+	int fn = (gpio_mode & GPIO_MD_MASK_FN) >> 8;
+	int val;
+
+	/* This below changes direction setting of GPIO "gpio" */
+	val = readl(GPDR(gpio));
+
+	if (gpio_mode & GPIO_MD_MASK_DIR)
+		val |= GPIO_bit(gpio);
+	else
+		val &= ~GPIO_bit(gpio);
+
+	writel(val, GPDR(gpio));
+
+	/* This below updates only AF of GPIO "gpio" */
+	val = readl(GAFR(gpio));
+	val &= ~(0x3 << (((gpio) & 0xf) * 2));
+	val |= fn << (((gpio) & 0xf) * 2);
+	writel(val, GAFR(gpio));
+}
+#endif /* CONFIG_CPU_MONAHANS */
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2011-12-19 17:25 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-12-12 15:15 [U-Boot] [PATCH] PXA: Fix building for lubbock board Anatolij Gustschin
2011-12-12 15:23 ` Marek Vasut
2011-12-12 15:34 ` [U-Boot] [PATCH] PXA: Kill last remnants of set_GPIO_mode function Marek Vasut
2011-12-19 15:57   ` Anatolij Gustschin
2011-12-19 16:15     ` Albert ARIBAUD
2011-12-19 16:24       ` Anatolij Gustschin
2011-12-19 16:25       ` Marek Vasut
2011-12-19 16:33         ` Wolfgang Denk
2011-12-19 16:49           ` Albert ARIBAUD
2011-12-19 17:25             ` Marek Vasut

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox