e9e2f56d3a40722821615c73de527b14028589f6
[openwrt/openwrt.git] / target / linux / ramips / patches-3.8 / 0014-MIPS-ralink-add-CPU-interrupt-controller-to-of_irq_i.patch
1 From d3d2b4200b5a42851365e903d101f8f0882eb9eb Mon Sep 17 00:00:00 2001
2 From: Gabor Juhos <juhosg@openwrt.org>
3 Date: Thu, 31 Jan 2013 20:43:30 +0100
4 Subject: [PATCH 14/14] MIPS: ralink: add CPU interrupt controller to
5 of_irq_ids
6
7 Convert the ralink IRQ code to make use of the new MIPS IRQ controller OF
8 mappings.
9
10 Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
11 Signed-off-by: John Crispin <blogic@openwrt.org>
12 Acked-by: David Daney <david.daney@cavium.com>
13 Patchwork: http://patchwork.linux-mips.org/patch/4900/
14 ---
15 arch/mips/ralink/dts/rt3050.dtsi | 10 ++++++++++
16 arch/mips/ralink/irq.c | 10 +++++++---
17 2 files changed, 17 insertions(+), 3 deletions(-)
18
19 --- a/arch/mips/ralink/dts/rt3050.dtsi
20 +++ b/arch/mips/ralink/dts/rt3050.dtsi
21 @@ -13,6 +13,13 @@
22 bootargs = "console=ttyS0,57600 init=/init";
23 };
24
25 + cpuintc: cpuintc@0 {
26 + #address-cells = <0>;
27 + #interrupt-cells = <1>;
28 + interrupt-controller;
29 + compatible = "mti,cpu-interrupt-controller";
30 + };
31 +
32 palmbus@10000000 {
33 compatible = "palmbus";
34 reg = <0x10000000 0x200000>;
35 @@ -37,6 +44,9 @@
36
37 interrupt-controller;
38 #interrupt-cells = <1>;
39 +
40 + interrupt-parent = <&cpuintc>;
41 + interrupts = <2>;
42 };
43
44 memc@300 {
45 --- a/arch/mips/ralink/irq.c
46 +++ b/arch/mips/ralink/irq.c
47 @@ -128,8 +128,11 @@ static int __init intc_of_init(struct de
48 {
49 struct resource res;
50 struct irq_domain *domain;
51 + int irq;
52
53 - mips_cpu_irq_init();
54 + irq = irq_of_parse_and_map(node, 0);
55 + if (!irq)
56 + panic("Failed to get INTC IRQ");
57
58 if (of_address_to_resource(node, 0, &res))
59 panic("Failed to get intc memory range");
60 @@ -156,8 +159,8 @@ static int __init intc_of_init(struct de
61
62 rt_intc_w32(INTC_INT_GLOBAL, INTC_REG_ENABLE);
63
64 - irq_set_chained_handler(RALINK_CPU_IRQ_INTC, ralink_intc_irq_handler);
65 - irq_set_handler_data(RALINK_CPU_IRQ_INTC, domain);
66 + irq_set_chained_handler(irq, ralink_intc_irq_handler);
67 + irq_set_handler_data(irq, domain);
68
69 cp0_perfcount_irq = irq_create_mapping(domain, 9);
70
71 @@ -165,6 +168,7 @@ static int __init intc_of_init(struct de
72 }
73
74 static struct of_device_id __initdata of_irq_ids[] = {
75 + { .compatible = "mti,cpu-interrupt-controller", .data = mips_cpu_intc_init },
76 { .compatible = "ralink,rt2880-intc", .data = intc_of_init },
77 {},
78 };