aboutsummaryrefslogtreecommitdiffstats
path: root/arch/m68k/mac/via.c
diff options
context:
space:
mode:
authorMike Travis <travis@sgi.com>2008-12-31 20:34:16 -0500
committerIngo Molnar <mingo@elte.hu>2009-01-03 12:53:31 -0500
commit7eb19553369c46cc1fa64caf120cbcab1b597f7c (patch)
treeef1a3beae706b9497c845d0a2557ceb4d2754998 /arch/m68k/mac/via.c
parent6092848a2a23b660150a38bc06f59d75838d70c8 (diff)
parent8c384cdee3e04d6194a2c2b192b624754f990835 (diff)
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux-2.6-cpumask into merge-rr-cpumask
Conflicts: arch/x86/kernel/io_apic.c kernel/rcuclassic.c kernel/sched.c kernel/time/tick-sched.c Signed-off-by: Mike Travis <travis@sgi.com> [ mingo@elte.hu: backmerged typo fix for io_apic.c ] Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/m68k/mac/via.c')
-rw-r--r--arch/m68k/mac/via.c80
1 files changed, 32 insertions, 48 deletions
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