diff options
author | Jayachandran C <jchandra@broadcom.com> | 2013-07-17 06:27:26 -0400 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2013-07-19 04:24:12 -0400 |
commit | 628f0650ea65ef2ec0a2bde141c271dea1d18904 (patch) | |
tree | f0684eee43c3ee8d029744396f7b374835b30362 /arch/mips | |
parent | 35ac7840bca23a0fcfb53cc433ae1fd6dc6d35c0 (diff) |
MIPS: Netlogic: Add XLP PIC irqdomain
Add a legacy irq domain for the XLP PIC interrupts. This will be used
when interrupts are assigned from the device tree. This change is required
after commit c5cdc67 "irqdomain: Remove temporary MIPS workaround code".
Signed-off-by: Jayachandran C <jchandra@broadcom.com>
Cc: linux-mips@linux-mips.org
Cc: Jayachandran C <jchandra@broadcom.com>
Patchwork: https://patchwork.linux-mips.org/patch/5597/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips')
-rw-r--r-- | arch/mips/netlogic/common/irq.c | 68 | ||||
-rw-r--r-- | arch/mips/netlogic/dts/xlp_evp.dts | 3 | ||||
-rw-r--r-- | arch/mips/netlogic/dts/xlp_svp.dts | 3 |
3 files changed, 61 insertions, 13 deletions
diff --git a/arch/mips/netlogic/common/irq.c b/arch/mips/netlogic/common/irq.c index 73facb2b33bb..1c7e3a1b81ab 100644 --- a/arch/mips/netlogic/common/irq.c +++ b/arch/mips/netlogic/common/irq.c | |||
@@ -40,6 +40,10 @@ | |||
40 | #include <linux/slab.h> | 40 | #include <linux/slab.h> |
41 | #include <linux/irq.h> | 41 | #include <linux/irq.h> |
42 | 42 | ||
43 | #include <linux/irqdomain.h> | ||
44 | #include <linux/of_address.h> | ||
45 | #include <linux/of_irq.h> | ||
46 | |||
43 | #include <asm/errno.h> | 47 | #include <asm/errno.h> |
44 | #include <asm/signal.h> | 48 | #include <asm/signal.h> |
45 | #include <asm/ptrace.h> | 49 | #include <asm/ptrace.h> |
@@ -223,17 +227,6 @@ static void nlm_init_node_irqs(int node) | |||
223 | nodep->irqmask = irqmask; | 227 | nodep->irqmask = irqmask; |
224 | } | 228 | } |
225 | 229 | ||
226 | void __init arch_init_irq(void) | ||
227 | { | ||
228 | /* Initialize the irq descriptors */ | ||
229 | nlm_init_percpu_irqs(); | ||
230 | nlm_init_node_irqs(0); | ||
231 | write_c0_eimr(nlm_current_node()->irqmask); | ||
232 | #if defined(CONFIG_CPU_XLR) | ||
233 | nlm_setup_fmn_irq(); | ||
234 | #endif | ||
235 | } | ||
236 | |||
237 | void nlm_smp_irq_init(int hwcpuid) | 230 | void nlm_smp_irq_init(int hwcpuid) |
238 | { | 231 | { |
239 | int node, cpu; | 232 | int node, cpu; |
@@ -266,3 +259,56 @@ asmlinkage void plat_irq_dispatch(void) | |||
266 | /* top level irq handling */ | 259 | /* top level irq handling */ |
267 | do_IRQ(nlm_irq_to_xirq(node, i)); | 260 | do_IRQ(nlm_irq_to_xirq(node, i)); |
268 | } | 261 | } |
262 | |||
263 | #ifdef CONFIG_OF | ||
264 | static struct irq_domain *xlp_pic_domain; | ||
265 | |||
266 | static const struct irq_domain_ops xlp_pic_irq_domain_ops = { | ||
267 | .xlate = irq_domain_xlate_onetwocell, | ||
268 | }; | ||
269 | |||
270 | static int __init xlp_of_pic_init(struct device_node *node, | ||
271 | struct device_node *parent) | ||
272 | { | ||
273 | const int n_picirqs = PIC_IRT_LAST_IRQ - PIC_IRQ_BASE + 1; | ||
274 | struct resource res; | ||
275 | int socid, ret; | ||
276 | |||
277 | /* we need a hack to get the PIC's SoC chip id */ | ||
278 | ret = of_address_to_resource(node, 0, &res); | ||
279 | if (ret < 0) { | ||
280 | pr_err("PIC %s: reg property not found!\n", node->name); | ||
281 | return -EINVAL; | ||
282 | } | ||
283 | socid = (res.start >> 18) & 0x3; | ||
284 | xlp_pic_domain = irq_domain_add_legacy(node, n_picirqs, | ||
285 | nlm_irq_to_xirq(socid, PIC_IRQ_BASE), PIC_IRQ_BASE, | ||
286 | &xlp_pic_irq_domain_ops, NULL); | ||
287 | if (xlp_pic_domain == NULL) { | ||
288 | pr_err("PIC %s: Creating legacy domain failed!\n", node->name); | ||
289 | return -EINVAL; | ||
290 | } | ||
291 | pr_info("Node %d: IRQ domain created for PIC@%pa\n", socid, | ||
292 | &res.start); | ||
293 | return 0; | ||
294 | } | ||
295 | |||
296 | static struct of_device_id __initdata xlp_pic_irq_ids[] = { | ||
297 | { .compatible = "netlogic,xlp-pic", .data = xlp_of_pic_init }, | ||
298 | {}, | ||
299 | }; | ||
300 | #endif | ||
301 | |||
302 | void __init arch_init_irq(void) | ||
303 | { | ||
304 | /* Initialize the irq descriptors */ | ||
305 | nlm_init_percpu_irqs(); | ||
306 | nlm_init_node_irqs(0); | ||
307 | write_c0_eimr(nlm_current_node()->irqmask); | ||
308 | #if defined(CONFIG_CPU_XLR) | ||
309 | nlm_setup_fmn_irq(); | ||
310 | #endif | ||
311 | #if defined(CONFIG_OF) | ||
312 | of_irq_init(xlp_pic_irq_ids); | ||
313 | #endif | ||
314 | } | ||
diff --git a/arch/mips/netlogic/dts/xlp_evp.dts b/arch/mips/netlogic/dts/xlp_evp.dts index e14f42308064..06407033678e 100644 --- a/arch/mips/netlogic/dts/xlp_evp.dts +++ b/arch/mips/netlogic/dts/xlp_evp.dts | |||
@@ -76,10 +76,11 @@ | |||
76 | }; | 76 | }; |
77 | }; | 77 | }; |
78 | pic: pic@4000 { | 78 | pic: pic@4000 { |
79 | interrupt-controller; | 79 | compatible = "netlogic,xlp-pic"; |
80 | #address-cells = <0>; | 80 | #address-cells = <0>; |
81 | #interrupt-cells = <1>; | 81 | #interrupt-cells = <1>; |
82 | reg = <0 0x4000 0x200>; | 82 | reg = <0 0x4000 0x200>; |
83 | interrupt-controller; | ||
83 | }; | 84 | }; |
84 | 85 | ||
85 | nor_flash@1,0 { | 86 | nor_flash@1,0 { |
diff --git a/arch/mips/netlogic/dts/xlp_svp.dts b/arch/mips/netlogic/dts/xlp_svp.dts index 8af4bdbe5d99..9c5db102df53 100644 --- a/arch/mips/netlogic/dts/xlp_svp.dts +++ b/arch/mips/netlogic/dts/xlp_svp.dts | |||
@@ -76,10 +76,11 @@ | |||
76 | }; | 76 | }; |
77 | }; | 77 | }; |
78 | pic: pic@4000 { | 78 | pic: pic@4000 { |
79 | interrupt-controller; | 79 | compatible = "netlogic,xlp-pic"; |
80 | #address-cells = <0>; | 80 | #address-cells = <0>; |
81 | #interrupt-cells = <1>; | 81 | #interrupt-cells = <1>; |
82 | reg = <0 0x4000 0x200>; | 82 | reg = <0 0x4000 0x200>; |
83 | interrupt-controller; | ||
83 | }; | 84 | }; |
84 | 85 | ||
85 | nor_flash@1,0 { | 86 | nor_flash@1,0 { |