Skip to contentSkip to conversation

ARM: COLIBRI PXA320: fix UCB1400 irq autoprobing

PATCH New Yuri Ludkevich 3 participants 9 messages Aug 11, 2010 – Aug 20, 2010

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ARM: COLIBRI PXA320: fix UCB1400 irq autoprobing

Ads properly initialization to GPIO4 ( alt. fn. #1, nCS3; because GPIO4 and GPIO4_2 cannot be
configured as GPIO simultaneously ) so GPIO4_2 which used as irq line from UCB1400 may be
detected while irq autoprobing routine.

Signed-off by: Yuri Ludkevich <[email protected]>
---

--- linux-next/arch/arm/mach-pxa/colibri-pxa320.c.orig 2010-08-11 16:01:46.000000000 +0400
+++ linux-next/arch/arm/mach-pxa/colibri-pxa320.c 2010-08-11
16:23:30.000000000 +0400
@@ -236,6 +236,19 @@ static void __init colibri_pxa320_init_u

        pxa3xx_mfp_config(ARRAY_AND_SIZE(colibri_pxa320_uart_pin_config));

}

+
+static mfp_cfg_t colibri_pxa320_cpld_pin_config[] __initdata = {
+ /* init GPIO4 as nCS3 (AF1). If GPIO4 stay as GPIO
+ touchscreen irq (GPIO4_2 pin) autoprobing will not work.
+ See Marvell PXA320 datasheet for more details */
+ GPIO4_nCS3,
+};
+
+static void __init colibri_pxa320_init_cpld(void)
+{
+ pxa3xx_mfp_config(ARRAY_AND_SIZE(colibri_pxa320_cpld_pin_config));
+}
+
void __init colibri_pxa320_init(void)

 {
        pxa_set_ffuart_info(NULL);
@@ -252,6 +265,7 @@ void __init colibri_pxa320_init(void)
                                mfp_to_gpio(MFP_PIN_GPIO28));
        colibri_pxa320_init_uart();
        colibri_pxa320_init_udc();

+ colibri_pxa320_init_cpld();
}

MACHINE_START(COLIBRI320, "Toradex Colibri PXA320")
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20100811/a2e4b3bb/attachment-0001.html>

#1 lore raw

PATCH 1/1 ARM: COLIBRI PXA320: fix UCB1400 irq autoprobing

Hi Yuri,

thanks for the patch.

Quoted 5 lines · Yuri Ludkevich

Ads properly initialization to GPIO4 ( alt. fn. #1, nCS3; because GPIO4 and GPIO4_2 cannot be
configured as GPIO simultaneously ) so GPIO4_2 which used as irq line from UCB1400 may be
detected while irq autoprobing routine.

This looks fine to me, but Marek wanted to rework the board support in order to unify the GPIO configs for better readability. Marek, is there any tree which contains your changes already?

Thanks,
Daniel

Quoted 36 lines

Signed-off by: Yuri Ludkevich <[email protected]>
---

--- linux-next/arch/arm/mach-pxa/colibri-pxa320.c.orig 2010-08-11 16:01:46.000000000 +0400
+++ linux-next/arch/arm/mach-pxa/colibri-pxa320.c 2010-08-11
16:23:30.000000000 +0400

(quoted diff) +14 -0
@@ -236,6 +236,19 @@ static void __init colibri_pxa320_init_u
        pxa3xx_mfp_config(ARRAY_AND_SIZE(colibri_pxa320_uart_pin_config));
 }
 
+
+static mfp_cfg_t colibri_pxa320_cpld_pin_config[] __initdata = {
+       /* init GPIO4 as nCS3 (AF1). If GPIO4 stay as GPIO
+          touchscreen irq (GPIO4_2 pin) autoprobing will not work.
+          See Marvell PXA320 datasheet for more details */
+       GPIO4_nCS3,
+};
+
+static void __init colibri_pxa320_init_cpld(void)
+{
+       pxa3xx_mfp_config(ARRAY_AND_SIZE(colibri_pxa320_cpld_pin_config));
+}
+
 void __init colibri_pxa320_init(void)
 {
        pxa_set_ffuart_info(NULL);
@@ -252,6 +265,7 @@ void __init colibri_pxa320_init(void)
                                mfp_to_gpio(MFP_PIN_GPIO28));
        colibri_pxa320_init_uart();
        colibri_pxa320_init_udc();
+       colibri_pxa320_init_cpld();
 }
 
 MACHINE_START(COLIBRI320, "Toradex Colibri PXA320")
#2 lore raw

PATCH 1/1 ARM: COLIBRI PXA320: fix UCB1400 irq autoprobing

Dne St 11. srpna 2010 16:33:45 Daniel Mack napsal(a):

Quoted 11 lines

Hi Yuri,

thanks for the patch.

Quoted 5 lines · Yuri Ludkevich

Ads properly initialization to GPIO4 ( alt. fn. #1, nCS3; because GPIO4 and GPIO4_2 cannot be
configured as GPIO simultaneously ) so GPIO4_2 which used as irq line from UCB1400 may be
detected while irq autoprobing routine.

Quoted 4 lines

This looks fine to me, but Marek wanted to rework the board support in order to unify the GPIO configs for better readability. Marek, is there any tree which contains your changes already?

I hope there will be tomorrow ...

Quoted 49 lines

Thanks,
Daniel

Quoted 45 lines

Signed-off by: Yuri Ludkevich <[email protected]>
---

--- linux-next/arch/arm/mach-pxa/colibri-pxa320.c.orig 2010-08-11 16:01:46.000000000 +0400
+++ linux-next/arch/arm/mach-pxa/colibri-pxa320.c 2010-08-11
16:23:30.000000000 +0400

(quoted diff) +11 -0
@@ -236,6 +236,19 @@ static void __init colibri_pxa320_init_u
 
        pxa3xx_mfp_config(ARRAY_AND_SIZE(colibri_pxa320_uart_pin_config))
        ;
 
 }
 
+
+static mfp_cfg_t colibri_pxa320_cpld_pin_config[] __initdata = {
+       /* init GPIO4 as nCS3 (AF1). If GPIO4 stay as GPIO
+          touchscreen irq (GPIO4_2 pin) autoprobing will not work.
+          See Marvell PXA320 datasheet for more details */
+       GPIO4_nCS3,
+};
+
+static void __init colibri_pxa320_init_cpld(void)
+{
+      

pxa3xx_mfp_config(ARRAY_AND_SIZE(colibri_pxa320_cpld_pin_config)); +}

(quoted diff) +2 -0
+
 
 void __init colibri_pxa320_init(void)
 {
 
        pxa_set_ffuart_info(NULL);
@@ -252,6 +265,7 @@ void __init colibri_pxa320_init(void)
 
                                mfp_to_gpio(MFP_PIN_GPIO28));
 
        colibri_pxa320_init_uart();
        colibri_pxa320_init_udc();
 
+       colibri_pxa320_init_cpld();

}

MACHINE_START(COLIBRI320, "Toradex Colibri PXA320")

#3 lore raw

PATCH 1/1 ARM: COLIBRI PXA320: fix UCB1400 irq autoprobing

Dne St 11. srpna 2010 23:26:20 Marek Vasut napsal(a):

Quoted 12 lines

Dne St 11. srpna 2010 16:33:45 Daniel Mack napsal(a):

Quoted 11 lines

Hi Yuri,

thanks for the patch.

Quoted 5 lines · Yuri Ludkevich

Ads properly initialization to GPIO4 ( alt. fn. #1, nCS3; because GPIO4 and GPIO4_2 cannot be
configured as GPIO simultaneously ) so GPIO4_2 which used as irq line from UCB1400 may be
detected while irq autoprobing routine.

Quoted 5 lines
Quoted 3 lines

This looks fine to me, but Marek wanted to rework the board support in order to unify the GPIO configs for better readability. Marek, is there any tree which contains your changes already?

I hope there will be tomorrow ...

It's in http://git.kernel.org/?p=linux/kernel/git/marex/pxa-
linux-2.6.git;a=summary , for-eric-devel branch. It's been there since yesterday, but I was so dead tired I forgot to notify you. Cheers

Quoted 49 lines
Quoted 49 lines

Thanks,
Daniel

Quoted 45 lines

Signed-off by: Yuri Ludkevich <[email protected]>
---

--- linux-next/arch/arm/mach-pxa/colibri-pxa320.c.orig 2010-08-11 16:01:46.000000000 +0400
+++ linux-next/arch/arm/mach-pxa/colibri-pxa320.c 2010-08-11
16:23:30.000000000 +0400

(quoted diff) +11 -0
@@ -236,6 +236,19 @@ static void __init colibri_pxa320_init_u
 
        pxa3xx_mfp_config(ARRAY_AND_SIZE(colibri_pxa320_uart_pin_config
        )) ;
 
 }
 
+
+static mfp_cfg_t colibri_pxa320_cpld_pin_config[] __initdata = {
+       /* init GPIO4 as nCS3 (AF1). If GPIO4 stay as GPIO
+          touchscreen irq (GPIO4_2 pin) autoprobing will not work.
+          See Marvell PXA320 datasheet for more details */
+       GPIO4_nCS3,
+};
+
+static void __init colibri_pxa320_init_cpld(void)
+{
+

pxa3xx_mfp_config(ARRAY_AND_SIZE(colibri_pxa320_cpld_pin_config)); +}

(quoted diff) +2 -0
+
 
 void __init colibri_pxa320_init(void)
 {
 
        pxa_set_ffuart_info(NULL);
@@ -252,6 +265,7 @@ void __init colibri_pxa320_init(void)
 
                                mfp_to_gpio(MFP_PIN_GPIO28));
 
        colibri_pxa320_init_uart();
        colibri_pxa320_init_udc();
 
+       colibri_pxa320_init_cpld();

}

MACHINE_START(COLIBRI320, "Toradex Colibri PXA320")

#4 lore raw

PATCH 1/1 ARM: COLIBRI PXA320: fix UCB1400 irq autoprobing

In reply to Marek Vasut
Quoted 12 lines · Marek Vasut

Dne St 11. srpna 2010 16:33:45 Daniel Mack napsal(a):

Quoted 11 lines

Hi Yuri,

thanks for the patch.

Quoted 5 lines · Yuri Ludkevich

Ads properly initialization to GPIO4 ( alt. fn. #1, nCS3; because GPIO4 and GPIO4_2 cannot be
configured as GPIO simultaneously ) so GPIO4_2 which used as irq line from UCB1400 may be
detected while irq autoprobing routine.

Quoted 5 lines
Quoted 4 lines

This looks fine to me, but Marek wanted to rework the board support in order to unify the GPIO configs for better readability. Marek, is there any tree which contains your changes already?

I hope there will be tomorrow ...

Yuri, could you check out Marek's tree from

git://git.kernel.org/pub/scm/linux/kernel/git/marex/pxa-linux-2.6.git work

(not that "work" ist the branch you'll need to work on).

You'll see that colibri-pxa320.c looks a lot different now, so your patch should be a one-liner now.

Also, more testing of this code is certainly appreciated :)

Thanks,
Daniel

#5 lore raw

PATCH 1/1 ARM: COLIBRI PXA320: fix UCB1400 irq autoprobing

2010/8/18 Daniel Mack <[email protected]>

Quoted 22 lines · Marek Vasut
Quoted 7 lines

Dne St 11. srpna 2010 16:33:45 Daniel Mack napsal(a):

Quoted 6 lines

Hi Yuri,

thanks for the patch.

Quoted 1 line · Yuri Ludkevich

Ads properly initialization to GPIO4 ( alt. fn. #1, nCS3; because

GPIO4

Quoted 10 lines
Quoted 9 lines
Quoted 4 lines

and GPIO4_2 cannot be
configured as GPIO simultaneously ) so GPIO4_2 which used as irq line from UCB1400 may be
detected while irq autoprobing routine.

This looks fine to me, but Marek wanted to rework the board support in order to unify the GPIO configs for better readability. Marek, is there any tree which contains your changes already?

I hope there will be tomorrow ...

Yuri, could you check out Marek's tree from

Quoted 10 lines

git://git.kernel.org/pub/scm/linux/kernel/git/marex/pxa-linux-2.6.gitwork

(not that "work" ist the branch you'll need to work on).

You'll see that colibri-pxa320.c looks a lot different now, so your patch should be a one-liner now.

Also, more testing of this code is certainly appreciated :)

I have looked at code and I have couple of questions about colibri-pxa320.c and colibri-evalboard.c:
Why colibri_pxa320_evalboard_pin_config[] placed in colibri-pxa320.c, not in evalboard?
Why there is no defconfig for colibri pxa320?

BTW: we have our own board which very similar to colibri evalboard - same
RTC, UCB1400 as sound and touch controller. But we have USB hub onboard, do
not use FFUART and use 800x600 screen - so we make our own file with board
init stuff. May be colibri_pxa320_evalboard_pin_config[] and
pxafb_mode_info/pxa_fb_mach info structures also can be moved to evalboard
file?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20100820/875e20ce/attachment-0001.html>

#6 lore raw

PATCH 1/1 ARM: COLIBRI PXA320: fix UCB1400 irq autoprobing

Dne P? 20. srpna 2010 10:34:35 Yuri Ludkevich napsal(a):

Quoted 34 lines

2010/8/18 Daniel Mack <[email protected]>

Quoted 32 lines · Marek Vasut
Quoted 7 lines

Dne St 11. srpna 2010 16:33:45 Daniel Mack napsal(a):

Quoted 6 lines

Hi Yuri,

thanks for the patch.

Quoted 1 line · Yuri Ludkevich

Ads properly initialization to GPIO4 ( alt. fn. #1, nCS3; because

GPIO4

Quoted 10 lines
Quoted 8 lines
Quoted 4 lines

and GPIO4_2 cannot be
configured as GPIO simultaneously ) so GPIO4_2 which used as irq line from UCB1400 may be
detected while irq autoprobing routine.

This looks fine to me, but Marek wanted to rework the board support in order to unify the GPIO configs for better readability. Marek, is there any tree which contains your changes already?

I hope there will be tomorrow ...

Yuri, could you check out Marek's tree from

git://git.kernel.org/pub/scm/linux/kernel/git/marex/pxa-linux-2.6.gitwor
k

(not that "work" ist the branch you'll need to work on).

You'll see that colibri-pxa320.c looks a lot different now, so your patch should be a one-liner now.

Quoted 6 lines
Quoted 1 line

Also, more testing of this code is certainly appreciated :)

I have looked at code and I have couple of questions about colibri-pxa320.c and colibri-evalboard.c:
Why colibri_pxa320_evalboard_pin_config[] placed in colibri-pxa320.c, not in evalboard?

I was unable to figure out how to mix pxa2xx and pxa3xx MFPs.

Quoted 1 line

Why there is no defconfig for colibri pxa320?

Defconfigs are done for.

Quoted 7 lines

BTW: we have our own board which very similar to colibri evalboard - same RTC, UCB1400 as sound and touch controller. But we have USB hub onboard, do not use FFUART and use 800x600 screen - so we make our own file with board init stuff. May be colibri_pxa320_evalboard_pin_config[] and pxafb_mode_info/pxa_fb_mach info structures also can be moved to evalboard file?

See above.

Cheers

#7 lore raw

PATCH 1/1 ARM: COLIBRI PXA320: fix UCB1400 irq autoprobing

In reply to Yuri Ludkevich
Quoted 8 lines · Yuri Ludkevich

2010/8/18 Daniel Mack <[email protected]>

Quoted 7 lines

git://git.kernel.org/pub/scm/linux/kernel/git/marex/pxa-linux-2.6.gitwork

(not that "work" ist the branch you'll need to work on).

You'll see that colibri-pxa320.c looks a lot different now, so your patch should be a one-liner now.

Quoted 7 lines
Quoted 2 lines

Also, more testing of this code is certainly appreciated :)

I have looked at code and I have couple of questions about colibri-pxa320.c and colibri-evalboard.c:
Why colibri_pxa320_evalboard_pin_config[] placed in colibri-pxa320.c, not in evalboard?

This is because the evalboard code is supposed to be common for different modules which are based on different SoCs. As the pin definitions for PXA270 and PXA3xx aren't common in the mfp-* header files, these arrays need to be placed in the SoC-specific part.

Quoted 1 line

Why there is no defconfig for colibri pxa320?

There is a defconfig for *all* PXA3xx based machines, creating a hybrid kernel to boot on all of them.

Quoted 4 lines

BTW: we have our own board which very similar to colibri evalboard - same RTC, UCB1400 as sound and touch controller. But we have USB hub onboard, do not use FFUART and use 800x600 screen - so we make our own file with board init stuff.

The idea of splitting the code is to have everything you can't change with your own base board design (ie, the module itself) in one file and all the rest in another.

The base board you're using is then passed to the kernel as runtime parameter, so you can boot the same kernel in different envoronments. The code for this parameter isn't there yet as there is only one user so far, but it's trivial to add.

Have a look at the code in colibri-pxa270.c and colibri-pxa270-income.c. The "income" is a custom base board for the pxa270 module, and what you need is actually exactly the same approach, but for the pxa3xx. Just add a core_param called colibri_pxa320_baseboard and then call the appropriate pxa3xx_mfp_config() for the selected board.

Quoted 3 lines

May be colibri_pxa320_evalboard_pin_config[] and pxafb_mode_info/pxa_fb_mach info structures also can be moved to evalboard file?

No, due to the MFPs, it can't.

Daniel

#8 lore raw

PATCH 1/1 ARM: COLIBRI PXA320: fix UCB1400 irq autoprobing

In reply to Yuri Ludkevich

Dne St 11. srpna 2010 14:54:13 Yuri Ludkevich napsal(a):

Quoted 34 lines

Ads properly initialization to GPIO4 ( alt. fn. #1, nCS3; because GPIO4 and GPIO4_2 cannot be
configured as GPIO simultaneously ) so GPIO4_2 which used as irq line from UCB1400 may be
detected while irq autoprobing routine.

Signed-off by: Yuri Ludkevich <[email protected]>
---

--- linux-next/arch/arm/mach-pxa/colibri-pxa320.c.orig 2010-08-11 16:01:46.000000000 +0400
+++ linux-next/arch/arm/mach-pxa/colibri-pxa320.c 2010-08-11
16:23:30.000000000 +0400

(quoted diff) +13 -0
@@ -236,6 +236,19 @@ static void __init colibri_pxa320_init_u
        pxa3xx_mfp_config(ARRAY_AND_SIZE(colibri_pxa320_uart_pin_config));
 }
 
+
+static mfp_cfg_t colibri_pxa320_cpld_pin_config[] __initdata = {
+       /* init GPIO4 as nCS3 (AF1). If GPIO4 stay as GPIO
+          touchscreen irq (GPIO4_2 pin) autoprobing will not work.
+          See Marvell PXA320 datasheet for more details */
+       GPIO4_nCS3,
+};
+
+static void __init colibri_pxa320_init_cpld(void)
+{
+       pxa3xx_mfp_config(ARRAY_AND_SIZE(colibri_pxa320_cpld_pin_config));
+}
+
 void __init colibri_pxa320_init(void)
 {
        pxa_set_ffuart_info(NULL);

Review void __init colibri_pxa320_init(void) · line 271

Quoted 7 lines
(quoted diff) +1 -0
@@ -252,6 +265,7 @@ void __init colibri_pxa320_init(void)
                                mfp_to_gpio(MFP_PIN_GPIO28));
        colibri_pxa320_init_uart();
        colibri_pxa320_init_udc();
+       colibri_pxa320_init_cpld();
 }
 
 MACHINE_START(COLIBRI320, "Toradex Colibri PXA320")

Do we even have a touchscreen init routine on 320? Maybe you could supply us with such a patch too?

Thanks :)