25 #include <linux/types.h>
26 #include <linux/kernel.h>
30 #include <linux/module.h>
33 #include <asm/bootinfo.h>
44 static __u8 rbv_clear;
55 static int gIER,gIFR,gBufA,gBufB;
61 #define TICK_SIZE 10000
62 #define MAC_CLOCK_TICK (783300/HZ)
63 #define MAC_CLOCK_LOW (MAC_CLOCK_TICK&0xFF)
64 #define MAC_CLOCK_HIGH (MAC_CLOCK_TICK>>8)
107 static u8 nubus_disabled;
169 panic(
"UNKNOWN VIA TYPE");
180 printk(
"a 6522 or clone\n");
244 via2[gIFR] = 0x7F | rbv_clear;
294 pr_err(
"Couldn't register %s interrupt\n",
"timer");
366 printk(
KERN_ERR "via_get_cache_disable called on a non-VIA machine!\n");
453 unsigned char irq_bit,
events;
462 if (events & irq_bit) {
463 via1[
vIFR] = irq_bit;
468 }
while (events >= irq_bit);
471 static void via2_irq(
unsigned int irq,
struct irq_desc *
desc)
474 unsigned char irq_bit,
events;
476 events =
via2[gIFR] &
via2[gIER] & 0x7F;
483 if (events & irq_bit) {
484 via2[gIFR] = irq_bit | rbv_clear;
489 }
while (events >= irq_bit);
500 unsigned char slot_bit,
events;
502 events = ~via2[gBufA] & 0x7F;
504 events &= via2[
rSIER];
506 events &= ~via2[
vDirA];
514 if (events & slot_bit) {
523 via2[gIFR] = 0x02 | rbv_clear;
524 events = ~via2[gBufA] & 0x7F;
526 events &= via2[
rSIER];
528 events &= ~via2[
vDirA];
540 irq_set_chained_handler(IRQ_AUTO_1,
via1_irq);
542 irq_set_chained_handler(IRQ_AUTO_6,
via1_irq);
544 irq_set_chained_handler(IRQ_AUTO_1,
via1_irq);
546 irq_set_chained_handler(IRQ_AUTO_2, via2_irq);
560 }
else if (irq_src == 2) {
563 }
else if (irq_src == 7) {
567 nubus_disabled &= ~(1 << irq_idx);
592 }
else if (irq_src == 2) {
594 }
else if (irq_src == 7) {
598 nubus_disabled |= 1 << irq_idx;