This source file includes following definitions.
- miata_srm_device_interrupt
- miata_init_irq
- miata_map_irq
- miata_swizzle
- miata_init_pci
- miata_kill_arch
1
2
3
4
5
6
7
8
9
10
11
12 #include <linux/kernel.h>
13 #include <linux/types.h>
14 #include <linux/mm.h>
15 #include <linux/sched.h>
16 #include <linux/pci.h>
17 #include <linux/init.h>
18 #include <linux/reboot.h>
19
20 #include <asm/ptrace.h>
21 #include <asm/dma.h>
22 #include <asm/irq.h>
23 #include <asm/mmu_context.h>
24 #include <asm/io.h>
25 #include <asm/pgtable.h>
26 #include <asm/core_cia.h>
27 #include <asm/tlbflush.h>
28
29 #include "proto.h"
30 #include "irq_impl.h"
31 #include "pci_impl.h"
32 #include "machvec_impl.h"
33
34
35 static void
36 miata_srm_device_interrupt(unsigned long vector)
37 {
38 int irq;
39
40 irq = (vector - 0x800) >> 4;
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56 if (irq >= 16)
57 irq = irq + 8;
58
59 handle_irq(irq);
60 }
61
62 static void __init
63 miata_init_irq(void)
64 {
65 if (alpha_using_srm)
66 alpha_mv.device_interrupt = miata_srm_device_interrupt;
67
68 #if 0
69
70 *(vulp)PYXIS_INT_HILO = 0x000000B2UL; mb();
71 *(vulp)PYXIS_RT_COUNT = 0UL; mb();
72 #endif
73
74 init_i8259a_irqs();
75
76
77
78
79
80
81 init_pyxis_irqs(0x63b0000);
82
83 common_init_isa_dma();
84 setup_irq(16+2, &halt_switch_irqaction);
85 setup_irq(16+6, &timer_cascade_irqaction);
86 }
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153 static int
154 miata_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
155 {
156 static char irq_tab[18][5] = {
157
158 {16+ 8, 16+ 8, 16+ 8, 16+ 8, 16+ 8},
159 { -1, -1, -1, -1, -1},
160 { -1, -1, -1, -1, -1},
161 { -1, -1, -1, -1, -1},
162 { -1, -1, -1, -1, -1},
163 { -1, -1, -1, -1, -1},
164 { -1, -1, -1, -1, -1},
165 { -1, -1, -1, -1, -1},
166 {16+12, 16+12, 16+13, 16+14, 16+15},
167 {16+16, 16+16, 16+17, 16+18, 16+19},
168
169 {16+11, 16+11, 16+11, 16+11, 16+11},
170 { -1, -1, -1, -1, -1},
171 { -1, -1, -1, -1, -1},
172 { -1, -1, -1, -1, -1},
173 {16+20, 16+20, 16+21, 16+22, 16+23},
174 {16+24, 16+24, 16+25, 16+26, 16+27},
175 {16+28, 16+28, 16+29, 16+30, 16+31},
176
177 { -1, -1, -1, -1, -1},
178 };
179 const long min_idsel = 3, max_idsel = 20, irqs_per_slot = 5;
180
181
182
183
184 if((slot == 7) && (PCI_FUNC(dev->devfn) == 3)) {
185 u8 irq=0;
186 struct pci_dev *pdev = pci_get_slot(dev->bus, dev->devfn & ~7);
187 if(pdev == NULL || pci_read_config_byte(pdev, 0x40,&irq) != PCIBIOS_SUCCESSFUL) {
188 pci_dev_put(pdev);
189 return -1;
190 }
191 else {
192 pci_dev_put(pdev);
193 return irq;
194 }
195 }
196
197 return COMMON_TABLE_LOOKUP;
198 }
199
200 static u8
201 miata_swizzle(struct pci_dev *dev, u8 *pinp)
202 {
203 int slot, pin = *pinp;
204
205 if (dev->bus->number == 0) {
206 slot = PCI_SLOT(dev->devfn);
207 }
208
209 else if ((PCI_SLOT(dev->bus->self->devfn) == 8) ||
210 (PCI_SLOT(dev->bus->self->devfn) == 20)) {
211 slot = PCI_SLOT(dev->devfn) + 9;
212 }
213 else
214 {
215
216 do {
217 if ((PCI_SLOT(dev->bus->self->devfn) == 8) ||
218 (PCI_SLOT(dev->bus->self->devfn) == 20)) {
219 slot = PCI_SLOT(dev->devfn) + 9;
220 break;
221 }
222 pin = pci_swizzle_interrupt_pin(dev, pin);
223
224
225 dev = dev->bus->self;
226
227 slot = PCI_SLOT(dev->devfn);
228 } while (dev->bus->self);
229 }
230 *pinp = pin;
231 return slot;
232 }
233
234 static void __init
235 miata_init_pci(void)
236 {
237 cia_init_pci();
238 SMC669_Init(0);
239 es1888_init();
240 }
241
242 static void
243 miata_kill_arch(int mode)
244 {
245 cia_kill_arch(mode);
246
247 #ifndef ALPHA_RESTORE_SRM_SETUP
248 switch(mode) {
249 case LINUX_REBOOT_CMD_RESTART:
250
251 if (alpha_using_srm) {
252 *(vuip) PYXIS_RESET = 0x0000dead;
253 mb();
254 }
255 break;
256 case LINUX_REBOOT_CMD_HALT:
257 break;
258 case LINUX_REBOOT_CMD_POWER_OFF:
259 break;
260 }
261
262 halt();
263 #endif
264 }
265
266
267
268
269
270
271 struct alpha_machine_vector miata_mv __initmv = {
272 .vector_name = "Miata",
273 DO_EV5_MMU,
274 DO_DEFAULT_RTC,
275 DO_PYXIS_IO,
276 .machine_check = cia_machine_check,
277 .max_isa_dma_address = ALPHA_MAX_ISA_DMA_ADDRESS,
278 .min_io_address = DEFAULT_IO_BASE,
279 .min_mem_address = DEFAULT_MEM_BASE,
280 .pci_dac_offset = PYXIS_DAC_OFFSET,
281
282 .nr_irqs = 48,
283 .device_interrupt = pyxis_device_interrupt,
284
285 .init_arch = pyxis_init_arch,
286 .init_irq = miata_init_irq,
287 .init_rtc = common_init_rtc,
288 .init_pci = miata_init_pci,
289 .kill_arch = miata_kill_arch,
290 .pci_map_irq = miata_map_irq,
291 .pci_swizzle = miata_swizzle,
292 };
293 ALIAS_MV(miata)