* [PATCH] ARM: integrator: convert to sparse irqs
@ 2012-02-24 17:32 Linus Walleij
2012-02-24 19:04 ` Rob Herring
2012-02-24 19:15 ` Jean-Christophe PLAGNIOL-VILLARD
0 siblings, 2 replies; 7+ messages in thread
From: Linus Walleij @ 2012-02-24 17:32 UTC (permalink / raw)
To: linux-arm-kernel
This converts the Integrator AP/CP to use sparse IRQs.
Tested on both machines.
Cc: Rob Herring <rob.herring@calxeda.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
---
arch/arm/Kconfig | 1 +
arch/arm/mach-integrator/core.c | 3 ++-
arch/arm/mach-integrator/include/mach/irqs.h | 3 ++-
arch/arm/mach-integrator/integrator_ap.c | 3 ++-
arch/arm/mach-integrator/integrator_cp.c | 3 ++-
arch/arm/mach-integrator/pci.c | 3 ++-
arch/arm/mach-integrator/pci_v3.c | 3 ++-
7 files changed, 13 insertions(+), 6 deletions(-)
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 4852a6b..fc10ed8 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -266,6 +266,7 @@ config ARCH_INTEGRATOR
select PLAT_VERSATILE
select PLAT_VERSATILE_FPGA_IRQ
select NEED_MACH_MEMORY_H
+ select SPARSE_IRQ
help
Support for ARM's Integrator platform.
diff --git a/arch/arm/mach-integrator/core.c b/arch/arm/mach-integrator/core.c
index 15b87f2..304dfb2 100644
--- a/arch/arm/mach-integrator/core.c
+++ b/arch/arm/mach-integrator/core.c
@@ -25,8 +25,9 @@
#include <mach/hardware.h>
#include <mach/platform.h>
-#include <asm/irq.h>
#include <mach/cm.h>
+#include <mach/irqs.h>
+
#include <asm/system.h>
#include <asm/leds.h>
#include <asm/mach-types.h>
diff --git a/arch/arm/mach-integrator/include/mach/irqs.h b/arch/arm/mach-integrator/include/mach/irqs.h
index 1fbe6d1..a19a1a2 100644
--- a/arch/arm/mach-integrator/include/mach/irqs.h
+++ b/arch/arm/mach-integrator/include/mach/irqs.h
@@ -78,5 +78,6 @@
#define IRQ_SIC_CP_LMINT7 46
#define IRQ_SIC_END 46
-#define NR_IRQS 47
+#define NR_IRQS_INTEGRATOR_AP 34
+#define NR_IRQS_INTEGRATOR_CP 47
diff --git a/arch/arm/mach-integrator/integrator_ap.c b/arch/arm/mach-integrator/integrator_ap.c
index 4dde28b..871f148 100644
--- a/arch/arm/mach-integrator/integrator_ap.c
+++ b/arch/arm/mach-integrator/integrator_ap.c
@@ -38,13 +38,13 @@
#include <mach/hardware.h>
#include <mach/platform.h>
#include <asm/hardware/arm_timer.h>
-#include <asm/irq.h>
#include <asm/setup.h>
#include <asm/param.h> /* HZ */
#include <asm/mach-types.h>
#include <asm/sched_clock.h>
#include <mach/lm.h>
+#include <mach/irqs.h>
#include <asm/mach/arch.h>
#include <asm/mach/irq.h>
@@ -475,6 +475,7 @@ MACHINE_START(INTEGRATOR, "ARM-Integrator")
.atag_offset = 0x100,
.reserve = integrator_reserve,
.map_io = ap_map_io,
+ .nr_irqs = NR_IRQS_INTEGRATOR_AP,
.init_early = integrator_init_early,
.init_irq = ap_init_irq,
.timer = &ap_timer,
diff --git a/arch/arm/mach-integrator/integrator_cp.c b/arch/arm/mach-integrator/integrator_cp.c
index be9ead4..48a115a 100644
--- a/arch/arm/mach-integrator/integrator_cp.c
+++ b/arch/arm/mach-integrator/integrator_cp.c
@@ -26,7 +26,6 @@
#include <mach/hardware.h>
#include <mach/platform.h>
-#include <asm/irq.h>
#include <asm/setup.h>
#include <asm/mach-types.h>
#include <asm/hardware/arm_timer.h>
@@ -34,6 +33,7 @@
#include <mach/cm.h>
#include <mach/lm.h>
+#include <mach/irqs.h>
#include <asm/mach/arch.h>
#include <asm/mach/irq.h>
@@ -464,6 +464,7 @@ MACHINE_START(CINTEGRATOR, "ARM-IntegratorCP")
.atag_offset = 0x100,
.reserve = integrator_reserve,
.map_io = intcp_map_io,
+ .nr_irqs = NR_IRQS_INTEGRATOR_CP,
.init_early = intcp_init_early,
.init_irq = intcp_init_irq,
.timer = &cp_timer,
diff --git a/arch/arm/mach-integrator/pci.c b/arch/arm/mach-integrator/pci.c
index 520b6bf..e15aa43 100644
--- a/arch/arm/mach-integrator/pci.c
+++ b/arch/arm/mach-integrator/pci.c
@@ -26,11 +26,12 @@
#include <linux/interrupt.h>
#include <linux/init.h>
-#include <asm/irq.h>
#include <asm/system.h>
#include <asm/mach/pci.h>
#include <asm/mach-types.h>
+#include <mach/irqs.h>
+
/*
* A small note about bridges and interrupts. The DECchip 21050 (and
* later) adheres to the PCI-PCI bridge specification. This says that
diff --git a/arch/arm/mach-integrator/pci_v3.c b/arch/arm/mach-integrator/pci_v3.c
index 3c82566..65e5896 100644
--- a/arch/arm/mach-integrator/pci_v3.c
+++ b/arch/arm/mach-integrator/pci_v3.c
@@ -30,7 +30,8 @@
#include <mach/hardware.h>
#include <mach/platform.h>
-#include <asm/irq.h>
+#include <mach/irqs.h>
+
#include <asm/signal.h>
#include <asm/system.h>
#include <asm/mach/pci.h>
--
1.7.7.6
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH] ARM: integrator: convert to sparse irqs
2012-02-24 17:32 [PATCH] ARM: integrator: convert to sparse irqs Linus Walleij
@ 2012-02-24 19:04 ` Rob Herring
2012-02-24 19:15 ` Jean-Christophe PLAGNIOL-VILLARD
1 sibling, 0 replies; 7+ messages in thread
From: Rob Herring @ 2012-02-24 19:04 UTC (permalink / raw)
To: linux-arm-kernel
On 02/24/2012 11:32 AM, Linus Walleij wrote:
> This converts the Integrator AP/CP to use sparse IRQs.
> Tested on both machines.
>
> Cc: Rob Herring <rob.herring@calxeda.com>
> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Rob Herring <rob.herring@calxeda.com>
> ---
> arch/arm/Kconfig | 1 +
> arch/arm/mach-integrator/core.c | 3 ++-
> arch/arm/mach-integrator/include/mach/irqs.h | 3 ++-
> arch/arm/mach-integrator/integrator_ap.c | 3 ++-
> arch/arm/mach-integrator/integrator_cp.c | 3 ++-
> arch/arm/mach-integrator/pci.c | 3 ++-
> arch/arm/mach-integrator/pci_v3.c | 3 ++-
> 7 files changed, 13 insertions(+), 6 deletions(-)
>
> diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
> index 4852a6b..fc10ed8 100644
> --- a/arch/arm/Kconfig
> +++ b/arch/arm/Kconfig
> @@ -266,6 +266,7 @@ config ARCH_INTEGRATOR
> select PLAT_VERSATILE
> select PLAT_VERSATILE_FPGA_IRQ
> select NEED_MACH_MEMORY_H
> + select SPARSE_IRQ
> help
> Support for ARM's Integrator platform.
>
> diff --git a/arch/arm/mach-integrator/core.c b/arch/arm/mach-integrator/core.c
> index 15b87f2..304dfb2 100644
> --- a/arch/arm/mach-integrator/core.c
> +++ b/arch/arm/mach-integrator/core.c
> @@ -25,8 +25,9 @@
>
> #include <mach/hardware.h>
> #include <mach/platform.h>
> -#include <asm/irq.h>
> #include <mach/cm.h>
> +#include <mach/irqs.h>
> +
> #include <asm/system.h>
> #include <asm/leds.h>
> #include <asm/mach-types.h>
> diff --git a/arch/arm/mach-integrator/include/mach/irqs.h b/arch/arm/mach-integrator/include/mach/irqs.h
> index 1fbe6d1..a19a1a2 100644
> --- a/arch/arm/mach-integrator/include/mach/irqs.h
> +++ b/arch/arm/mach-integrator/include/mach/irqs.h
> @@ -78,5 +78,6 @@
> #define IRQ_SIC_CP_LMINT7 46
> #define IRQ_SIC_END 46
>
> -#define NR_IRQS 47
> +#define NR_IRQS_INTEGRATOR_AP 34
> +#define NR_IRQS_INTEGRATOR_CP 47
>
> diff --git a/arch/arm/mach-integrator/integrator_ap.c b/arch/arm/mach-integrator/integrator_ap.c
> index 4dde28b..871f148 100644
> --- a/arch/arm/mach-integrator/integrator_ap.c
> +++ b/arch/arm/mach-integrator/integrator_ap.c
> @@ -38,13 +38,13 @@
> #include <mach/hardware.h>
> #include <mach/platform.h>
> #include <asm/hardware/arm_timer.h>
> -#include <asm/irq.h>
> #include <asm/setup.h>
> #include <asm/param.h> /* HZ */
> #include <asm/mach-types.h>
> #include <asm/sched_clock.h>
>
> #include <mach/lm.h>
> +#include <mach/irqs.h>
>
> #include <asm/mach/arch.h>
> #include <asm/mach/irq.h>
> @@ -475,6 +475,7 @@ MACHINE_START(INTEGRATOR, "ARM-Integrator")
> .atag_offset = 0x100,
> .reserve = integrator_reserve,
> .map_io = ap_map_io,
> + .nr_irqs = NR_IRQS_INTEGRATOR_AP,
> .init_early = integrator_init_early,
> .init_irq = ap_init_irq,
> .timer = &ap_timer,
> diff --git a/arch/arm/mach-integrator/integrator_cp.c b/arch/arm/mach-integrator/integrator_cp.c
> index be9ead4..48a115a 100644
> --- a/arch/arm/mach-integrator/integrator_cp.c
> +++ b/arch/arm/mach-integrator/integrator_cp.c
> @@ -26,7 +26,6 @@
>
> #include <mach/hardware.h>
> #include <mach/platform.h>
> -#include <asm/irq.h>
> #include <asm/setup.h>
> #include <asm/mach-types.h>
> #include <asm/hardware/arm_timer.h>
> @@ -34,6 +33,7 @@
>
> #include <mach/cm.h>
> #include <mach/lm.h>
> +#include <mach/irqs.h>
>
> #include <asm/mach/arch.h>
> #include <asm/mach/irq.h>
> @@ -464,6 +464,7 @@ MACHINE_START(CINTEGRATOR, "ARM-IntegratorCP")
> .atag_offset = 0x100,
> .reserve = integrator_reserve,
> .map_io = intcp_map_io,
> + .nr_irqs = NR_IRQS_INTEGRATOR_CP,
> .init_early = intcp_init_early,
> .init_irq = intcp_init_irq,
> .timer = &cp_timer,
> diff --git a/arch/arm/mach-integrator/pci.c b/arch/arm/mach-integrator/pci.c
> index 520b6bf..e15aa43 100644
> --- a/arch/arm/mach-integrator/pci.c
> +++ b/arch/arm/mach-integrator/pci.c
> @@ -26,11 +26,12 @@
> #include <linux/interrupt.h>
> #include <linux/init.h>
>
> -#include <asm/irq.h>
> #include <asm/system.h>
> #include <asm/mach/pci.h>
> #include <asm/mach-types.h>
>
> +#include <mach/irqs.h>
> +
> /*
> * A small note about bridges and interrupts. The DECchip 21050 (and
> * later) adheres to the PCI-PCI bridge specification. This says that
> diff --git a/arch/arm/mach-integrator/pci_v3.c b/arch/arm/mach-integrator/pci_v3.c
> index 3c82566..65e5896 100644
> --- a/arch/arm/mach-integrator/pci_v3.c
> +++ b/arch/arm/mach-integrator/pci_v3.c
> @@ -30,7 +30,8 @@
>
> #include <mach/hardware.h>
> #include <mach/platform.h>
> -#include <asm/irq.h>
> +#include <mach/irqs.h>
> +
> #include <asm/signal.h>
> #include <asm/system.h>
> #include <asm/mach/pci.h>
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH] ARM: integrator: convert to sparse irqs
2012-02-24 17:32 [PATCH] ARM: integrator: convert to sparse irqs Linus Walleij
2012-02-24 19:04 ` Rob Herring
@ 2012-02-24 19:15 ` Jean-Christophe PLAGNIOL-VILLARD
2012-02-26 9:45 ` Linus Walleij
1 sibling, 1 reply; 7+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2012-02-24 19:15 UTC (permalink / raw)
To: linux-arm-kernel
On 18:32 Fri 24 Feb , Linus Walleij wrote:
> This converts the Integrator AP/CP to use sparse IRQs.
> Tested on both machines.
>
> Cc: Rob Herring <rob.herring@calxeda.com>
> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
> ---
> arch/arm/Kconfig | 1 +
> arch/arm/mach-integrator/core.c | 3 ++-
> arch/arm/mach-integrator/include/mach/irqs.h | 3 ++-
> arch/arm/mach-integrator/integrator_ap.c | 3 ++-
> arch/arm/mach-integrator/integrator_cp.c | 3 ++-
> arch/arm/mach-integrator/pci.c | 3 ++-
> arch/arm/mach-integrator/pci_v3.c | 3 ++-
> 7 files changed, 13 insertions(+), 6 deletions(-)
>
> diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
> index 4852a6b..fc10ed8 100644
> --- a/arch/arm/Kconfig
> +++ b/arch/arm/Kconfig
> @@ -266,6 +266,7 @@ config ARCH_INTEGRATOR
> select PLAT_VERSATILE
> select PLAT_VERSATILE_FPGA_IRQ
> select NEED_MACH_MEMORY_H
> + select SPARSE_IRQ
> help
> Support for ARM's Integrator platform.
>
> diff --git a/arch/arm/mach-integrator/core.c b/arch/arm/mach-integrator/core.c
> index 15b87f2..304dfb2 100644
> --- a/arch/arm/mach-integrator/core.c
> +++ b/arch/arm/mach-integrator/core.c
> @@ -25,8 +25,9 @@
>
> #include <mach/hardware.h>
> #include <mach/platform.h>
> -#include <asm/irq.h>
> #include <mach/cm.h>
> +#include <mach/irqs.h>
> +
> #include <asm/system.h>
> #include <asm/leds.h>
> #include <asm/mach-types.h>
> diff --git a/arch/arm/mach-integrator/include/mach/irqs.h b/arch/arm/mach-integrator/include/mach/irqs.h
> index 1fbe6d1..a19a1a2 100644
> --- a/arch/arm/mach-integrator/include/mach/irqs.h
> +++ b/arch/arm/mach-integrator/include/mach/irqs.h
> @@ -78,5 +78,6 @@
> #define IRQ_SIC_CP_LMINT7 46
> #define IRQ_SIC_END 46
>
> -#define NR_IRQS 47
> +#define NR_IRQS_INTEGRATOR_AP 34
> +#define NR_IRQS_INTEGRATOR_CP 47
why do you need to specified both?
Best Regards,
J.
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH] ARM: integrator: convert to sparse irqs
2012-02-24 19:15 ` Jean-Christophe PLAGNIOL-VILLARD
@ 2012-02-26 9:45 ` Linus Walleij
2012-02-27 3:42 ` Rob Herring
0 siblings, 1 reply; 7+ messages in thread
From: Linus Walleij @ 2012-02-26 9:45 UTC (permalink / raw)
To: linux-arm-kernel
On Fri, Feb 24, 2012 at 8:15 PM, Jean-Christophe PLAGNIOL-VILLARD
<plagnioj@jcrosoft.com> wrote:
> On 18:32 Fri 24 Feb ? ? , Linus Walleij wrote:
>> -#define NR_IRQS ? ? ? ? ? ? ? ? ? ? ? ? 47
>> +#define NR_IRQS_INTEGRATOR_AP ? ? ? ? ? ? ? ?34
>> +#define NR_IRQS_INTEGRATOR_CP ? ? ? ? ? ? ? ?47
>
> why do you need to specified both?
They are two totally different machines and should never have had that
common roof of NR_IRQS = max(AP,CP), it's just not elegant.
Maybe I'm a bit pedantic but I want to set the .nr_irqs for each machine so that
it corresponds exactly to what it actually has, instead of using a roof value.
I think it improves readability and understanding.
Yours
Linus Walleij
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH] ARM: integrator: convert to sparse irqs
2012-02-26 9:45 ` Linus Walleij
@ 2012-02-27 3:42 ` Rob Herring
2012-02-27 7:44 ` Linus Walleij
0 siblings, 1 reply; 7+ messages in thread
From: Rob Herring @ 2012-02-27 3:42 UTC (permalink / raw)
To: linux-arm-kernel
On 02/26/2012 03:45 AM, Linus Walleij wrote:
> On Fri, Feb 24, 2012 at 8:15 PM, Jean-Christophe PLAGNIOL-VILLARD
> <plagnioj@jcrosoft.com> wrote:
>> On 18:32 Fri 24 Feb , Linus Walleij wrote:
>
>>> -#define NR_IRQS 47
>>> +#define NR_IRQS_INTEGRATOR_AP 34
>>> +#define NR_IRQS_INTEGRATOR_CP 47
>>
>> why do you need to specified both?
>
> They are two totally different machines and should never have had that
> common roof of NR_IRQS = max(AP,CP), it's just not elegant.
>
> Maybe I'm a bit pedantic but I want to set the .nr_irqs for each machine so that
> it corresponds exactly to what it actually has, instead of using a roof value.
> I think it improves readability and understanding.
>
Really, you want to get rid of the value altogether. Each irq_chip
should allocate its irq_descs and then you don't need to set .nr_irqs.
Rob
> Yours
> Linus Walleij
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH] ARM: integrator: convert to sparse irqs
2012-02-27 3:42 ` Rob Herring
@ 2012-02-27 7:44 ` Linus Walleij
2012-02-27 14:37 ` Rob Herring
0 siblings, 1 reply; 7+ messages in thread
From: Linus Walleij @ 2012-02-27 7:44 UTC (permalink / raw)
To: linux-arm-kernel
On Mon, Feb 27, 2012 at 4:42 AM, Rob Herring <robherring2@gmail.com> wrote:
> On 02/26/2012 03:45 AM, Linus Walleij wrote:
>> On Fri, Feb 24, 2012 at 8:15 PM, Jean-Christophe PLAGNIOL-VILLARD
>> <plagnioj@jcrosoft.com> wrote:
>>> On 18:32 Fri 24 Feb ? ? , Linus Walleij wrote:
>>
>>>> -#define NR_IRQS ? ? ? ? ? ? ? ? ? ? ? ? 47
>>>> +#define NR_IRQS_INTEGRATOR_AP ? ? ? ? ? ? ? ?34
>>>> +#define NR_IRQS_INTEGRATOR_CP ? ? ? ? ? ? ? ?47
>>>
>>> why do you need to specified both?
>>
>> They are two totally different machines and should never have had that
>> common roof of NR_IRQS = max(AP,CP), it's just not elegant.
>>
>> Maybe I'm a bit pedantic but I want to set the .nr_irqs for each machine so that
>> it corresponds exactly to what it actually has, instead of using a roof value.
>> I think it improves readability and understanding.
>
> Really, you want to get rid of the value altogether. Each irq_chip
> should allocate its irq_descs and then you don't need to set .nr_irqs.
OK can you point to a machine that does it the right way and
I'll fix.
Or do I need the irq domains lib to go in first to do that in a
good/non-awkward way?
Yours,
Linus Walleij
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH] ARM: integrator: convert to sparse irqs
2012-02-27 7:44 ` Linus Walleij
@ 2012-02-27 14:37 ` Rob Herring
0 siblings, 0 replies; 7+ messages in thread
From: Rob Herring @ 2012-02-27 14:37 UTC (permalink / raw)
To: linux-arm-kernel
On 02/27/2012 01:44 AM, Linus Walleij wrote:
> On Mon, Feb 27, 2012 at 4:42 AM, Rob Herring <robherring2@gmail.com> wrote:
>> On 02/26/2012 03:45 AM, Linus Walleij wrote:
>>> On Fri, Feb 24, 2012 at 8:15 PM, Jean-Christophe PLAGNIOL-VILLARD
>>> <plagnioj@jcrosoft.com> wrote:
>>>> On 18:32 Fri 24 Feb , Linus Walleij wrote:
>>>
>>>>> -#define NR_IRQS 47
>>>>> +#define NR_IRQS_INTEGRATOR_AP 34
>>>>> +#define NR_IRQS_INTEGRATOR_CP 47
>>>>
>>>> why do you need to specified both?
>>>
>>> They are two totally different machines and should never have had that
>>> common roof of NR_IRQS = max(AP,CP), it's just not elegant.
>>>
>>> Maybe I'm a bit pedantic but I want to set the .nr_irqs for each machine so that
>>> it corresponds exactly to what it actually has, instead of using a roof value.
>>> I think it improves readability and understanding.
>>
>> Really, you want to get rid of the value altogether. Each irq_chip
>> should allocate its irq_descs and then you don't need to set .nr_irqs.
>
> OK can you point to a machine that does it the right way and
> I'll fix.
>
> Or do I need the irq domains lib to go in first to do that in a
> good/non-awkward way?
>
You just need something like this. It doesn't really need a domain until
DT support is done and this will still be needed in the non-DT case.
Rob
diff --git a/arch/arm/plat-versatile/fpga-irq.c
b/arch/arm/plat-versatile/fpga-irq.c
index f0cc8e1..3e66b20 100644
--- a/arch/arm/plat-versatile/fpga-irq.c
+++ b/arch/arm/plat-versatile/fpga-irq.c
@@ -49,6 +49,7 @@ static void fpga_irq_handle(unsigned int irq, struct
irq_desc *desc)
void __init fpga_irq_init(int parent_irq, u32 valid, struct
fpga_irq_data *f)
{
unsigned int i;
+ int irq_cnt = fls(valid);
f->chip.irq_ack = fpga_irq_mask;
f->chip.irq_mask = fpga_irq_mask;
@@ -59,7 +60,9 @@ void __init fpga_irq_init(int parent_irq, u32 valid,
struct fpga_irq_data *f)
irq_set_chained_handler(parent_irq, fpga_irq_handle);
}
- for (i = 0; i < 32; i++) {
+ irq_alloc_descs(f->irq_start, 0, irq_cnt, numa_node_id());
+
+ for (i = 0; i < irq_cnt; i++) {
if (valid & (1 << i)) {
unsigned int irq = f->irq_start + i;
^ permalink raw reply related [flat|nested] 7+ messages in thread
end of thread, other threads:[~2012-02-27 14:37 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-02-24 17:32 [PATCH] ARM: integrator: convert to sparse irqs Linus Walleij
2012-02-24 19:04 ` Rob Herring
2012-02-24 19:15 ` Jean-Christophe PLAGNIOL-VILLARD
2012-02-26 9:45 ` Linus Walleij
2012-02-27 3:42 ` Rob Herring
2012-02-27 7:44 ` Linus Walleij
2012-02-27 14:37 ` Rob Herring
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.