pic.c (75bf465f0bc33e9b776a46d6a1b9b990f5fb7c37) pic.c (b4f00d5b2098320a0d4c4a6d31099bc0c9a85b02)
1// SPDX-License-Identifier: GPL-2.0-or-later
2/*
3 * Support for the interrupt controllers found on Power Macintosh,
4 * currently Apple's "Grand Central" interrupt controller in all
5 * it's incarnations. OpenPIC support used on newer machines is
6 * in a separate file
7 *
8 * Copyright (C) 1997 Paul Mackerras (paulus@samba.org)

--- 236 unchanged lines hidden (view full) ---

245 break;
246 }
247 raw_spin_unlock_irqrestore(&pmac_pic_lock, flags);
248 if (unlikely(irq < 0))
249 return 0;
250 return irq_linear_revmap(pmac_pic_host, irq);
251}
252
1// SPDX-License-Identifier: GPL-2.0-or-later
2/*
3 * Support for the interrupt controllers found on Power Macintosh,
4 * currently Apple's "Grand Central" interrupt controller in all
5 * it's incarnations. OpenPIC support used on newer machines is
6 * in a separate file
7 *
8 * Copyright (C) 1997 Paul Mackerras (paulus@samba.org)

--- 236 unchanged lines hidden (view full) ---

245 break;
246 }
247 raw_spin_unlock_irqrestore(&pmac_pic_lock, flags);
248 if (unlikely(irq < 0))
249 return 0;
250 return irq_linear_revmap(pmac_pic_host, irq);
251}
252
253#ifdef CONFIG_XMON
254static struct irqaction xmon_action = {
255 .handler = xmon_irq,
256 .flags = IRQF_NO_THREAD,
257 .name = "NMI - XMON"
258};
259#endif
260
261static struct irqaction gatwick_cascade_action = {
262 .handler = gatwick_action,
263 .flags = IRQF_NO_THREAD,
264 .name = "cascade",
265};
266
267static int pmac_pic_host_match(struct irq_domain *h, struct device_node *node,
268 enum irq_domain_bus_token bus_token)
269{
270 /* We match all, we don't always have a node anyway */
271 return 1;
272}
273
274static int pmac_pic_host_map(struct irq_domain *h, unsigned int virq,

--- 104 unchanged lines hidden (view full) ---

379 }
380 of_node_put(slave);
381
382 /* Disable all interrupts in all controllers */
383 for (i = 0; i * 32 < max_irqs; ++i)
384 out_le32(&pmac_irq_hw[i]->enable, 0);
385
386 /* Hookup cascade irq */
253static int pmac_pic_host_match(struct irq_domain *h, struct device_node *node,
254 enum irq_domain_bus_token bus_token)
255{
256 /* We match all, we don't always have a node anyway */
257 return 1;
258}
259
260static int pmac_pic_host_map(struct irq_domain *h, unsigned int virq,

--- 104 unchanged lines hidden (view full) ---

365 }
366 of_node_put(slave);
367
368 /* Disable all interrupts in all controllers */
369 for (i = 0; i * 32 < max_irqs; ++i)
370 out_le32(&pmac_irq_hw[i]->enable, 0);
371
372 /* Hookup cascade irq */
387 if (slave && pmac_irq_cascade)
388 setup_irq(pmac_irq_cascade, &gatwick_cascade_action);
373 if (slave && pmac_irq_cascade) {
374 if (request_irq(pmac_irq_cascade, gatwick_action,
375 IRQF_NO_THREAD, "cascade", NULL))
376 pr_err("Failed to register cascade interrupt\n");
377 }
389
390 printk(KERN_INFO "irq: System has %d possible interrupts\n", max_irqs);
391#ifdef CONFIG_XMON
378
379 printk(KERN_INFO "irq: System has %d possible interrupts\n", max_irqs);
380#ifdef CONFIG_XMON
392 setup_irq(irq_create_mapping(NULL, 20), &xmon_action);
381 i = irq_create_mapping(NULL, 20);
382 if (request_irq(i, xmon_irq, IRQF_NO_THREAD, "NMI - XMON", NULL))
383 pr_err("Failed to register NMI-XMON interrupt\n");
393#endif
394}
395
396int of_irq_parse_oldworld(struct device_node *device, int index,
397 struct of_phandle_args *out_irq)
398{
399 const u32 *ints = NULL;
400 int intlen;

--- 35 unchanged lines hidden (view full) ---

436 struct device_node* pswitch;
437 int nmi_irq;
438
439 pswitch = of_find_node_by_name(NULL, "programmer-switch");
440 if (pswitch) {
441 nmi_irq = irq_of_parse_and_map(pswitch, 0);
442 if (nmi_irq) {
443 mpic_irq_set_priority(nmi_irq, 9);
384#endif
385}
386
387int of_irq_parse_oldworld(struct device_node *device, int index,
388 struct of_phandle_args *out_irq)
389{
390 const u32 *ints = NULL;
391 int intlen;

--- 35 unchanged lines hidden (view full) ---

427 struct device_node* pswitch;
428 int nmi_irq;
429
430 pswitch = of_find_node_by_name(NULL, "programmer-switch");
431 if (pswitch) {
432 nmi_irq = irq_of_parse_and_map(pswitch, 0);
433 if (nmi_irq) {
434 mpic_irq_set_priority(nmi_irq, 9);
444 setup_irq(nmi_irq, &xmon_action);
435 if (request_irq(nmi_irq, xmon_irq, IRQF_NO_THREAD,
436 "NMI - XMON", NULL))
437 pr_err("Failed to register NMI-XMON interrupt\n");
445 }
446 of_node_put(pswitch);
447 }
448#endif /* defined(CONFIG_XMON) && defined(CONFIG_PPC32) */
449}
450
451static struct mpic * __init pmac_setup_one_mpic(struct device_node *np,
452 int master)

--- 206 unchanged lines hidden ---
438 }
439 of_node_put(pswitch);
440 }
441#endif /* defined(CONFIG_XMON) && defined(CONFIG_PPC32) */
442}
443
444static struct mpic * __init pmac_setup_one_mpic(struct device_node *np,
445 int master)

--- 206 unchanged lines hidden ---