diff options
author | Finn Thain <fthain@telegraphics.com.au> | 2008-11-18 14:45:20 -0500 |
---|---|---|
committer | Geert Uytterhoeven <geert@linux-m68k.org> | 2008-12-28 14:00:01 -0500 |
commit | 4a973592d67ccc240bca694e48ce88facd764043 (patch) | |
tree | fbf54b8b783f4780be18443c76b7c3ba808f72cb /arch/m68k/mac | |
parent | 40f7f9c1c22aef049ed7339d9e45624aa980a1a0 (diff) |
m68k: Mac via cleanup and commentry
No behavioural changes, just cleanups and better documentation.
Signed-off-by: Finn Thain <fthain@telegraphics.com.au>
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Diffstat (limited to 'arch/m68k/mac')
-rw-r--r-- | arch/m68k/mac/via.c | 79 |
1 files changed, 32 insertions, 47 deletions
diff --git a/arch/m68k/mac/via.c b/arch/m68k/mac/via.c index 1bdb03c73c0f..125404788e8d 100644 --- a/arch/m68k/mac/via.c +++ b/arch/m68k/mac/via.c | |||
@@ -37,10 +37,6 @@ | |||
37 | #include <asm/mac_psc.h> | 37 | #include <asm/mac_psc.h> |
38 | 38 | ||
39 | volatile __u8 *via1, *via2; | 39 | volatile __u8 *via1, *via2; |
40 | #if 0 | ||
41 | /* See note in mac_via.h about how this is possibly not useful */ | ||
42 | volatile long *via_memory_bogon=(long *)&via_memory_bogon; | ||
43 | #endif | ||
44 | int rbv_present; | 40 | int rbv_present; |
45 | int via_alt_mapping; | 41 | int via_alt_mapping; |
46 | EXPORT_SYMBOL(via_alt_mapping); | 42 | EXPORT_SYMBOL(via_alt_mapping); |
@@ -66,7 +62,7 @@ static int gIER,gIFR,gBufA,gBufB; | |||
66 | #define MAC_CLOCK_LOW (MAC_CLOCK_TICK&0xFF) | 62 | #define MAC_CLOCK_LOW (MAC_CLOCK_TICK&0xFF) |
67 | #define MAC_CLOCK_HIGH (MAC_CLOCK_TICK>>8) | 63 | #define MAC_CLOCK_HIGH (MAC_CLOCK_TICK>>8) |
68 | 64 | ||
69 | /* To disable a NuBus slot on Quadras we make the slot IRQ lines outputs, set | 65 | /* 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 | 66 | * 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 | 67 | * 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 | 68 | * interrupts. When any slot IRQ is disabled we mask the (edge triggered) CA1 |
@@ -180,7 +176,7 @@ void __init via_init(void) | |||
180 | via1[vT1CH] = 0; | 176 | via1[vT1CH] = 0; |
181 | via1[vT2CL] = 0; | 177 | via1[vT2CL] = 0; |
182 | via1[vT2CH] = 0; | 178 | via1[vT2CH] = 0; |
183 | via1[vACR] &= 0x3F; | 179 | via1[vACR] &= ~0xC0; /* setup T1 timer with no PB7 output */ |
184 | via1[vACR] &= ~0x03; /* disable port A & B latches */ | 180 | via1[vACR] &= ~0x03; /* disable port A & B latches */ |
185 | 181 | ||
186 | /* | 182 | /* |
@@ -203,40 +199,41 @@ void __init via_init(void) | |||
203 | 199 | ||
204 | /* Everything below this point is VIA2/RBV only... */ | 200 | /* Everything below this point is VIA2/RBV only... */ |
205 | 201 | ||
206 | if (oss_present) return; | 202 | if (oss_present) |
203 | return; | ||
207 | 204 | ||
208 | #if 1 | ||
209 | /* Some machines support an alternate IRQ mapping that spreads */ | 205 | /* Some machines support an alternate IRQ mapping that spreads */ |
210 | /* Ethernet and Sound out to their own autolevel IRQs and moves */ | 206 | /* 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 */ | 207 | /* 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. */ | 208 | /* that the IIfx emulates this alternate mapping using the OSS. */ |
213 | 209 | ||
214 | switch(macintosh_config->ident) { | 210 | via_alt_mapping = 0; |
215 | case MAC_MODEL_P475: | 211 | if (macintosh_config->via_type == MAC_VIA_QUADRA) |
216 | case MAC_MODEL_P475F: | 212 | switch (macintosh_config->ident) { |
217 | case MAC_MODEL_P575: | 213 | case MAC_MODEL_C660: |
218 | case MAC_MODEL_Q605: | 214 | case MAC_MODEL_Q840: |
219 | case MAC_MODEL_Q605_ACC: | 215 | /* not applicable */ |
220 | case MAC_MODEL_C610: | 216 | break; |
221 | case MAC_MODEL_Q610: | 217 | case MAC_MODEL_P588: |
222 | case MAC_MODEL_Q630: | 218 | case MAC_MODEL_TV: |
223 | case MAC_MODEL_C650: | 219 | case MAC_MODEL_PB140: |
224 | case MAC_MODEL_Q650: | 220 | case MAC_MODEL_PB145: |
225 | case MAC_MODEL_Q700: | 221 | case MAC_MODEL_PB160: |
226 | case MAC_MODEL_Q800: | 222 | case MAC_MODEL_PB165: |
227 | case MAC_MODEL_Q900: | 223 | case MAC_MODEL_PB165C: |
228 | case MAC_MODEL_Q950: | 224 | case MAC_MODEL_PB170: |
225 | case MAC_MODEL_PB180: | ||
226 | case MAC_MODEL_PB180C: | ||
227 | case MAC_MODEL_PB190: | ||
228 | case MAC_MODEL_PB520: | ||
229 | /* not yet tested */ | ||
230 | break; | ||
231 | default: | ||
229 | via_alt_mapping = 1; | 232 | via_alt_mapping = 1; |
230 | via1[vDirB] |= 0x40; | 233 | via1[vDirB] |= 0x40; |
231 | via1[vBufB] &= ~0x40; | 234 | via1[vBufB] &= ~0x40; |
232 | break; | 235 | break; |
233 | default: | 236 | } |
234 | via_alt_mapping = 0; | ||
235 | break; | ||
236 | } | ||
237 | #else | ||
238 | via_alt_mapping = 0; | ||
239 | #endif | ||
240 | 237 | ||
241 | /* | 238 | /* |
242 | * Now initialize VIA2. For RBV we just kill all interrupts; | 239 | * Now initialize VIA2. For RBV we just kill all interrupts; |
@@ -252,14 +249,17 @@ void __init via_init(void) | |||
252 | via2[vT1CH] = 0; | 249 | via2[vT1CH] = 0; |
253 | via2[vT2CL] = 0; | 250 | via2[vT2CL] = 0; |
254 | via2[vT2CH] = 0; | 251 | via2[vT2CH] = 0; |
255 | via2[vACR] &= 0x3F; | 252 | via2[vACR] &= ~0xC0; /* setup T1 timer with no PB7 output */ |
256 | via2[vACR] &= ~0x03; /* disable port A & B latches */ | 253 | via2[vACR] &= ~0x03; /* disable port A & B latches */ |
257 | } | 254 | } |
258 | 255 | ||
259 | /* | 256 | /* |
260 | * Set vPCR for SCSI interrupts (but not on RBV) | 257 | * Set vPCR for control line interrupts (but not on RBV) |
261 | */ | 258 | */ |
262 | if (!rbv_present) { | 259 | if (!rbv_present) { |
260 | /* For all VIA types, CA1 (SLOTS IRQ) and CB1 (ASC IRQ) | ||
261 | * are made negative edge triggered here. | ||
262 | */ | ||
263 | if (macintosh_config->scsi_type == MAC_SCSI_OLD) { | 263 | if (macintosh_config->scsi_type == MAC_SCSI_OLD) { |
264 | /* CB2 (IRQ) indep. input, positive edge */ | 264 | /* CB2 (IRQ) indep. input, positive edge */ |
265 | /* CA2 (DRQ) indep. input, positive edge */ | 265 | /* CA2 (DRQ) indep. input, positive edge */ |
@@ -466,21 +466,6 @@ irqreturn_t via1_irq(int irq, void *dev_id) | |||
466 | ++irq_num; | 466 | ++irq_num; |
467 | irq_bit <<= 1; | 467 | irq_bit <<= 1; |
468 | } while (events >= irq_bit); | 468 | } 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; | 469 | return IRQ_HANDLED; |
485 | } | 470 | } |
486 | 471 | ||