pre-2.3.4..
[davej-history.git] / include / asm-m68k / macints.h
blobe731c0e7f3ed630000b431f1c98f6c7b7c3ab02f
1 /*
2 ** macints.h -- Macintosh Linux interrupt handling structs and prototypes
3 **
4 ** Copyright 1997 by Michael Schmitz
5 **
6 ** This file is subject to the terms and conditions of the GNU General Public
7 ** License. See the file COPYING in the main directory of this archive
8 ** for more details.
9 **
12 #ifndef _ASM_MACINTS_H_
13 #define _ASM_MACINTS_H_
15 #include <asm/irq.h>
18 ** Macintosh Interrupt sources.
20 ** Note: these are all routed via the generic VIA interrupt routine!
24 #define SRC_VIA1 0
25 #define SRC_VIA2 1
27 #define VIA1_SOURCE_BASE 8
28 #define VIA2_SOURCE_BASE 16
29 #define RBV_SOURCE_BASE 24
30 #define MAC_SCC_SOURCE_BASE 32
31 #define NUBUS_SOURCE_BASE 56
32 #define NUBUS_MAX_SOURCES 8
34 /* FIXME: sources not contigous ... */
35 #define NUM_MAC_SOURCES (NUBUS_SOURCE_BASE+NUBUS_MAX_SOURCES-VIA1_SOURCE_BASE)
37 #define IRQ_SRC_MASK (VIA1_SOURCE_BASE|VIA2_SOURCE_BASE|MAC_SCC_SOURCE_BASE)
38 #define IRQ_IDX_MASK 7
40 /*
41 * quick hack to adapt old MACHSPEC-aware source
43 #define IRQ_IDX(irq) (irq)
45 /* interrupt service types */
46 #define IRQ_TYPE_SLOW 0
47 #define IRQ_TYPE_FAST 1
48 #define IRQ_TYPE_PRIO 2
50 #define IRQ_SPURIOUS (0)
52 /* auto-vector interrupts */
53 #define IRQ_AUTO_1 (1)
54 #define IRQ_AUTO_2 (2)
55 #define IRQ_AUTO_3 (3)
56 #define IRQ_AUTO_4 (4)
57 #define IRQ_AUTO_5 (5)
58 #define IRQ_AUTO_6 (6)
59 #define IRQ_AUTO_7 (7)
61 /* VIA1 interrupts */
62 #define IRQ_VIA1_0 (8) /* one second int. */
63 #define IRQ_VIA1_1 (9) /* VBlank int. */
64 #define IRQ_MAC_VBL IRQ_VIA1_1
65 #define IRQ_VIA1_2 (10) /* ADB SR shifts complete */
66 #define IRQ_MAC_ADB IRQ_VIA1_2
67 #define IRQ_MAC_ADB_SR IRQ_VIA1_2
68 #define IRQ_VIA1_3 (11) /* ADB SR CB2 ?? */
69 #define IRQ_MAC_ADB_SD IRQ_VIA1_3
70 #define IRQ_VIA1_4 (12) /* ADB SR ext. clock pulse */
71 #define IRQ_MAC_ADB_CL IRQ_VIA1_4
72 #define IRQ_VIA1_5 (13)
73 #define IRQ_MAC_TIMER_2 IRQ_VIA1_5
74 #define IRQ_VIA1_6 (14)
75 #define IRQ_MAC_TIMER_1 IRQ_VIA1_6
76 #define IRQ_VIA1_7 (15)
78 /* VIA2 interrupts */
79 #define IRQ_VIA2_0 (16)
80 #define IRQ_MAC_SCSIDRQ IRQ_VIA2_0
81 #define IRQ_VIA2_1 (17)
82 #define IRQ_MAC_NUBUS IRQ_VIA2_1
83 #define IRQ_VIA2_2 (18)
84 #define IRQ_VIA2_3 (19)
85 #define IRQ_MAC_SCSI IRQ_VIA2_3
86 #define IRQ_VIA2_4 (20)
87 #define IRQ_VIA2_5 (21)
88 #define IRQ_VIA2_6 (22)
89 #define IRQ_VIA2_7 (23)
91 #if 0
92 /* RBV interrupts */
93 #define IRQ_RBV_0 (24)
94 #define IRQ_RBV_1 (25)
95 #define IRQ_RBV_2 (26)
96 #define IRQ_RBV_3 (27)
97 #define IRQ_RBV_4 (28)
98 #define IRQ_RBV_5 (29)
99 #define IRQ_RBV_6 (30)
100 #define IRQ_RBV_7 (31)
101 #endif
103 /* Level 3 (PSC, AV Macs only) interrupts */
104 #define IRQ_PSC3_0 (24)
105 #define IRQ_MAC_MACE IRQ_PSC3_0
106 #define IRQ_PSC3_1 (25)
107 #define IRQ_PSC3_2 (26)
108 #define IRQ_PSC3_3 (27)
110 /* Level 4 (SCC) interrupts */
111 #define IRQ_SCC (32)
112 #define IRQ_SCCB (33)
113 #define IRQ_SCCA (34)
114 #if 0 /* FIXME: are there multiple interrupt conditions on the SCC ?? */
115 /* SCC interrupts */
116 #define IRQ_SCCB_TX (32)
117 #define IRQ_SCCB_STAT (33)
118 #define IRQ_SCCB_RX (34)
119 #define IRQ_SCCB_SPCOND (35)
120 #define IRQ_SCCA_TX (36)
121 #define IRQ_SCCA_STAT (37)
122 #define IRQ_SCCA_RX (38)
123 #define IRQ_SCCA_SPCOND (39)
124 #endif
126 /* Level 4 (PSC, AV Macs only) interrupts */
127 #define IRQ_PSC4_0 (32)
128 #define IRQ_PSC4_1 (33)
129 #define IRQ_PSC4_2 (34)
130 #define IRQ_PSC4_3 (35)
131 #define IRQ_MAC_MACE_DMA IRQ_PSC4_3
133 /* Level 5 (PSC, AV Macs only) interrupts */
134 #define IRQ_PSC5_0 (40)
135 #define IRQ_PSC5_1 (41)
136 #define IRQ_PSC5_2 (42)
137 #define IRQ_PSC5_3 (43)
139 /* Level 6 (PSC, AV Macs only) interrupts */
140 #define IRQ_PSC6_0 (48)
141 #define IRQ_PSC6_1 (49)
142 #define IRQ_PSC6_2 (50)
143 #define IRQ_PSC6_3 (51)
145 /* Nubus interrupts (cascaded to VIA2) */
146 #define IRQ_NUBUS_1 (56)
148 #define INT_CLK 24576 /* CLK while int_clk =2.456MHz and divide = 100 */
149 #define INT_TICKS 246 /* to make sched_time = 99.902... HZ */
152 #define VIA_ENABLE 0
153 #define VIA_PENDING 1
154 #define VIA_SERVICE 2
155 #define VIA_MASK 3
158 * Utility functions for setting/clearing bits in the interrupt registers of
159 * the VIA.
162 void mac_enable_irq( unsigned irq );
163 void mac_disable_irq( unsigned irq );
164 void mac_turnon_irq( unsigned irq );
165 void mac_turnoff_irq( unsigned irq );
166 void mac_clear_pending_irq( unsigned irq );
167 int mac_irq_pending( unsigned irq );
168 int nubus_request_irq(int slot, void *dev_id, void (*handler)(int,void *,struct pt_regs *));
169 int nubus_free_irq(int slot);
171 unsigned long mac_register_nubus_int( void );
172 void mac_unregister_nubus_int( unsigned long );
174 extern void mac_default_handler(int irq, void *dev_id, struct pt_regs *regs);
175 extern void via1_irq(int irq, void *dev_id, struct pt_regs *regs);
176 extern void via2_irq(int irq, void *dev_id, struct pt_regs *regs);
177 extern void rbv_irq(int irq, void *dev_id, struct pt_regs *regs);
178 extern void mac_bang(int irq, void *dev_id, struct pt_regs *regs);
180 extern void mac_SCC_handler(int irq, void *dev_id, struct pt_regs *regs);
182 #endif /* asm/macints.h */