aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/platforms/powermac/pic.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/powerpc/platforms/powermac/pic.c')
-rw-r--r--arch/powerpc/platforms/powermac/pic.c32
1 files changed, 21 insertions, 11 deletions
diff --git a/arch/powerpc/platforms/powermac/pic.c b/arch/powerpc/platforms/powermac/pic.c
index 7ddd5264cc6e..682fe8b6e025 100644
--- a/arch/powerpc/platforms/powermac/pic.c
+++ b/arch/powerpc/platforms/powermac/pic.c
@@ -25,6 +25,7 @@
25#include <linux/sysdev.h> 25#include <linux/sysdev.h>
26#include <linux/adb.h> 26#include <linux/adb.h>
27#include <linux/pmu.h> 27#include <linux/pmu.h>
28#include <linux/module.h>
28 29
29#include <asm/sections.h> 30#include <asm/sections.h>
30#include <asm/io.h> 31#include <asm/io.h>
@@ -32,12 +33,11 @@
32#include <asm/prom.h> 33#include <asm/prom.h>
33#include <asm/pci-bridge.h> 34#include <asm/pci-bridge.h>
34#include <asm/time.h> 35#include <asm/time.h>
35#include <asm/open_pic.h>
36#include <asm/xmon.h> 36#include <asm/xmon.h>
37#include <asm/pmac_feature.h> 37#include <asm/pmac_feature.h>
38#include <asm/mpic.h> 38#include <asm/mpic.h>
39 39
40#include "pmac_pic.h" 40#include "pmac.h"
41 41
42/* 42/*
43 * XXX this should be in xmon.h, but putting it there means xmon.h 43 * XXX this should be in xmon.h, but putting it there means xmon.h
@@ -46,6 +46,7 @@
46 */ 46 */
47extern irqreturn_t xmon_irq(int, void *, struct pt_regs *); 47extern irqreturn_t xmon_irq(int, void *, struct pt_regs *);
48 48
49#ifdef CONFIG_PPC32
49struct pmac_irq_hw { 50struct pmac_irq_hw {
50 unsigned int event; 51 unsigned int event;
51 unsigned int enable; 52 unsigned int enable;
@@ -71,6 +72,9 @@ static u32 level_mask[4];
71 72
72static DEFINE_SPINLOCK(pmac_pic_lock); 73static DEFINE_SPINLOCK(pmac_pic_lock);
73 74
75/* XXX here for now, should move to arch/powerpc/kernel/irq.c */
76int ppc_do_canonicalize_irqs;
77EXPORT_SYMBOL(ppc_do_canonicalize_irqs);
74 78
75#define GATWICK_IRQ_POOL_SIZE 10 79#define GATWICK_IRQ_POOL_SIZE 10
76static struct interrupt_info gatwick_int_pool[GATWICK_IRQ_POOL_SIZE]; 80static struct interrupt_info gatwick_int_pool[GATWICK_IRQ_POOL_SIZE];
@@ -377,11 +381,6 @@ static int __init enable_second_ohare(void)
377 return irqctrler->intrs[0].line; 381 return irqctrler->intrs[0].line;
378} 382}
379 383
380static int pmac_u3_cascade(struct pt_regs *regs, void *data)
381{
382 return mpic_get_one_irq((struct mpic *)data, regs);
383}
384
385#ifdef CONFIG_XMON 384#ifdef CONFIG_XMON
386static struct irqaction xmon_action = { 385static struct irqaction xmon_action = {
387 .handler = xmon_irq, 386 .handler = xmon_irq,
@@ -397,15 +396,23 @@ static struct irqaction gatwick_cascade_action = {
397 .mask = CPU_MASK_NONE, 396 .mask = CPU_MASK_NONE,
398 .name = "cascade", 397 .name = "cascade",
399}; 398};
399#endif /* CONFIG_PPC32 */
400
401static int pmac_u3_cascade(struct pt_regs *regs, void *data)
402{
403 return mpic_get_one_irq((struct mpic *)data, regs);
404}
400 405
401void __init pmac_pic_init(void) 406void __init pmac_pic_init(void)
402{ 407{
403 int i;
404 struct device_node *irqctrler = NULL; 408 struct device_node *irqctrler = NULL;
405 struct device_node *irqctrler2 = NULL; 409 struct device_node *irqctrler2 = NULL;
406 struct device_node *np; 410 struct device_node *np;
411#ifdef CONFIG_PPC32
412 int i;
407 unsigned long addr; 413 unsigned long addr;
408 int irq_cascade = -1; 414 int irq_cascade = -1;
415#endif
409 struct mpic *mpic1, *mpic2; 416 struct mpic *mpic1, *mpic2;
410 417
411 /* We first try to detect Apple's new Core99 chipset, since mac-io 418 /* We first try to detect Apple's new Core99 chipset, since mac-io
@@ -455,7 +462,7 @@ void __init pmac_pic_init(void)
455 mpic_setup_cascade(irqctrler2->intrs[0].line, 462 mpic_setup_cascade(irqctrler2->intrs[0].line,
456 pmac_u3_cascade, mpic2); 463 pmac_u3_cascade, mpic2);
457 } 464 }
458#ifdef CONFIG_XMON 465#if defined(CONFIG_XMON) && defined(CONFIG_PPC32)
459 { 466 {
460 struct device_node* pswitch; 467 struct device_node* pswitch;
461 int nmi_irq; 468 int nmi_irq;
@@ -463,7 +470,7 @@ void __init pmac_pic_init(void)
463 pswitch = find_devices("programmer-switch"); 470 pswitch = find_devices("programmer-switch");
464 if (pswitch && pswitch->n_intrs) { 471 if (pswitch && pswitch->n_intrs) {
465 nmi_irq = pswitch->intrs[0].line; 472 nmi_irq = pswitch->intrs[0].line;
466 openpic_init_nmi_irq(nmi_irq); 473 mpic_irq_set_priority(nmi_irq, 9);
467 setup_irq(nmi_irq, &xmon_action); 474 setup_irq(nmi_irq, &xmon_action);
468 } 475 }
469 } 476 }
@@ -472,6 +479,7 @@ void __init pmac_pic_init(void)
472 } 479 }
473 irqctrler = NULL; 480 irqctrler = NULL;
474 481
482#ifdef CONFIG_PPC32
475 /* Get the level/edge settings, assume if it's not 483 /* Get the level/edge settings, assume if it's not
476 * a Grand Central nor an OHare, then it's an Heathrow 484 * a Grand Central nor an OHare, then it's an Heathrow
477 * (or Paddington). 485 * (or Paddington).
@@ -570,6 +578,7 @@ void __init pmac_pic_init(void)
570#ifdef CONFIG_XMON 578#ifdef CONFIG_XMON
571 setup_irq(20, &xmon_action); 579 setup_irq(20, &xmon_action);
572#endif /* CONFIG_XMON */ 580#endif /* CONFIG_XMON */
581#endif /* CONFIG_PPC32 */
573} 582}
574 583
575#ifdef CONFIG_PM 584#ifdef CONFIG_PM
@@ -659,9 +668,10 @@ static struct sysdev_driver driver_pmacpic = {
659 668
660static int __init init_pmacpic_sysfs(void) 669static int __init init_pmacpic_sysfs(void)
661{ 670{
671#ifdef CONFIG_PPC32
662 if (max_irqs == 0) 672 if (max_irqs == 0)
663 return -ENODEV; 673 return -ENODEV;
664 674#endif
665 printk(KERN_DEBUG "Registering pmac pic with sysfs...\n"); 675 printk(KERN_DEBUG "Registering pmac pic with sysfs...\n");
666 sysdev_class_register(&pmacpic_sysclass); 676 sysdev_class_register(&pmacpic_sysclass);
667 sysdev_register(&device_pmacpic); 677 sysdev_register(&device_pmacpic);