isa_machdep.c revision 1.6.50.4 1 1.6.50.4 chris /* $NetBSD: isa_machdep.c,v 1.6.50.4 2008/01/26 19:27:10 chris Exp $ */
2 1.1 chris
3 1.1 chris /*-
4 1.1 chris * Copyright (c) 1996-1998 The NetBSD Foundation, Inc.
5 1.1 chris * All rights reserved.
6 1.1 chris *
7 1.1 chris * This code is derived from software contributed to The NetBSD Foundation
8 1.1 chris * by Mark Brinicombe, Charles M. Hannum and by Jason R. Thorpe of the
9 1.1 chris * Numerical Aerospace Simulation Facility, NASA Ames Research Center.
10 1.1 chris *
11 1.1 chris * Redistribution and use in source and binary forms, with or without
12 1.1 chris * modification, are permitted provided that the following conditions
13 1.1 chris * are met:
14 1.1 chris * 1. Redistributions of source code must retain the above copyright
15 1.1 chris * notice, this list of conditions and the following disclaimer.
16 1.1 chris * 2. Redistributions in binary form must reproduce the above copyright
17 1.1 chris * notice, this list of conditions and the following disclaimer in the
18 1.1 chris * documentation and/or other materials provided with the distribution.
19 1.1 chris * 3. All advertising materials mentioning features or use of this software
20 1.1 chris * must display the following acknowledgement:
21 1.1 chris * This product includes software developed by the NetBSD
22 1.1 chris * Foundation, Inc. and its contributors.
23 1.1 chris * 4. Neither the name of The NetBSD Foundation nor the names of its
24 1.1 chris * contributors may be used to endorse or promote products derived
25 1.1 chris * from this software without specific prior written permission.
26 1.1 chris *
27 1.1 chris * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
28 1.1 chris * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
29 1.1 chris * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
30 1.1 chris * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
31 1.1 chris * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
32 1.1 chris * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
33 1.1 chris * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
34 1.1 chris * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
35 1.1 chris * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
36 1.1 chris * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
37 1.1 chris * POSSIBILITY OF SUCH DAMAGE.
38 1.1 chris */
39 1.1 chris
40 1.1 chris /*-
41 1.1 chris * Copyright (c) 1991 The Regents of the University of California.
42 1.1 chris * All rights reserved.
43 1.1 chris *
44 1.1 chris * This code is derived from software contributed to Berkeley by
45 1.1 chris * William Jolitz.
46 1.1 chris *
47 1.1 chris * Redistribution and use in source and binary forms, with or without
48 1.1 chris * modification, are permitted provided that the following conditions
49 1.1 chris * are met:
50 1.1 chris * 1. Redistributions of source code must retain the above copyright
51 1.1 chris * notice, this list of conditions and the following disclaimer.
52 1.1 chris * 2. Redistributions in binary form must reproduce the above copyright
53 1.1 chris * notice, this list of conditions and the following disclaimer in the
54 1.1 chris * documentation and/or other materials provided with the distribution.
55 1.5 agc * 3. Neither the name of the University nor the names of its contributors
56 1.1 chris * may be used to endorse or promote products derived from this software
57 1.1 chris * without specific prior written permission.
58 1.1 chris *
59 1.1 chris * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
60 1.1 chris * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
61 1.1 chris * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
62 1.1 chris * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
63 1.1 chris * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
64 1.1 chris * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
65 1.1 chris * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
66 1.1 chris * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
67 1.1 chris * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
68 1.1 chris * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
69 1.1 chris * SUCH DAMAGE.
70 1.1 chris *
71 1.1 chris * @(#)isa.c 7.2 (Berkeley) 5/13/91
72 1.1 chris */
73 1.3 chris
74 1.3 chris #include <sys/cdefs.h>
75 1.6.50.4 chris __KERNEL_RCSID(0, "$NetBSD: isa_machdep.c,v 1.6.50.4 2008/01/26 19:27:10 chris Exp $");
76 1.1 chris
77 1.1 chris #include "opt_irqstats.h"
78 1.1 chris
79 1.1 chris #include <sys/param.h>
80 1.1 chris #include <sys/systm.h>
81 1.1 chris #include <sys/kernel.h>
82 1.1 chris #include <sys/syslog.h>
83 1.1 chris #include <sys/device.h>
84 1.1 chris #include <sys/malloc.h>
85 1.1 chris #include <sys/proc.h>
86 1.1 chris
87 1.1 chris #define _ARM32_BUS_DMA_PRIVATE
88 1.1 chris #include <machine/bus.h>
89 1.1 chris
90 1.1 chris #include <machine/intr.h>
91 1.1 chris #include <machine/pio.h>
92 1.1 chris #include <machine/bootconfig.h>
93 1.1 chris #include <machine/isa_machdep.h>
94 1.1 chris
95 1.1 chris #include <dev/isa/isareg.h>
96 1.1 chris #include <dev/isa/isavar.h>
97 1.1 chris #include <dev/isa/isadmareg.h>
98 1.1 chris #include <dev/isa/isadmavar.h>
99 1.1 chris #include <arm/footbridge/isa/icu.h>
100 1.1 chris #include <arm/footbridge/dc21285reg.h>
101 1.1 chris #include <arm/footbridge/dc21285mem.h>
102 1.6.50.1 chris #include <dev/ic/i8259reg.h>
103 1.1 chris
104 1.1 chris #include <uvm/uvm_extern.h>
105 1.1 chris
106 1.1 chris #include "isadma.h"
107 1.1 chris
108 1.1 chris /* prototypes */
109 1.1 chris static void isa_icu_init __P((void));
110 1.1 chris
111 1.1 chris struct arm32_isa_chipset isa_chipset_tag;
112 1.1 chris
113 1.1 chris void isa_strayintr __P((int));
114 1.1 chris void intr_calculatemasks __P((void));
115 1.1 chris
116 1.1 chris int isa_irqdispatch __P((void *arg));
117 1.1 chris
118 1.6.50.1 chris uint32_t imen;
119 1.6.50.1 chris
120 1.6.50.4 chris static void isa_set_irq_mask(uint32_t intr_enabled);
121 1.6.50.4 chris static void isa_set_irq_hardware_type(int irq, int type);
122 1.6.50.4 chris static struct pic_softc isa_pic =
123 1.6.50.4 chris {
124 1.6.50.4 chris .pic_ops.pic_set_irq_hardware_mask = isa_set_irq_mask,
125 1.6.50.4 chris .pic_ops.pic_set_irq_hardware_type = isa_set_irq_hardware_type,
126 1.6.50.4 chris .pic_nirqs = ICU_LEN,
127 1.6.50.4 chris .pic_pre_assigned_irqs = 0xefbf,
128 1.6.50.4 chris .pic_name = "isa"
129 1.6.50.4 chris };
130 1.6.50.1 chris
131 1.1 chris
132 1.1 chris #define AUTO_EOI_1
133 1.1 chris #define AUTO_EOI_2
134 1.1 chris
135 1.1 chris /*
136 1.1 chris * Fill in default interrupt table (in case of spuruious interrupt
137 1.1 chris * during configuration of kernel, setup interrupt control unit
138 1.1 chris */
139 1.1 chris static void
140 1.1 chris isa_icu_init(void)
141 1.1 chris {
142 1.6.50.1 chris /* reset; program device, four bytes */
143 1.6.50.1 chris outb(IO_ICU1 + PIC_ICW1, ICW1_SELECT | ICW1_IC4);
144 1.6.50.1 chris
145 1.6.50.1 chris /* starting at this vector index */
146 1.6.50.1 chris outb(IO_ICU1 + PIC_ICW2, ICU_OFFSET);
147 1.6.50.1 chris /* slave on line 2 */
148 1.6.50.1 chris outb(IO_ICU1 + PIC_ICW3, ICW3_CASCADE(IRQ_SLAVE));
149 1.6.50.1 chris
150 1.1 chris #ifdef AUTO_EOI_1
151 1.6.50.1 chris /* auto EOI, 8086 mode */
152 1.6.50.1 chris outb(IO_ICU1 + PIC_ICW4, ICW4_AEOI | ICW4_8086);
153 1.1 chris #else
154 1.6.50.1 chris /* 8086 mode */
155 1.6.50.1 chris outb(IO_ICU1 + PIC_ICW4, ICW4_8086);
156 1.1 chris #endif
157 1.6.50.1 chris /* leave interrupts masked */
158 1.6.50.1 chris outb(IO_ICU1 + PIC_OCW1, 0xff);
159 1.6.50.1 chris /* special mask mode (if available) */
160 1.6.50.1 chris outb(IO_ICU1 + PIC_OCW3, OCW3_SELECT | OCW3_SSMM | OCW3_SMM);
161 1.6.50.1 chris /* Read IRR by default. */
162 1.6.50.1 chris outb(IO_ICU1 + PIC_OCW3, OCW3_SELECT | OCW3_RR);
163 1.1 chris #ifdef REORDER_IRQ
164 1.6.50.1 chris /* pri order 3-7, 0-2 (com2 first) */
165 1.6.50.1 chris outb(IO_ICU1 + PIC_OCW2, OCW2_SELECT | OCW2_R | OCW2_SL |
166 1.6.50.1 chris OCW2_ILS(3 - 1));
167 1.1 chris #endif
168 1.1 chris
169 1.6.50.1 chris /* reset; program device, four bytes */
170 1.6.50.1 chris outb(IO_ICU2 + PIC_ICW1, ICW1_SELECT | ICW1_IC4);
171 1.6.50.1 chris
172 1.6.50.1 chris /* staring at this vector index */
173 1.6.50.1 chris outb(IO_ICU2 + PIC_ICW2, ICU_OFFSET + 8);
174 1.6.50.1 chris /* slave connected to line 2 of master */
175 1.6.50.1 chris outb(IO_ICU2 + PIC_ICW3, ICW3_SIC(IRQ_SLAVE));
176 1.1 chris #ifdef AUTO_EOI_2
177 1.6.50.1 chris /* auto EOI, 8086 mode */
178 1.6.50.1 chris outb(IO_ICU2 + PIC_ICW4, ICW4_AEOI | ICW4_8086);
179 1.1 chris #else
180 1.6.50.1 chris /* 8086 mode */
181 1.6.50.1 chris outb(IO_ICU2 + PIC_ICW4, ICW4_8086);
182 1.1 chris #endif
183 1.6.50.1 chris /* leave interrupts masked */
184 1.6.50.1 chris outb(IO_ICU2 + PIC_OCW1, 0xff);
185 1.6.50.1 chris /* special mask mode (if available) */
186 1.6.50.1 chris outb(IO_ICU2 + PIC_OCW3, OCW3_SELECT | OCW3_SSMM | OCW3_SMM);
187 1.6.50.1 chris /* Read IRR by default. */
188 1.6.50.1 chris outb(IO_ICU2 + PIC_OCW3, OCW3_SELECT | OCW3_RR);
189 1.1 chris }
190 1.1 chris
191 1.1 chris /*
192 1.1 chris * Caught a stray interrupt, notify
193 1.1 chris */
194 1.1 chris void
195 1.1 chris isa_strayintr(irq)
196 1.1 chris int irq;
197 1.1 chris {
198 1.1 chris static u_long strays;
199 1.1 chris
200 1.1 chris /*
201 1.1 chris * Stray interrupts on irq 7 occur when an interrupt line is raised
202 1.1 chris * and then lowered before the CPU acknowledges it. This generally
203 1.1 chris * means either the device is screwed or something is cli'ing too
204 1.1 chris * long and it's timing out.
205 1.1 chris */
206 1.1 chris if (++strays <= 5)
207 1.1 chris log(LOG_ERR, "stray interrupt %d%s\n", irq,
208 1.1 chris strays >= 5 ? "; stopped logging" : "");
209 1.1 chris }
210 1.1 chris
211 1.1 chris #define LEGAL_IRQ(x) ((x) >= 0 && (x) < ICU_LEN && (x) != 2)
212 1.1 chris
213 1.1 chris int
214 1.1 chris isa_intr_alloc(ic, mask, type, irq)
215 1.1 chris isa_chipset_tag_t ic;
216 1.1 chris int mask;
217 1.1 chris int type;
218 1.1 chris int *irq;
219 1.1 chris {
220 1.1 chris int i, tmp, bestirq, count;
221 1.6.50.4 chris struct intrline *il;
222 1.2 chris struct intrhand *ih;
223 1.1 chris
224 1.1 chris if (type == IST_NONE)
225 1.1 chris panic("intr_alloc: bogus type");
226 1.1 chris
227 1.1 chris bestirq = -1;
228 1.1 chris count = -1;
229 1.1 chris
230 1.1 chris /* some interrupts should never be dynamically allocated */
231 1.1 chris mask &= 0xdef8;
232 1.1 chris
233 1.1 chris /*
234 1.1 chris * XXX some interrupts will be used later (6 for fdc, 12 for pms).
235 1.1 chris * the right answer is to do "breadth-first" searching of devices.
236 1.1 chris */
237 1.1 chris mask &= 0xefbf;
238 1.1 chris
239 1.1 chris for (i = 0; i < ICU_LEN; i++) {
240 1.1 chris if (LEGAL_IRQ(i) == 0 || (mask & (1<<i)) == 0)
241 1.1 chris continue;
242 1.2 chris
243 1.6.50.1 chris /* XXX shouldn't expose internals of arm_intr here */
244 1.6.50.4 chris il = &(isa_pic.pic_intrlines[i]);
245 1.6.50.4 chris switch(il->il_ist) {
246 1.1 chris case IST_NONE:
247 1.1 chris /*
248 1.1 chris * if nothing's using the irq, just return it
249 1.1 chris */
250 1.1 chris *irq = i;
251 1.1 chris return (0);
252 1.1 chris
253 1.1 chris case IST_EDGE:
254 1.1 chris case IST_LEVEL:
255 1.6.50.4 chris if (type != il->il_ist)
256 1.1 chris continue;
257 1.1 chris /*
258 1.1 chris * if the irq is shareable, count the number of other
259 1.1 chris * handlers, and if it's smaller than the last irq like
260 1.1 chris * this, remember it
261 1.1 chris *
262 1.1 chris * XXX We should probably also consider the
263 1.1 chris * interrupt level and stick IPL_TTY with other
264 1.1 chris * IPL_TTY, etc.
265 1.1 chris */
266 1.2 chris tmp = 0;
267 1.6.50.4 chris TAILQ_FOREACH(ih, &(il->il_handler_list), ih_list)
268 1.2 chris tmp++;
269 1.1 chris if ((bestirq == -1) || (count > tmp)) {
270 1.1 chris bestirq = i;
271 1.1 chris count = tmp;
272 1.1 chris }
273 1.1 chris break;
274 1.1 chris
275 1.1 chris case IST_PULSE:
276 1.1 chris /* this just isn't shareable */
277 1.1 chris continue;
278 1.1 chris }
279 1.1 chris }
280 1.1 chris
281 1.1 chris if (bestirq == -1)
282 1.1 chris return (1);
283 1.1 chris
284 1.1 chris *irq = bestirq;
285 1.1 chris
286 1.1 chris return (0);
287 1.1 chris }
288 1.1 chris
289 1.1 chris const struct evcnt *
290 1.1 chris isa_intr_evcnt(isa_chipset_tag_t ic, int irq)
291 1.1 chris {
292 1.6.50.4 chris return arm_intr_evcnt(&isa_pic, irq);
293 1.1 chris }
294 1.1 chris
295 1.1 chris /*
296 1.1 chris * Set up an interrupt handler to start being called.
297 1.1 chris * XXX PRONE TO RACE CONDITIONS, UGLY, 'INTERESTING' INSERTION ALGORITHM.
298 1.1 chris */
299 1.1 chris void *
300 1.1 chris isa_intr_establish(ic, irq, type, level, ih_fun, ih_arg)
301 1.1 chris isa_chipset_tag_t ic;
302 1.1 chris int irq;
303 1.1 chris int type;
304 1.1 chris int level;
305 1.1 chris int (*ih_fun) __P((void *));
306 1.1 chris void *ih_arg;
307 1.1 chris {
308 1.1 chris if (!LEGAL_IRQ(irq) || type == IST_NONE)
309 1.1 chris panic("intr_establish: bogus irq or type");
310 1.1 chris
311 1.6.50.4 chris return arm_intr_claim(&isa_pic, irq, type, level, NULL, ih_fun, ih_arg);
312 1.1 chris }
313 1.1 chris
314 1.1 chris /*
315 1.1 chris * Deregister an interrupt handler.
316 1.1 chris */
317 1.1 chris void
318 1.1 chris isa_intr_disestablish(ic, arg)
319 1.1 chris isa_chipset_tag_t ic;
320 1.1 chris void *arg;
321 1.1 chris {
322 1.6.50.4 chris return arm_intr_disestablish(&isa_pic, arg);
323 1.6.50.1 chris }
324 1.2 chris
325 1.6.50.1 chris static void
326 1.6.50.4 chris isa_set_irq_mask(uint32_t intr_enabled)
327 1.6.50.1 chris {
328 1.6.50.2 chris uint32_t oldirqstate;
329 1.6.50.2 chris
330 1.6.50.2 chris oldirqstate = disable_interrupts(I32_bit);
331 1.6.50.1 chris /* slave is always enabled */
332 1.6.50.1 chris imen = ~(intr_enabled | (1 << IRQ_SLAVE));
333 1.6.50.1 chris imen &=0xffff;
334 1.6.50.1 chris SET_ICUS();
335 1.6.50.2 chris restore_interrupts(oldirqstate);
336 1.1 chris }
337 1.1 chris
338 1.6.50.1 chris static void
339 1.6.50.4 chris isa_set_irq_hardware_type(int irq, int type)
340 1.6.50.1 chris {
341 1.6.50.1 chris /* irq trigger types are setup in the m1543 */
342 1.6.50.1 chris if (irq < 8) {
343 1.6.50.1 chris outb(0x4d0, (inb(0x4d0) & ~(1 << irq))
344 1.6.50.1 chris | ((type == IST_LEVEL) ? (1 << irq) : 0));
345 1.6.50.1 chris } else {
346 1.6.50.1 chris outb(0x4d1, (inb(0x4d1) & ~(1 << irq))
347 1.6.50.1 chris | ((type == IST_LEVEL) ? (1 << irq) : 0));
348 1.6.50.1 chris }
349 1.6.50.1 chris }
350 1.6.50.1 chris
351 1.1 chris /*
352 1.1 chris * isa_intr_init()
353 1.1 chris *
354 1.1 chris * Initialise the ISA ICU and attach an ISA interrupt handler to the
355 1.1 chris * ISA interrupt line on the footbridge.
356 1.1 chris */
357 1.1 chris void
358 1.1 chris isa_intr_init(void)
359 1.1 chris {
360 1.1 chris static void *isa_ih;
361 1.2 chris
362 1.1 chris isa_icu_init();
363 1.6.50.1 chris
364 1.6.50.4 chris arm_intr_register_pic(&isa_pic);
365 1.6.50.1 chris
366 1.2 chris /* something to break the build in an informative way */
367 1.1 chris #ifndef ISA_FOOTBRIDGE_IRQ
368 1.1 chris #warning Before using isa with footbridge you must define ISA_FOOTBRIDGE_IRQ
369 1.1 chris #endif
370 1.6.50.1 chris isa_ih = footbridge_intr_claim(ISA_FOOTBRIDGE_IRQ, IPL_IRQBUS, "isabus",
371 1.1 chris isa_irqdispatch, NULL);
372 1.1 chris
373 1.1 chris }
374 1.1 chris
375 1.1 chris /* Static array of ISA DMA segments. We only have one on CATS */
376 1.1 chris #if NISADMA > 0
377 1.1 chris struct arm32_dma_range machdep_isa_dma_ranges[1];
378 1.1 chris #endif
379 1.1 chris
380 1.1 chris void
381 1.1 chris isa_footbridge_init(iobase, membase)
382 1.1 chris u_int iobase, membase;
383 1.1 chris {
384 1.1 chris #if NISADMA > 0
385 1.1 chris extern struct arm32_dma_range *footbridge_isa_dma_ranges;
386 1.1 chris extern int footbridge_isa_dma_nranges;
387 1.1 chris
388 1.1 chris machdep_isa_dma_ranges[0].dr_sysbase = bootconfig.dram[0].address;
389 1.1 chris machdep_isa_dma_ranges[0].dr_busbase = bootconfig.dram[0].address;
390 1.1 chris machdep_isa_dma_ranges[0].dr_len = (16 * 1024 * 1024);
391 1.1 chris
392 1.1 chris footbridge_isa_dma_ranges = machdep_isa_dma_ranges;
393 1.1 chris footbridge_isa_dma_nranges = 1;
394 1.1 chris #endif
395 1.1 chris
396 1.1 chris isa_io_init(iobase, membase);
397 1.1 chris }
398 1.1 chris
399 1.1 chris void
400 1.1 chris isa_attach_hook(parent, self, iba)
401 1.1 chris struct device *parent, *self;
402 1.1 chris struct isabus_attach_args *iba;
403 1.1 chris {
404 1.1 chris /*
405 1.1 chris * Since we can only have one ISA bus, we just use a single
406 1.1 chris * statically allocated ISA chipset structure. Pass it up
407 1.1 chris * now.
408 1.1 chris */
409 1.1 chris iba->iba_ic = &isa_chipset_tag;
410 1.1 chris #if NISADMA > 0
411 1.1 chris isa_dma_init();
412 1.1 chris #endif
413 1.1 chris }
414 1.1 chris
415 1.1 chris int
416 1.1 chris isa_irqdispatch(arg)
417 1.1 chris void *arg;
418 1.1 chris {
419 1.6.50.1 chris uint32_t ipendingmask;
420 1.6.50.2 chris uint32_t oldirqstate;
421 1.1 chris
422 1.6.50.2 chris /* disable irqs while reading from the ICUs
423 1.6.50.2 chris * Note that this could be an splhigh, except that serial ports
424 1.6.50.2 chris * attach to isa, and so they wouldn't be blocked */
425 1.6.50.2 chris oldirqstate = disable_interrupts(I32_bit);
426 1.6.50.2 chris
427 1.6.50.1 chris /* read from the isa registers */
428 1.6.50.1 chris ipendingmask = inb(IO_ICU1);
429 1.1 chris
430 1.6.50.1 chris if (ipendingmask & (1 << IRQ_SLAVE))
431 1.6.50.1 chris {
432 1.6.50.1 chris ipendingmask &= ~(1 << IRQ_SLAVE);
433 1.6.50.1 chris ipendingmask |= inb(IO_ICU2) << 8;
434 1.1 chris }
435 1.6.50.2 chris restore_interrupts(oldirqstate);
436 1.6.50.2 chris
437 1.6.50.4 chris /*
438 1.6.50.4 chris * Setup the interrupts into the ipl lists.
439 1.6.50.4 chris * They'll be processed later, as the only way to get here is from
440 1.6.50.4 chris * an interrupt
441 1.6.50.4 chris */
442 1.6.50.4 chris arm_intr_queue_irqs(&isa_pic, ipendingmask);
443 1.6.50.1 chris
444 1.6.50.1 chris return 1;
445 1.1 chris }
446 1.1 chris
447 1.1 chris
448 1.1 chris void
449 1.1 chris isa_fillw(val, addr, len)
450 1.1 chris u_int val;
451 1.1 chris void *addr;
452 1.1 chris size_t len;
453 1.1 chris {
454 1.1 chris if ((u_int)addr >= isa_mem_data_vaddr()
455 1.1 chris && (u_int)addr < isa_mem_data_vaddr() + 0x100000) {
456 1.1 chris bus_size_t offset = ((u_int)addr) & 0xfffff;
457 1.1 chris bus_space_set_region_2(&isa_mem_bs_tag,
458 1.1 chris (bus_space_handle_t)isa_mem_bs_tag.bs_cookie, offset,
459 1.1 chris val, len);
460 1.1 chris } else {
461 1.1 chris u_short *ptr = addr;
462 1.1 chris
463 1.1 chris while (len > 0) {
464 1.1 chris *ptr++ = val;
465 1.1 chris --len;
466 1.1 chris }
467 1.1 chris }
468 1.1 chris }
469