diff options
| author | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2004-10-28 23:21:40 -0700 |
|---|---|---|
| committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2004-10-28 23:21:40 -0700 |
| commit | c87fda50284ebd6bf266334e28f6954484bf197d (patch) | |
| tree | bb5f9946897710eab83674935b9ddc359ec8762c | |
| parent | af200e5a4cb0acf805769a6d8282e775cea3ea7e (diff) | |
[PATCH] ppc32: Fix boot on PowerMac
Tom's recent irq patch broke PowerMac (and possibly others). I think he
forgot that PReP, CHRP and PowerMac are all built together in a single
kernel image, thus all of those arch_initcall's will end up beeing called,
even on the wrong machine...
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
| -rw-r--r-- | arch/ppc/platforms/chrp_setup.c | 3 | ||||
| -rw-r--r-- | arch/ppc/platforms/prep_setup.c | 3 | ||||
| -rw-r--r-- | arch/ppc/syslib/i8259.c | 6 |
3 files changed, 12 insertions, 0 deletions
diff --git a/arch/ppc/platforms/chrp_setup.c b/arch/ppc/platforms/chrp_setup.c index 77351a92ec7c..5f076590b0bd 100644 --- a/arch/ppc/platforms/chrp_setup.c +++ b/arch/ppc/platforms/chrp_setup.c @@ -374,6 +374,9 @@ static void __init chrp_find_openpic(void) static int __init chrp_request_cascade(void) { + if (_machine != _MACH_chrp) + return 0; + /* We have a cascade on OpenPIC IRQ 0, Linux IRQ 16 */ openpic_hookup_cascade(NUM_8259_INTERRUPTS, "82c59 cascade", i8259_irq); diff --git a/arch/ppc/platforms/prep_setup.c b/arch/ppc/platforms/prep_setup.c index 33e1abd15edc..b485096084d1 100644 --- a/arch/ppc/platforms/prep_setup.c +++ b/arch/ppc/platforms/prep_setup.c @@ -961,6 +961,9 @@ prep_irq_canonicalize(u_int irq) static int __init prep_request_cascade(void) { + if (_machine != _MACH_prep) + return 0; + if (OpenPIC_Addr != NULL) /* We have a cascade on OpenPIC IRQ 0, Linux IRQ 16 */ openpic_hookup_cascade(NUM_8259_INTERRUPTS, "82c59 cascade", diff --git a/arch/ppc/syslib/i8259.c b/arch/ppc/syslib/i8259.c index d0419fdc0efc..eb309d91e8d9 100644 --- a/arch/ppc/syslib/i8259.c +++ b/arch/ppc/syslib/i8259.c @@ -13,6 +13,7 @@ unsigned char cached_8259[2] = { 0xff, 0xff }; static spinlock_t i8259_lock = SPIN_LOCK_UNLOCKED; int i8259_pic_irq_offset; +static int i8259_present; /* * Acknowledge the IRQ using either the PCI host bridge's interrupt @@ -154,6 +155,9 @@ static struct resource pic_edgectrl_iores = { static int __init i8259_hook_cascade(void) { + if (!i8259_present) + return 0; + /* reserve our resources */ request_irq( i8259_pic_irq_offset + 2, no_action, SA_INTERRUPT, "82c59 secondary cascade", NULL ); @@ -201,4 +205,6 @@ i8259_init(long intack_addr) if (intack_addr != 0) pci_intack = ioremap(intack_addr, 1); + + i8259_present = 1; } |
