public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH 1/3] integrator: fix the IRQ masks on the Integrator/CP
@ 2012-04-11 22:43 Linus Walleij
  2012-04-11 22:56 ` Russell King - ARM Linux
  0 siblings, 1 reply; 3+ messages in thread
From: Linus Walleij @ 2012-04-11 22:43 UTC (permalink / raw)
  To: linux-arm-kernel

The mask for the PIC FPGA IRQ controller was just wrong, so
convert all the IRQ controllers to use the same, correct
design pattern to produce the valid IRQ mask. Also use the
IRQ_FOO_END macro consistently so this looks coherent.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
---
 arch/arm/mach-integrator/include/mach/irqs.h |    2 +-
 arch/arm/mach-integrator/integrator_cp.c     |    9 ++++-----
 2 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/arch/arm/mach-integrator/include/mach/irqs.h b/arch/arm/mach-integrator/include/mach/irqs.h
index a19a1a2..283931e 100644
--- a/arch/arm/mach-integrator/include/mach/irqs.h
+++ b/arch/arm/mach-integrator/include/mach/irqs.h
@@ -52,7 +52,7 @@
 #define IRQ_CP_CPPLDINT			26
 #define IRQ_CP_ETHINT			27
 #define IRQ_CP_TSPENINT			28
-#define IRQ_PIC_END			31
+#define IRQ_PIC_END			28
 
 #define IRQ_CIC_START			32
 #define IRQ_CM_SOFTINT			32
diff --git a/arch/arm/mach-integrator/integrator_cp.c b/arch/arm/mach-integrator/integrator_cp.c
index 48a115a..2172f4c 100644
--- a/arch/arm/mach-integrator/integrator_cp.c
+++ b/arch/arm/mach-integrator/integrator_cp.c
@@ -163,10 +163,10 @@ static struct fpga_irq_data sic_irq_data = {
 
 static void __init intcp_init_irq(void)
 {
-	u32 pic_mask, sic_mask;
+	u32 pic_mask, cic_mask, sic_mask;
 
-	pic_mask = ~((~0u) << (11 - IRQ_PIC_START));
-	pic_mask |= (~((~0u) << (29 - 22))) << 22;
+	pic_mask = ~((~0u) << (1 + IRQ_PIC_END - IRQ_PIC_START));
+	cic_mask = ~((~0u) << (1 + IRQ_CIC_END - IRQ_CIC_START));
 	sic_mask = ~((~0u) << (1 + IRQ_SIC_END - IRQ_SIC_START));
 
 	/*
@@ -181,8 +181,7 @@ static void __init intcp_init_irq(void)
 
 	fpga_irq_init(-1, pic_mask, &pic_irq_data);
 
-	fpga_irq_init(-1, ~((~0u) << (1 + IRQ_CIC_END - IRQ_CIC_START)),
-		&cic_irq_data);
+	fpga_irq_init(-1, cic_mask, &cic_irq_data);
 
 	fpga_irq_init(IRQ_CP_CPPLDINT, sic_mask, &sic_irq_data);
 }
-- 
1.7.7.6

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

* [PATCH 1/3] integrator: fix the IRQ masks on the Integrator/CP
  2012-04-11 22:43 [PATCH 1/3] integrator: fix the IRQ masks on the Integrator/CP Linus Walleij
@ 2012-04-11 22:56 ` Russell King - ARM Linux
  2012-04-11 23:07   ` Linus Walleij
  0 siblings, 1 reply; 3+ messages in thread
From: Russell King - ARM Linux @ 2012-04-11 22:56 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Apr 12, 2012 at 12:43:43AM +0200, Linus Walleij wrote:
> diff --git a/arch/arm/mach-integrator/include/mach/irqs.h b/arch/arm/mach-integrator/include/mach/irqs.h
> index a19a1a2..283931e 100644
> --- a/arch/arm/mach-integrator/include/mach/irqs.h
> +++ b/arch/arm/mach-integrator/include/mach/irqs.h
> @@ -52,7 +52,7 @@
>  #define IRQ_CP_CPPLDINT			26
>  #define IRQ_CP_ETHINT			27
>  #define IRQ_CP_TSPENINT			28
> -#define IRQ_PIC_END			31
> +#define IRQ_PIC_END			28
>  
>  #define IRQ_CIC_START			32
>  #define IRQ_CM_SOFTINT			32
> diff --git a/arch/arm/mach-integrator/integrator_cp.c b/arch/arm/mach-integrator/integrator_cp.c
> index 48a115a..2172f4c 100644
> --- a/arch/arm/mach-integrator/integrator_cp.c
> +++ b/arch/arm/mach-integrator/integrator_cp.c
> @@ -163,10 +163,10 @@ static struct fpga_irq_data sic_irq_data = {
>  
>  static void __init intcp_init_irq(void)
>  {
> -	u32 pic_mask, sic_mask;
> +	u32 pic_mask, cic_mask, sic_mask;
>  
> -	pic_mask = ~((~0u) << (11 - IRQ_PIC_START));
> -	pic_mask |= (~((~0u) << (29 - 22))) << 22;
> +	pic_mask = ~((~0u) << (1 + IRQ_PIC_END - IRQ_PIC_START));

Err no, the original is correct.

Integrator/CP only has IRQs 29-22 and IRQs 11-0.  IRQs 21-12 are
reserved.  Integrator/AP on the other hand has IRQs 21-0.

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

* [PATCH 1/3] integrator: fix the IRQ masks on the Integrator/CP
  2012-04-11 22:56 ` Russell King - ARM Linux
@ 2012-04-11 23:07   ` Linus Walleij
  0 siblings, 0 replies; 3+ messages in thread
From: Linus Walleij @ 2012-04-11 23:07 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Apr 12, 2012 at 12:56 AM, Russell King - ARM Linux
<linux@arm.linux.org.uk> wrote:

>> - ? ? pic_mask = ~((~0u) << (11 - IRQ_PIC_START));
>> - ? ? pic_mask |= (~((~0u) << (29 - 22))) << 22;
>> + ? ? pic_mask = ~((~0u) << (1 + IRQ_PIC_END - IRQ_PIC_START));
>
> Err no, the original is correct.
>
> Integrator/CP only has IRQs 29-22 and IRQs 11-0. ?IRQs 21-12 are
> reserved. ?Integrator/AP on the other hand has IRQs 21-0.

Ahhh like that, now I finally see. Thanks! I'll fix.
The "hole" in the mask creates some obstacles in the hwirq map too, will
sort it out.

Yours,
Linus Walleij

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

end of thread, other threads:[~2012-04-11 23:07 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-04-11 22:43 [PATCH 1/3] integrator: fix the IRQ masks on the Integrator/CP Linus Walleij
2012-04-11 22:56 ` Russell King - ARM Linux
2012-04-11 23:07   ` Linus Walleij

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