Commit 3bcf19ec authored by Geert Uytterhoeven's avatar Geert Uytterhoeven Committed by Linus Torvalds

[PATCH] Mac/m68k VIA updates

Mac/m68k VIA updates (from Ray Knight in 2.4.x)
  - PowerBooks and early Macs use different bits for nubus.
  - Add loglevel macros to printk.
parent 205ec156
...@@ -137,15 +137,15 @@ void __init via_init(void) ...@@ -137,15 +137,15 @@ void __init via_init(void)
panic("UNKNOWN VIA TYPE"); panic("UNKNOWN VIA TYPE");
} }
printk("VIA1 at %p is a 6522 or clone\n", via1); printk(KERN_INFO "VIA1 at %p is a 6522 or clone\n", via1);
printk("VIA2 at %p is ", via2); printk(KERN_INFO "VIA2 at %p is ", via2);
if (rbv_present) { if (rbv_present) {
printk("an RBV\n"); printk(KERN_INFO "an RBV\n");
} else if (oss_present) { } else if (oss_present) {
printk("an OSS\n"); printk(KERN_INFO "an OSS\n");
} else { } else {
printk("a 6522 or clone\n"); printk(KERN_INFO "a 6522 or clone\n");
} }
#ifdef DEBUG_VIA #ifdef DEBUG_VIA
...@@ -291,22 +291,22 @@ void __init via_register_interrupts(void) ...@@ -291,22 +291,22 @@ void __init via_register_interrupts(void)
void via_debug_dump(void) void via_debug_dump(void)
{ {
printk("VIA1: DDRA = 0x%02X DDRB = 0x%02X ACR = 0x%02X\n", printk(KERN_DEBUG "VIA1: DDRA = 0x%02X DDRB = 0x%02X ACR = 0x%02X\n",
(uint) via1[vDirA], (uint) via1[vDirB], (uint) via1[vACR]); (uint) via1[vDirA], (uint) via1[vDirB], (uint) via1[vACR]);
printk(" PCR = 0x%02X IFR = 0x%02X IER = 0x%02X\n", printk(KERN_DEBUG " PCR = 0x%02X IFR = 0x%02X IER = 0x%02X\n",
(uint) via1[vPCR], (uint) via1[vIFR], (uint) via1[vIER]); (uint) via1[vPCR], (uint) via1[vIFR], (uint) via1[vIER]);
if (oss_present) { if (oss_present) {
printk("VIA2: <OSS>\n"); printk(KERN_DEBUG "VIA2: <OSS>\n");
} else if (rbv_present) { } else if (rbv_present) {
printk("VIA2: IFR = 0x%02X IER = 0x%02X\n", printk(KERN_DEBUG "VIA2: IFR = 0x%02X IER = 0x%02X\n",
(uint) via2[rIFR], (uint) via2[rIER]); (uint) via2[rIFR], (uint) via2[rIER]);
printk(" SIFR = 0x%02X SIER = 0x%02X\n", printk(KERN_DEBUG " SIFR = 0x%02X SIER = 0x%02X\n",
(uint) via2[rSIFR], (uint) via2[rSIER]); (uint) via2[rSIFR], (uint) via2[rSIER]);
} else { } else {
printk("VIA2: DDRA = 0x%02X DDRB = 0x%02X ACR = 0x%02X\n", printk(KERN_DEBUG "VIA2: DDRA = 0x%02X DDRB = 0x%02X ACR = 0x%02X\n",
(uint) via2[vDirA], (uint) via2[vDirB], (uint) via2[vDirA], (uint) via2[vDirB],
(uint) via2[vACR]); (uint) via2[vACR]);
printk(" PCR = 0x%02X IFR = 0x%02X IER = 0x%02X\n", printk(KERN_DEBUG " PCR = 0x%02X IFR = 0x%02X IER = 0x%02X\n",
(uint) via2[vPCR], (uint) via2[vPCR],
(uint) via2[vIFR], (uint) via2[vIER]); (uint) via2[vIFR], (uint) via2[vIER]);
} }
...@@ -374,7 +374,10 @@ void __init via_nubus_init(void) ...@@ -374,7 +374,10 @@ void __init via_nubus_init(void)
if (!rbv_present) { if (!rbv_present) {
/* set the line to be an output on non-RBV machines */ /* set the line to be an output on non-RBV machines */
via2[vDirB] |= 0x02; if ((macintosh_config->adb_type != MAC_ADB_PB1) &&
(macintosh_config->adb_type != MAC_ADB_PB2)) {
via2[vDirB] |= 0x02;
}
} }
/* this seems to be an ADB bit on PMU machines */ /* this seems to be an ADB bit on PMU machines */
...@@ -390,8 +393,23 @@ void __init via_nubus_init(void) ...@@ -390,8 +393,23 @@ void __init via_nubus_init(void)
via2[rSIER] = 0x7F; via2[rSIER] = 0x7F;
via2[rSIER] = nubus_active | 0x80; via2[rSIER] = nubus_active | 0x80;
} else { } else {
via2[vBufA] = 0xFF; /* These are ADB bits on PMU */
via2[vDirA] = ~nubus_active; if ((macintosh_config->adb_type != MAC_ADB_PB1) &&
(macintosh_config->adb_type != MAC_ADB_PB2)) {
switch(macintosh_config->ident)
{
case MAC_MODEL_II:
case MAC_MODEL_IIX:
case MAC_MODEL_IICX:
case MAC_MODEL_SE30:
via2[vBufA] |= 0x3F;
via2[vDirA] = ~nubus_active | 0xc0;
break;
default:
via2[vBufA] = 0xFF;
via2[vDirA] = ~nubus_active;
}
}
} }
} }
...@@ -481,7 +499,7 @@ void via_irq_enable(int irq) { ...@@ -481,7 +499,7 @@ void via_irq_enable(int irq) {
int irq_bit = 1 << irq_idx; int irq_bit = 1 << irq_idx;
#ifdef DEBUG_IRQUSE #ifdef DEBUG_IRQUSE
printk("via_irq_enable(%d)\n", irq); printk(KERN_DEBUG "via_irq_enable(%d)\n", irq);
#endif #endif
if (irq_src == 1) { if (irq_src == 1) {
...@@ -508,7 +526,21 @@ void via_irq_enable(int irq) { ...@@ -508,7 +526,21 @@ void via_irq_enable(int irq) {
via2[rSIER] = IER_SET_BIT(irq_idx); via2[rSIER] = IER_SET_BIT(irq_idx);
} else { } else {
/* Make sure the bit is an input, to enable the irq */ /* Make sure the bit is an input, to enable the irq */
via2[vDirA] &= ~irq_bit; /* But not on PowerBooks, that's ADB... */
if ((macintosh_config->adb_type != MAC_ADB_PB1) &&
(macintosh_config->adb_type != MAC_ADB_PB2)) {
switch(macintosh_config->ident)
{
case MAC_MODEL_II:
case MAC_MODEL_IIX:
case MAC_MODEL_IICX:
case MAC_MODEL_SE30:
via2[vDirA] &= (~irq_bit | 0xc0);
break;
default:
via2[vDirA] &= ~irq_bit;
}
}
} }
nubus_active |= irq_bit; nubus_active |= irq_bit;
} }
...@@ -520,7 +552,7 @@ void via_irq_disable(int irq) { ...@@ -520,7 +552,7 @@ void via_irq_disable(int irq) {
int irq_bit = 1 << irq_idx; int irq_bit = 1 << irq_idx;
#ifdef DEBUG_IRQUSE #ifdef DEBUG_IRQUSE
printk("via_irq_disable(%d)\n", irq); printk(KERN_DEBUG "via_irq_disable(%d)\n", irq);
#endif #endif
if (irq_src == 1) { if (irq_src == 1) {
...@@ -533,7 +565,11 @@ void via_irq_disable(int irq) { ...@@ -533,7 +565,11 @@ void via_irq_disable(int irq) {
via2[rSIER] = IER_CLR_BIT(irq_idx); via2[rSIER] = IER_CLR_BIT(irq_idx);
} else { } else {
/* disable the nubus irq by changing dir to output */ /* disable the nubus irq by changing dir to output */
via2[vDirA] |= irq_bit; /* except on PMU */
if ((macintosh_config->adb_type != MAC_ADB_PB1) &&
(macintosh_config->adb_type != MAC_ADB_PB2)) {
via2[vDirA] |= irq_bit;
}
} }
nubus_active &= ~irq_bit; nubus_active &= ~irq_bit;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment