diff options
Diffstat (limited to 'arch/m68k/mac/macints.c')
-rw-r--r-- | arch/m68k/mac/macints.c | 197 |
1 files changed, 49 insertions, 148 deletions
diff --git a/arch/m68k/mac/macints.c b/arch/m68k/mac/macints.c index ba220b7..5c1a6b2 100644 --- a/arch/m68k/mac/macints.c +++ b/arch/m68k/mac/macints.c @@ -26,10 +26,6 @@ * - slot 6: timer 1 (not on IIci) * - slot 7: status of IRQ; signals 'any enabled int.' * - * 2 - OSS (IIfx only?) - * - slot 0: SCSI interrupt - * - slot 1: Sound interrupt - * * Levels 3-6 vary by machine type. For VIA or RBV Macintoshes: * * 3 - unused (?) @@ -42,21 +38,30 @@ * * 6 - off switch (?) * - * For OSS Macintoshes (IIfx only at this point): + * Machines with Quadra-like VIA hardware, except PSC and PMU machines, support + * an alternate interrupt mapping, as used by A/UX. It spreads ethernet and + * sound out to their own autovector IRQs and gives VIA1 a higher priority: * - * 3 - Nubus interrupt - * - slot 0: Slot $9 - * - slot 1: Slot $A - * - slot 2: Slot $B - * - slot 3: Slot $C - * - slot 4: Slot $D - * - slot 5: Slot $E + * 1 - unused (?) * - * 4 - SCC IOP + * 3 - on-board SONIC + * + * 5 - Apple Sound Chip (ASC) + * + * 6 - VIA1 + * + * For OSS Macintoshes (IIfx only), we apply an interrupt mapping similar to + * the Quadra (A/UX) mapping: + * + * 1 - ISM IOP (ADB) * - * 5 - ISM IOP (ADB?) + * 2 - SCSI * - * 6 - unused + * 3 - NuBus + * + * 4 - SCC IOP + * + * 6 - VIA1 * * For PSC Macintoshes (660AV, 840AV): * @@ -100,88 +105,29 @@ * case. They're hidden behind the Nubus slot $C interrupt thus adding a * third layer of indirection. Why oh why did the Apple engineers do that? * - * - We support "fast" and "slow" handlers, just like the Amiga port. The - * fast handlers are called first and with all interrupts disabled. They - * are expected to execute quickly (hence the name). The slow handlers are - * called last with interrupts enabled and the interrupt level restored. - * They must therefore be reentrant. - * - * TODO: - * */ -#include <linux/module.h> #include <linux/types.h> #include <linux/kernel.h> #include <linux/sched.h> -#include <linux/kernel_stat.h> -#include <linux/interrupt.h> /* for intr_count */ +#include <linux/interrupt.h> +#include <linux/irq.h> #include <linux/delay.h> -#include <linux/seq_file.h> -#include <asm/system.h> #include <asm/irq.h> -#include <asm/traps.h> -#include <asm/bootinfo.h> #include <asm/macintosh.h> +#include <asm/macints.h> #include <asm/mac_via.h> #include <asm/mac_psc.h> +#include <asm/mac_oss.h> +#include <asm/mac_iop.h> +#include <asm/mac_baboon.h> #include <asm/hwtest.h> -#include <asm/errno.h> -#include <asm/macints.h> #include <asm/irq_regs.h> -#include <asm/mac_oss.h> #define SHUTUP_SONIC /* - * VIA/RBV hooks - */ - -extern void via_register_interrupts(void); -extern void via_irq_enable(int); -extern void via_irq_disable(int); -extern void via_irq_clear(int); -extern int via_irq_pending(int); - -/* - * OSS hooks - */ - -extern void oss_register_interrupts(void); -extern void oss_irq_enable(int); -extern void oss_irq_disable(int); -extern void oss_irq_clear(int); -extern int oss_irq_pending(int); - -/* - * PSC hooks - */ - -extern void psc_register_interrupts(void); -extern void psc_irq_enable(int); -extern void psc_irq_disable(int); -extern void psc_irq_clear(int); -extern int psc_irq_pending(int); - -/* - * IOP hooks - */ - -extern void iop_register_interrupts(void); - -/* - * Baboon hooks - */ - -extern int baboon_present; - -extern void baboon_register_interrupts(void); -extern void baboon_irq_enable(int); -extern void baboon_irq_disable(int); -extern void baboon_irq_clear(int); - -/* * console_loglevel determines NMI handler function */ @@ -190,10 +136,15 @@ irqreturn_t mac_debug_handler(int, void *); /* #define DEBUG_MACINTS */ +static unsigned int mac_irq_startup(struct irq_data *); +static void mac_irq_shutdown(struct irq_data *); + static struct irq_chip mac_irq_chip = { .name = "mac", .irq_enable = mac_irq_enable, .irq_disable = mac_irq_disable, + .irq_startup = mac_irq_startup, + .irq_shutdown = mac_irq_shutdown, }; void __init mac_init_IRQ(void) @@ -239,8 +190,6 @@ void __init mac_init_IRQ(void) /* * mac_irq_enable - enable an interrupt source * mac_irq_disable - disable an interrupt source - * mac_clear_irq - clears a pending interrupt - * mac_irq_pending - returns the pending status of an IRQ (nonzero = pending) * * These routines are just dispatchers to the VIA/OSS/PSC routines. */ @@ -252,8 +201,6 @@ void mac_irq_enable(struct irq_data *data) switch(irq_src) { case 1: - via_irq_enable(irq); - break; case 2: case 7: if (oss_present) @@ -262,6 +209,7 @@ void mac_irq_enable(struct irq_data *data) via_irq_enable(irq); break; case 3: + case 4: case 5: case 6: if (psc_present) @@ -269,10 +217,6 @@ void mac_irq_enable(struct irq_data *data) else if (oss_present) oss_irq_enable(irq); break; - case 4: - if (psc_present) - psc_irq_enable(irq); - break; case 8: if (baboon_present) baboon_irq_enable(irq); @@ -287,8 +231,6 @@ void mac_irq_disable(struct irq_data *data) switch(irq_src) { case 1: - via_irq_disable(irq); - break; case 2: case 7: if (oss_present) @@ -297,6 +239,7 @@ void mac_irq_disable(struct irq_data *data) via_irq_disable(irq); break; case 3: + case 4: case 5: case 6: if (psc_present) @@ -304,10 +247,6 @@ void mac_irq_disable(struct irq_data *data) else if (oss_present) oss_irq_disable(irq); break; - case 4: - if (psc_present) - psc_irq_disable(irq); - break; case 8: if (baboon_present) baboon_irq_disable(irq); @@ -315,65 +254,27 @@ void mac_irq_disable(struct irq_data *data) } } -void mac_clear_irq(unsigned int irq) +static unsigned int mac_irq_startup(struct irq_data *data) { - switch(IRQ_SRC(irq)) { - case 1: - via_irq_clear(irq); - break; - case 2: - case 7: - if (oss_present) - oss_irq_clear(irq); - else - via_irq_clear(irq); - break; - case 3: - case 5: - case 6: - if (psc_present) - psc_irq_clear(irq); - else if (oss_present) - oss_irq_clear(irq); - break; - case 4: - if (psc_present) - psc_irq_clear(irq); - break; - case 8: - if (baboon_present) - baboon_irq_clear(irq); - break; - } + int irq = data->irq; + + if (IRQ_SRC(irq) == 7 && !oss_present) + via_nubus_irq_startup(irq); + else + mac_irq_enable(data); + + return 0; } -int mac_irq_pending(unsigned int irq) +static void mac_irq_shutdown(struct irq_data *data) { - switch(IRQ_SRC(irq)) { - case 1: - return via_irq_pending(irq); - case 2: - case 7: - if (oss_present) - return oss_irq_pending(irq); - else - return via_irq_pending(irq); - case 3: - case 5: - case 6: - if (psc_present) - return psc_irq_pending(irq); - else if (oss_present) - return oss_irq_pending(irq); - break; - case 4: - if (psc_present) - return psc_irq_pending(irq); - break; - } - return 0; + int irq = data->irq; + + if (IRQ_SRC(irq) == 7 && !oss_present) + via_nubus_irq_shutdown(irq); + else + mac_irq_disable(data); } -EXPORT_SYMBOL(mac_irq_pending); static int num_debug[8]; |