aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/netlogic/common
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2013-07-19 18:10:01 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2013-07-19 18:10:01 -0400
commit1b050180454dc226780f765a33575d4cd8d6e552 (patch)
tree686ab6e261d2d9608508464d5601b13b5cabd4c2 /arch/mips/netlogic/common
parent89d0abe3d695103505c025dde6e07b9c3dd772f4 (diff)
parentf1b7001903dd5a80bdc9f777d2a741ccfd22ed4e (diff)
Merge branch 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus
Pull MIPS fixes from Ralf Baechle: "MIPS fixes for 3.11. Half of then is for Netlogic the remainder touches things across arch/mips. Nothing really dramatic and by rc1 standards MIPS will be in fairly good shape with this applied. Tested by building all MIPS defconfigs of which with this pull request four platforms won't build. And yes, it boots also on my favorite test systems" * 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus: MIPS: kvm: Kconfig: Drop HAVE_KVM dependency from VIRTUALIZATION MIPS: Octeon: Fix DT pruning bug with pip ports MIPS: KVM: Mark KVM_GUEST (T&E KVM) as BROKEN_ON_SMP MIPS: tlbex: fix broken build in v3.11-rc1 MIPS: Netlogic: Add XLP PIC irqdomain MIPS: Netlogic: Fix USB block's coherent DMA mask MIPS: tlbex: Fix typo in r3000 tlb store handler MIPS: BMIPS: Fix thinko to release slave TP from reset MIPS: Delete dead invocation of exception_exit().
Diffstat (limited to 'arch/mips/netlogic/common')
-rw-r--r--arch/mips/netlogic/common/irq.c68
1 files changed, 57 insertions, 11 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
226void __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
237void nlm_smp_irq_init(int hwcpuid) 230void 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
264static struct irq_domain *xlp_pic_domain;
265
266static const struct irq_domain_ops xlp_pic_irq_domain_ops = {
267 .xlate = irq_domain_xlate_onetwocell,
268};
269
270static 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
296static struct of_device_id __initdata xlp_pic_irq_ids[] = {
297 { .compatible = "netlogic,xlp-pic", .data = xlp_of_pic_init },
298 {},
299};
300#endif
301
302void __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}