aboutsummaryrefslogtreecommitdiffstats
path: root/arch/m68k/mac
diff options
context:
space:
mode:
Diffstat (limited to 'arch/m68k/mac')
-rw-r--r--arch/m68k/mac/baboon.c42
-rw-r--r--arch/m68k/mac/config.c3
-rw-r--r--arch/m68k/mac/debug.c1
-rw-r--r--arch/m68k/mac/macints.c9
-rw-r--r--arch/m68k/mac/misc.c16
-rw-r--r--arch/m68k/mac/oss.c1
-rw-r--r--arch/m68k/mac/via.c80
7 files changed, 77 insertions, 75 deletions
diff --git a/arch/m68k/mac/baboon.c b/arch/m68k/mac/baboon.c
index c7b25b0aacff..245d16d078ad 100644
--- a/arch/m68k/mac/baboon.c
+++ b/arch/m68k/mac/baboon.c
@@ -18,11 +18,14 @@
18#include <asm/macints.h> 18#include <asm/macints.h>
19#include <asm/mac_baboon.h> 19#include <asm/mac_baboon.h>
20 20
21/* #define DEBUG_BABOON */
22/* #define DEBUG_IRQS */ 21/* #define DEBUG_IRQS */
23 22
23extern void mac_enable_irq(unsigned int);
24extern void mac_disable_irq(unsigned int);
25
24int baboon_present; 26int baboon_present;
25static volatile struct baboon *baboon; 27static volatile struct baboon *baboon;
28static unsigned char baboon_disabled;
26 29
27#if 0 30#if 0
28extern int macide_ack_intr(struct ata_channel *); 31extern int macide_ack_intr(struct ata_channel *);
@@ -88,34 +91,51 @@ static irqreturn_t baboon_irq(int irq, void *dev_id)
88 91
89void __init baboon_register_interrupts(void) 92void __init baboon_register_interrupts(void)
90{ 93{
91 request_irq(IRQ_NUBUS_C, baboon_irq, IRQ_FLG_LOCK|IRQ_FLG_FAST, 94 baboon_disabled = 0;
92 "baboon", (void *) baboon); 95 request_irq(IRQ_NUBUS_C, baboon_irq, 0, "baboon", (void *)baboon);
93} 96}
94 97
95void baboon_irq_enable(int irq) { 98/*
99 * The means for masking individual baboon interrupts remains a mystery, so
100 * enable the umbrella interrupt only when no baboon interrupt is disabled.
101 */
102
103void baboon_irq_enable(int irq)
104{
105 int irq_idx = IRQ_IDX(irq);
106
96#ifdef DEBUG_IRQUSE 107#ifdef DEBUG_IRQUSE
97 printk("baboon_irq_enable(%d)\n", irq); 108 printk("baboon_irq_enable(%d)\n", irq);
98#endif 109#endif
99 /* FIXME: figure out how to mask and unmask baboon interrupt sources */ 110
100 enable_irq(IRQ_NUBUS_C); 111 baboon_disabled &= ~(1 << irq_idx);
112 if (!baboon_disabled)
113 mac_enable_irq(IRQ_NUBUS_C);
101} 114}
102 115
103void baboon_irq_disable(int irq) { 116void baboon_irq_disable(int irq)
117{
118 int irq_idx = IRQ_IDX(irq);
119
104#ifdef DEBUG_IRQUSE 120#ifdef DEBUG_IRQUSE
105 printk("baboon_irq_disable(%d)\n", irq); 121 printk("baboon_irq_disable(%d)\n", irq);
106#endif 122#endif
107 disable_irq(IRQ_NUBUS_C); 123
124 baboon_disabled |= 1 << irq_idx;
125 if (baboon_disabled)
126 mac_disable_irq(IRQ_NUBUS_C);
108} 127}
109 128
110void baboon_irq_clear(int irq) { 129void baboon_irq_clear(int irq)
111 int irq_idx = IRQ_IDX(irq); 130{
131 int irq_idx = IRQ_IDX(irq);
112 132
113 baboon->mb_ifr &= ~(1 << irq_idx); 133 baboon->mb_ifr &= ~(1 << irq_idx);
114} 134}
115 135
116int baboon_irq_pending(int irq) 136int baboon_irq_pending(int irq)
117{ 137{
118 int irq_idx = IRQ_IDX(irq); 138 int irq_idx = IRQ_IDX(irq);
119 139
120 return baboon->mb_ifr & (1 << irq_idx); 140 return baboon->mb_ifr & (1 << irq_idx);
121} 141}
diff --git a/arch/m68k/mac/config.c b/arch/m68k/mac/config.c
index c45e18449f32..8819b97be324 100644
--- a/arch/m68k/mac/config.c
+++ b/arch/m68k/mac/config.c
@@ -162,10 +162,7 @@ void __init config_mac(void)
162 mach_init_IRQ = mac_init_IRQ; 162 mach_init_IRQ = mac_init_IRQ;
163 mach_get_model = mac_get_model; 163 mach_get_model = mac_get_model;
164 mach_gettimeoffset = mac_gettimeoffset; 164 mach_gettimeoffset = mac_gettimeoffset;
165#warning move to adb/via init
166#if 0
167 mach_hwclk = mac_hwclk; 165 mach_hwclk = mac_hwclk;
168#endif
169 mach_set_clock_mmss = mac_set_clock_mmss; 166 mach_set_clock_mmss = mac_set_clock_mmss;
170 mach_reset = mac_reset; 167 mach_reset = mac_reset;
171 mach_halt = mac_poweroff; 168 mach_halt = mac_poweroff;
diff --git a/arch/m68k/mac/debug.c b/arch/m68k/mac/debug.c
index 2165740786a5..65dd77a742a3 100644
--- a/arch/m68k/mac/debug.c
+++ b/arch/m68k/mac/debug.c
@@ -24,7 +24,6 @@
24#define BOOTINFO_COMPAT_1_0 24#define BOOTINFO_COMPAT_1_0
25#include <asm/setup.h> 25#include <asm/setup.h>
26#include <asm/bootinfo.h> 26#include <asm/bootinfo.h>
27#include <asm/machw.h>
28#include <asm/macints.h> 27#include <asm/macints.h>
29 28
30extern unsigned long mac_videobase; 29extern unsigned long mac_videobase;
diff --git a/arch/m68k/mac/macints.c b/arch/m68k/mac/macints.c
index ecddac4a02b9..82e560c076ce 100644
--- a/arch/m68k/mac/macints.c
+++ b/arch/m68k/mac/macints.c
@@ -127,7 +127,6 @@
127#include <asm/irq.h> 127#include <asm/irq.h>
128#include <asm/traps.h> 128#include <asm/traps.h>
129#include <asm/bootinfo.h> 129#include <asm/bootinfo.h>
130#include <asm/machw.h>
131#include <asm/macintosh.h> 130#include <asm/macintosh.h>
132#include <asm/mac_via.h> 131#include <asm/mac_via.h>
133#include <asm/mac_psc.h> 132#include <asm/mac_psc.h>
@@ -215,8 +214,8 @@ irqreturn_t mac_debug_handler(int, void *);
215 214
216/* #define DEBUG_MACINTS */ 215/* #define DEBUG_MACINTS */
217 216
218static void mac_enable_irq(unsigned int irq); 217void mac_enable_irq(unsigned int irq);
219static void mac_disable_irq(unsigned int irq); 218void mac_disable_irq(unsigned int irq);
220 219
221static struct irq_controller mac_irq_controller = { 220static struct irq_controller mac_irq_controller = {
222 .name = "mac", 221 .name = "mac",
@@ -275,7 +274,7 @@ void __init mac_init_IRQ(void)
275 * These routines are just dispatchers to the VIA/OSS/PSC routines. 274 * These routines are just dispatchers to the VIA/OSS/PSC routines.
276 */ 275 */
277 276
278static void mac_enable_irq(unsigned int irq) 277void mac_enable_irq(unsigned int irq)
279{ 278{
280 int irq_src = IRQ_SRC(irq); 279 int irq_src = IRQ_SRC(irq);
281 280
@@ -308,7 +307,7 @@ static void mac_enable_irq(unsigned int irq)
308 } 307 }
309} 308}
310 309
311static void mac_disable_irq(unsigned int irq) 310void mac_disable_irq(unsigned int irq)
312{ 311{
313 int irq_src = IRQ_SRC(irq); 312 int irq_src = IRQ_SRC(irq);
314 313
diff --git a/arch/m68k/mac/misc.c b/arch/m68k/mac/misc.c
index 56d1f5676ade..a44c7086ab39 100644
--- a/arch/m68k/mac/misc.c
+++ b/arch/m68k/mac/misc.c
@@ -93,7 +93,7 @@ static void cuda_write_pram(int offset, __u8 data)
93#define cuda_write_pram NULL 93#define cuda_write_pram NULL
94#endif 94#endif
95 95
96#ifdef CONFIG_ADB_PMU68K 96#if 0 /* def CONFIG_ADB_PMU68K */
97static long pmu_read_time(void) 97static long pmu_read_time(void)
98{ 98{
99 struct adb_request req; 99 struct adb_request req;
@@ -148,7 +148,7 @@ static void pmu_write_pram(int offset, __u8 data)
148#define pmu_write_pram NULL 148#define pmu_write_pram NULL
149#endif 149#endif
150 150
151#ifdef CONFIG_ADB_MACIISI 151#if 0 /* def CONFIG_ADB_MACIISI */
152extern int maciisi_request(struct adb_request *req, 152extern int maciisi_request(struct adb_request *req,
153 void (*done)(struct adb_request *), int nbytes, ...); 153 void (*done)(struct adb_request *), int nbytes, ...);
154 154
@@ -717,13 +717,18 @@ int mac_hwclk(int op, struct rtc_time *t)
717 unmktime(now, 0, 717 unmktime(now, 0,
718 &t->tm_year, &t->tm_mon, &t->tm_mday, 718 &t->tm_year, &t->tm_mon, &t->tm_mday,
719 &t->tm_hour, &t->tm_min, &t->tm_sec); 719 &t->tm_hour, &t->tm_min, &t->tm_sec);
720#if 0
720 printk("mac_hwclk: read %04d-%02d-%-2d %02d:%02d:%02d\n", 721 printk("mac_hwclk: read %04d-%02d-%-2d %02d:%02d:%02d\n",
721 t->tm_year + 1900, t->tm_mon + 1, t->tm_mday, t->tm_hour, t->tm_min, t->tm_sec); 722 t->tm_year + 1900, t->tm_mon + 1, t->tm_mday,
723 t->tm_hour, t->tm_min, t->tm_sec);
724#endif
722 } else { /* write */ 725 } else { /* write */
726#if 0
723 printk("mac_hwclk: tried to write %04d-%02d-%-2d %02d:%02d:%02d\n", 727 printk("mac_hwclk: tried to write %04d-%02d-%-2d %02d:%02d:%02d\n",
724 t->tm_year + 1900, t->tm_mon + 1, t->tm_mday, t->tm_hour, t->tm_min, t->tm_sec); 728 t->tm_year + 1900, t->tm_mon + 1, t->tm_mday,
729 t->tm_hour, t->tm_min, t->tm_sec);
730#endif
725 731
726#if 0 /* it trashes my rtc */
727 now = mktime(t->tm_year + 1900, t->tm_mon + 1, t->tm_mday, 732 now = mktime(t->tm_year + 1900, t->tm_mon + 1, t->tm_mday,
728 t->tm_hour, t->tm_min, t->tm_sec); 733 t->tm_hour, t->tm_min, t->tm_sec);
729 734
@@ -742,7 +747,6 @@ int mac_hwclk(int op, struct rtc_time *t)
742 case MAC_ADB_IISI: 747 case MAC_ADB_IISI:
743 maciisi_write_time(now); 748 maciisi_write_time(now);
744 } 749 }
745#endif
746 } 750 }
747 return 0; 751 return 0;
748} 752}
diff --git a/arch/m68k/mac/oss.c b/arch/m68k/mac/oss.c
index 43d83e054b8e..8426501119ca 100644
--- a/arch/m68k/mac/oss.c
+++ b/arch/m68k/mac/oss.c
@@ -21,7 +21,6 @@
21#include <linux/init.h> 21#include <linux/init.h>
22 22
23#include <asm/bootinfo.h> 23#include <asm/bootinfo.h>
24#include <asm/machw.h>
25#include <asm/macintosh.h> 24#include <asm/macintosh.h>
26#include <asm/macints.h> 25#include <asm/macints.h>
27#include <asm/mac_via.h> 26#include <asm/mac_via.h>
diff --git a/arch/m68k/mac/via.c b/arch/m68k/mac/via.c
index 1bdb03c73c0f..f01d418e64fe 100644
--- a/arch/m68k/mac/via.c
+++ b/arch/m68k/mac/via.c
@@ -32,15 +32,10 @@
32#include <asm/bootinfo.h> 32#include <asm/bootinfo.h>
33#include <asm/macintosh.h> 33#include <asm/macintosh.h>
34#include <asm/macints.h> 34#include <asm/macints.h>
35#include <asm/machw.h>
36#include <asm/mac_via.h> 35#include <asm/mac_via.h>
37#include <asm/mac_psc.h> 36#include <asm/mac_psc.h>
38 37
39volatile __u8 *via1, *via2; 38volatile __u8 *via1, *via2;
40#if 0
41/* See note in mac_via.h about how this is possibly not useful */
42volatile long *via_memory_bogon=(long *)&via_memory_bogon;
43#endif
44int rbv_present; 39int rbv_present;
45int via_alt_mapping; 40int via_alt_mapping;
46EXPORT_SYMBOL(via_alt_mapping); 41EXPORT_SYMBOL(via_alt_mapping);
@@ -66,7 +61,7 @@ static int gIER,gIFR,gBufA,gBufB;
66#define MAC_CLOCK_LOW (MAC_CLOCK_TICK&0xFF) 61#define MAC_CLOCK_LOW (MAC_CLOCK_TICK&0xFF)
67#define MAC_CLOCK_HIGH (MAC_CLOCK_TICK>>8) 62#define MAC_CLOCK_HIGH (MAC_CLOCK_TICK>>8)
68 63
69/* To disable a NuBus slot on Quadras we make the slot IRQ lines outputs, set 64/* To disable a NuBus slot on Quadras we make that slot IRQ line an output set
70 * high. On RBV we just use the slot interrupt enable register. On Macs with 65 * high. On RBV we just use the slot interrupt enable register. On Macs with
71 * genuine VIA chips we must use nubus_disabled to keep track of disabled slot 66 * genuine VIA chips we must use nubus_disabled to keep track of disabled slot
72 * interrupts. When any slot IRQ is disabled we mask the (edge triggered) CA1 67 * interrupts. When any slot IRQ is disabled we mask the (edge triggered) CA1
@@ -180,7 +175,7 @@ void __init via_init(void)
180 via1[vT1CH] = 0; 175 via1[vT1CH] = 0;
181 via1[vT2CL] = 0; 176 via1[vT2CL] = 0;
182 via1[vT2CH] = 0; 177 via1[vT2CH] = 0;
183 via1[vACR] &= 0x3F; 178 via1[vACR] &= ~0xC0; /* setup T1 timer with no PB7 output */
184 via1[vACR] &= ~0x03; /* disable port A & B latches */ 179 via1[vACR] &= ~0x03; /* disable port A & B latches */
185 180
186 /* 181 /*
@@ -203,40 +198,41 @@ void __init via_init(void)
203 198
204 /* Everything below this point is VIA2/RBV only... */ 199 /* Everything below this point is VIA2/RBV only... */
205 200
206 if (oss_present) return; 201 if (oss_present)
202 return;
207 203
208#if 1
209 /* Some machines support an alternate IRQ mapping that spreads */ 204 /* Some machines support an alternate IRQ mapping that spreads */
210 /* Ethernet and Sound out to their own autolevel IRQs and moves */ 205 /* Ethernet and Sound out to their own autolevel IRQs and moves */
211 /* VIA1 to level 6. A/UX uses this mapping and we do too. Note */ 206 /* VIA1 to level 6. A/UX uses this mapping and we do too. Note */
212 /* that the IIfx emulates this alternate mapping using the OSS. */ 207 /* that the IIfx emulates this alternate mapping using the OSS. */
213 208
214 switch(macintosh_config->ident) { 209 via_alt_mapping = 0;
215 case MAC_MODEL_P475: 210 if (macintosh_config->via_type == MAC_VIA_QUADRA)
216 case MAC_MODEL_P475F: 211 switch (macintosh_config->ident) {
217 case MAC_MODEL_P575: 212 case MAC_MODEL_C660:
218 case MAC_MODEL_Q605: 213 case MAC_MODEL_Q840:
219 case MAC_MODEL_Q605_ACC: 214 /* not applicable */
220 case MAC_MODEL_C610: 215 break;
221 case MAC_MODEL_Q610: 216 case MAC_MODEL_P588:
222 case MAC_MODEL_Q630: 217 case MAC_MODEL_TV:
223 case MAC_MODEL_C650: 218 case MAC_MODEL_PB140:
224 case MAC_MODEL_Q650: 219 case MAC_MODEL_PB145:
225 case MAC_MODEL_Q700: 220 case MAC_MODEL_PB160:
226 case MAC_MODEL_Q800: 221 case MAC_MODEL_PB165:
227 case MAC_MODEL_Q900: 222 case MAC_MODEL_PB165C:
228 case MAC_MODEL_Q950: 223 case MAC_MODEL_PB170:
224 case MAC_MODEL_PB180:
225 case MAC_MODEL_PB180C:
226 case MAC_MODEL_PB190:
227 case MAC_MODEL_PB520:
228 /* not yet tested */
229 break;
230 default:
229 via_alt_mapping = 1; 231 via_alt_mapping = 1;
230 via1[vDirB] |= 0x40; 232 via1[vDirB] |= 0x40;
231 via1[vBufB] &= ~0x40; 233 via1[vBufB] &= ~0x40;
232 break; 234 break;
233 default: 235 }
234 via_alt_mapping = 0;
235 break;
236 }
237#else
238 via_alt_mapping = 0;
239#endif
240 236
241 /* 237 /*
242 * Now initialize VIA2. For RBV we just kill all interrupts; 238 * Now initialize VIA2. For RBV we just kill all interrupts;
@@ -252,14 +248,17 @@ void __init via_init(void)
252 via2[vT1CH] = 0; 248 via2[vT1CH] = 0;
253 via2[vT2CL] = 0; 249 via2[vT2CL] = 0;
254 via2[vT2CH] = 0; 250 via2[vT2CH] = 0;
255 via2[vACR] &= 0x3F; 251 via2[vACR] &= ~0xC0; /* setup T1 timer with no PB7 output */
256 via2[vACR] &= ~0x03; /* disable port A & B latches */ 252 via2[vACR] &= ~0x03; /* disable port A & B latches */
257 } 253 }
258 254
259 /* 255 /*
260 * Set vPCR for SCSI interrupts (but not on RBV) 256 * Set vPCR for control line interrupts (but not on RBV)
261 */ 257 */
262 if (!rbv_present) { 258 if (!rbv_present) {
259 /* For all VIA types, CA1 (SLOTS IRQ) and CB1 (ASC IRQ)
260 * are made negative edge triggered here.
261 */
263 if (macintosh_config->scsi_type == MAC_SCSI_OLD) { 262 if (macintosh_config->scsi_type == MAC_SCSI_OLD) {
264 /* CB2 (IRQ) indep. input, positive edge */ 263 /* CB2 (IRQ) indep. input, positive edge */
265 /* CA2 (DRQ) indep. input, positive edge */ 264 /* CA2 (DRQ) indep. input, positive edge */
@@ -466,21 +465,6 @@ irqreturn_t via1_irq(int irq, void *dev_id)
466 ++irq_num; 465 ++irq_num;
467 irq_bit <<= 1; 466 irq_bit <<= 1;
468 } while (events >= irq_bit); 467 } while (events >= irq_bit);
469
470#if 0 /* freakin' pmu is doing weird stuff */
471 if (!oss_present) {
472 /* This (still) seems to be necessary to get IDE
473 working. However, if you enable VBL interrupts,
474 you're screwed... */
475 /* FIXME: should we check the SLOTIRQ bit before
476 pulling this stunt? */
477 /* No, it won't be set. that's why we're doing this. */
478 via_irq_disable(IRQ_MAC_NUBUS);
479 via_irq_clear(IRQ_MAC_NUBUS);
480 m68k_handle_int(IRQ_MAC_NUBUS);
481 via_irq_enable(IRQ_MAC_NUBUS);
482 }
483#endif
484 return IRQ_HANDLED; 468 return IRQ_HANDLED;
485} 469}
486 470