* [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* [U-Boot] [PATCH] PXA: Fix building for lubbock board
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
1 sibling, 0 replies; 10+ messages in thread
From: Marek Vasut @ 2011-12-12 15:23 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 */
NAK, this is insane and should die. I'll submit a proper patch.
M
^ permalink raw reply [flat|nested] 10+ messages in thread* [U-Boot] [PATCH] PXA: Kill last remnants of set_GPIO_mode function
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 ` Marek Vasut
2011-12-19 15:57 ` Anatolij Gustschin
1 sibling, 1 reply; 10+ messages in thread
From: Marek Vasut @ 2011-12-12 15:34 UTC (permalink / raw)
To: u-boot
GPIO configuration shall never be done inside a driver, never.
Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
Cc: Anatolij Gustschin <agust@denx.de>
Cc: Albert ARIBAUD <albert.u.boot@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
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [U-Boot] [PATCH] PXA: Kill last remnants of set_GPIO_mode function
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
0 siblings, 1 reply; 10+ messages in thread
From: Anatolij Gustschin @ 2011-12-19 15:57 UTC (permalink / raw)
To: u-boot
Hi Marek, Albert,
On Mon, 12 Dec 2011 16:34:03 +0100
Marek Vasut <marek.vasut@gmail.com> wrote:
> GPIO configuration shall never be done inside a driver, never.
>
> Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
> Cc: Anatolij Gustschin <agust@denx.de>
> Cc: Albert ARIBAUD <albert.u.boot@aribaud.net>
> ---
> board/lubbock/lubbock.c | 6 ++++++
> drivers/mmc/pxa_mmc.c | 5 -----
> 2 files changed, 6 insertions(+), 5 deletions(-)
This patch should go into v2011.12 release. Who is going
to apply it? Or should I push it via my staging branch?
Thanks,
Anatolij
^ permalink raw reply [flat|nested] 10+ messages in thread
* [U-Boot] [PATCH] PXA: Kill last remnants of set_GPIO_mode function
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
0 siblings, 2 replies; 10+ messages in thread
From: Albert ARIBAUD @ 2011-12-19 16:15 UTC (permalink / raw)
To: u-boot
Le 19/12/2011 16:57, Anatolij Gustschin a ?crit :
> Hi Marek, Albert,
>
> On Mon, 12 Dec 2011 16:34:03 +0100
> Marek Vasut<marek.vasut@gmail.com> wrote:
>
>> GPIO configuration shall never be done inside a driver, never.
>>
>> Signed-off-by: Marek Vasut<marek.vasut@gmail.com>
>> Cc: Anatolij Gustschin<agust@denx.de>
>> Cc: Albert ARIBAUD<albert.u.boot@aribaud.net>
>> ---
>> board/lubbock/lubbock.c | 6 ++++++
>> drivers/mmc/pxa_mmc.c | 5 -----
>> 2 files changed, 6 insertions(+), 5 deletions(-)
>
> This patch should go into v2011.12 release. Who is going
> to apply it? Or should I push it via my staging branch?
>
> Thanks,
> Anatolij
How was this patch tested?
Amicalement,
--
Albert.
^ permalink raw reply [flat|nested] 10+ messages in thread
* [U-Boot] [PATCH] PXA: Kill last remnants of set_GPIO_mode function
2011-12-19 16:15 ` Albert ARIBAUD
@ 2011-12-19 16:24 ` Anatolij Gustschin
2011-12-19 16:25 ` Marek Vasut
1 sibling, 0 replies; 10+ messages in thread
From: Anatolij Gustschin @ 2011-12-19 16:24 UTC (permalink / raw)
To: u-boot
On Mon, 19 Dec 2011 17:15:03 +0100
Albert ARIBAUD <albert.u.boot@aribaud.net> wrote:
> Le 19/12/2011 16:57, Anatolij Gustschin a ?crit :
> > Hi Marek, Albert,
> >
> > On Mon, 12 Dec 2011 16:34:03 +0100
> > Marek Vasut<marek.vasut@gmail.com> wrote:
> >
> >> GPIO configuration shall never be done inside a driver, never.
> >>
> >> Signed-off-by: Marek Vasut<marek.vasut@gmail.com>
> >> Cc: Anatolij Gustschin<agust@denx.de>
> >> Cc: Albert ARIBAUD<albert.u.boot@aribaud.net>
> >> ---
> >> board/lubbock/lubbock.c | 6 ++++++
> >> drivers/mmc/pxa_mmc.c | 5 -----
> >> 2 files changed, 6 insertions(+), 5 deletions(-)
> >
> > This patch should go into v2011.12 release. Who is going
> > to apply it? Or should I push it via my staging branch?
> >
> > Thanks,
> > Anatolij
>
> How was this patch tested?
I only compile-tested it.
Marek, do you have this board? Did you test this patch on
real hardware?
Anatolij
^ permalink raw reply [flat|nested] 10+ messages in thread
* [U-Boot] [PATCH] PXA: Kill last remnants of set_GPIO_mode function
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
1 sibling, 1 reply; 10+ messages in thread
From: Marek Vasut @ 2011-12-19 16:25 UTC (permalink / raw)
To: u-boot
> Le 19/12/2011 16:57, Anatolij Gustschin a ?crit :
> > Hi Marek, Albert,
> >
> > On Mon, 12 Dec 2011 16:34:03 +0100
> >
> > Marek Vasut<marek.vasut@gmail.com> wrote:
> >> GPIO configuration shall never be done inside a driver, never.
> >>
> >> Signed-off-by: Marek Vasut<marek.vasut@gmail.com>
> >> Cc: Anatolij Gustschin<agust@denx.de>
> >> Cc: Albert ARIBAUD<albert.u.boot@aribaud.net>
> >> ---
> >>
> >> board/lubbock/lubbock.c | 6 ++++++
> >> drivers/mmc/pxa_mmc.c | 5 -----
> >> 2 files changed, 6 insertions(+), 5 deletions(-)
> >
> > This patch should go into v2011.12 release. Who is going
> > to apply it? Or should I push it via my staging branch?
> >
> > Thanks,
> > Anatolij
>
> How was this patch tested?
>
> Amicalement,
It wasn't ... only compile-tested. Does someone have a lubbock?
M
^ permalink raw reply [flat|nested] 10+ messages in thread
* [U-Boot] [PATCH] PXA: Kill last remnants of set_GPIO_mode function
2011-12-19 16:25 ` Marek Vasut
@ 2011-12-19 16:33 ` Wolfgang Denk
2011-12-19 16:49 ` Albert ARIBAUD
0 siblings, 1 reply; 10+ messages in thread
From: Wolfgang Denk @ 2011-12-19 16:33 UTC (permalink / raw)
To: u-boot
Dear Marek Vasut,
In message <201112191725.00963.marek.vasut@gmail.com> you wrote:
>
> It wasn't ... only compile-tested. Does someone have a lubbock?
Lubbock is orphaned, no testers are known.
If it's compile clean, that should be good enough.
Best regards,
Wolfgang Denk
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Only in our dreams we are free. The rest of the time we need wages.
- Terry Pratchett, _Wyrd Sisters_
^ permalink raw reply [flat|nested] 10+ messages in thread* [U-Boot] [PATCH] PXA: Kill last remnants of set_GPIO_mode function
2011-12-19 16:33 ` Wolfgang Denk
@ 2011-12-19 16:49 ` Albert ARIBAUD
2011-12-19 17:25 ` Marek Vasut
0 siblings, 1 reply; 10+ messages in thread
From: Albert ARIBAUD @ 2011-12-19 16:49 UTC (permalink / raw)
To: u-boot
Hi Wolfgang,
Le 19/12/2011 17:33, Wolfgang Denk a ?crit :
> Dear Marek Vasut,
>
> In message<201112191725.00963.marek.vasut@gmail.com> you wrote:
>>
>> It wasn't ... only compile-tested. Does someone have a lubbock?
>
> Lubbock is orphaned, no testers are known.
>
> If it's compile clean, that should be good enough.
>
> Best regards,
>
> Wolfgang Denk
Ok, I'll pull it in then; but if Lubbock is orphaned, then maybe we
should throw a call for a new maintainer to step forward during next
release cycle, and if none shows, then remove the board rather and try
and keep it alive.
Amicalement,
--
Albert.
^ permalink raw reply [flat|nested] 10+ messages in thread
* [U-Boot] [PATCH] PXA: Kill last remnants of set_GPIO_mode function
2011-12-19 16:49 ` Albert ARIBAUD
@ 2011-12-19 17:25 ` Marek Vasut
0 siblings, 0 replies; 10+ messages in thread
From: Marek Vasut @ 2011-12-19 17:25 UTC (permalink / raw)
To: u-boot
> Hi Wolfgang,
>
> Le 19/12/2011 17:33, Wolfgang Denk a ?crit :
> > Dear Marek Vasut,
> >
> > In message<201112191725.00963.marek.vasut@gmail.com> you wrote:
> >> It wasn't ... only compile-tested. Does someone have a lubbock?
> >
> > Lubbock is orphaned, no testers are known.
> >
> > If it's compile clean, that should be good enough.
> >
> > Best regards,
> >
> > Wolfgang Denk
>
> Ok, I'll pull it in then; but if Lubbock is orphaned, then maybe we
> should throw a call for a new maintainer to step forward during next
> release cycle, and if none shows, then remove the board rather and try
> and keep it alive.
>
> Amicalement,
That's indeed the plan.
M
^ permalink raw reply [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