imx31_gpio.c revision 1.1.20.1 1 1.1.20.1 mjf /* $NetBSD: imx31_gpio.c,v 1.1.20.1 2008/06/02 13:21:53 mjf Exp $ */
2 1.1.20.1 mjf /*-
3 1.1.20.1 mjf * Copyright (c) 2007 The NetBSD Foundation, Inc.
4 1.1.20.1 mjf * All rights reserved.
5 1.1.20.1 mjf *
6 1.1.20.1 mjf * This code is derived from software contributed to The NetBSD Foundation
7 1.1.20.1 mjf * by Matt Thomas
8 1.1.20.1 mjf *
9 1.1.20.1 mjf * Redistribution and use in source and binary forms, with or without
10 1.1.20.1 mjf * modification, are permitted provided that the following conditions
11 1.1.20.1 mjf * are met:
12 1.1.20.1 mjf * 1. Redistributions of source code must retain the above copyright
13 1.1.20.1 mjf * notice, this list of conditions and the following disclaimer.
14 1.1.20.1 mjf * 2. Redistributions in binary form must reproduce the above copyright
15 1.1.20.1 mjf * notice, this list of conditions and the following disclaimer in the
16 1.1.20.1 mjf * documentation and/or other materials provided with the distribution.
17 1.1.20.1 mjf *
18 1.1.20.1 mjf * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
19 1.1.20.1 mjf * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
20 1.1.20.1 mjf * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
21 1.1.20.1 mjf * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
22 1.1.20.1 mjf * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
23 1.1.20.1 mjf * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
24 1.1.20.1 mjf * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25 1.1.20.1 mjf * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
26 1.1.20.1 mjf * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27 1.1.20.1 mjf * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28 1.1.20.1 mjf * POSSIBILITY OF SUCH DAMAGE.
29 1.1.20.1 mjf */
30 1.1.20.1 mjf #include <sys/cdefs.h>
31 1.1.20.1 mjf __KERNEL_RCSID(0, "$NetBSD: imx31_gpio.c,v 1.1.20.1 2008/06/02 13:21:53 mjf Exp $");
32 1.1.20.1 mjf
33 1.1.20.1 mjf #define _INTR_PRIVATE
34 1.1.20.1 mjf
35 1.1.20.1 mjf #include "locators.h"
36 1.1.20.1 mjf #include "gpio.h"
37 1.1.20.1 mjf
38 1.1.20.1 mjf #include <sys/param.h>
39 1.1.20.1 mjf #include <sys/evcnt.h>
40 1.1.20.1 mjf
41 1.1.20.1 mjf #include <uvm/uvm_extern.h>
42 1.1.20.1 mjf
43 1.1.20.1 mjf #include <machine/intr.h>
44 1.1.20.1 mjf
45 1.1.20.1 mjf #include <arm/cpu.h>
46 1.1.20.1 mjf #include <arm/armreg.h>
47 1.1.20.1 mjf #include <arm/cpufunc.h>
48 1.1.20.1 mjf
49 1.1.20.1 mjf #include <machine/atomic.h>
50 1.1.20.1 mjf #include <machine/bus.h>
51 1.1.20.1 mjf
52 1.1.20.1 mjf #include <arm/imx/imx31reg.h>
53 1.1.20.1 mjf #include <arm/imx/imx31var.h>
54 1.1.20.1 mjf #include <arm/pic/picvar.h>
55 1.1.20.1 mjf
56 1.1.20.1 mjf #if NGPIO > 0
57 1.1.20.1 mjf #include <sys/gpio.h>
58 1.1.20.1 mjf #include <dev/gpio/gpiovar.h>
59 1.1.20.1 mjf #endif
60 1.1.20.1 mjf
61 1.1.20.1 mjf static void gpio_pic_block_irqs(struct pic_softc *, size_t, uint32_t);
62 1.1.20.1 mjf static void gpio_pic_unblock_irqs(struct pic_softc *, size_t, uint32_t);
63 1.1.20.1 mjf static int gpio_pic_find_pending_irqs(struct pic_softc *);
64 1.1.20.1 mjf static void gpio_pic_establish_irq(struct pic_softc *, struct intrsource *);
65 1.1.20.1 mjf
66 1.1.20.1 mjf const struct pic_ops gpio_pic_ops = {
67 1.1.20.1 mjf .pic_block_irqs = gpio_pic_block_irqs,
68 1.1.20.1 mjf .pic_unblock_irqs = gpio_pic_unblock_irqs,
69 1.1.20.1 mjf .pic_find_pending_irqs = gpio_pic_find_pending_irqs,
70 1.1.20.1 mjf .pic_establish_irq = gpio_pic_establish_irq,
71 1.1.20.1 mjf };
72 1.1.20.1 mjf
73 1.1.20.1 mjf struct gpio_softc {
74 1.1.20.1 mjf struct device gpio_dev;
75 1.1.20.1 mjf struct pic_softc gpio_pic;
76 1.1.20.1 mjf bus_space_tag_t gpio_memt;
77 1.1.20.1 mjf bus_space_handle_t gpio_memh;
78 1.1.20.1 mjf uint32_t gpio_enable_mask;
79 1.1.20.1 mjf uint32_t gpio_edge_mask;
80 1.1.20.1 mjf uint32_t gpio_level_mask;
81 1.1.20.1 mjf #if NGPIO > 0
82 1.1.20.1 mjf struct gpio_chipset_tag gpio_chipset;
83 1.1.20.1 mjf gpio_pin_t gpio_pins[32];
84 1.1.20.1 mjf #endif
85 1.1.20.1 mjf };
86 1.1.20.1 mjf
87 1.1.20.1 mjf #define PIC_TO_SOFTC(pic) \
88 1.1.20.1 mjf ((struct gpio_softc *)((char *)(pic) - \
89 1.1.20.1 mjf offsetof(struct gpio_softc, gpio_pic)))
90 1.1.20.1 mjf
91 1.1.20.1 mjf #define GPIO_READ(gpio, reg) \
92 1.1.20.1 mjf bus_space_read_4((gpio)->gpio_memt, (gpio)->gpio_memh, (reg))
93 1.1.20.1 mjf #define GPIO_WRITE(gpio, reg, val) \
94 1.1.20.1 mjf bus_space_write_4((gpio)->gpio_memt, (gpio)->gpio_memh, (reg), (val))
95 1.1.20.1 mjf
96 1.1.20.1 mjf void
97 1.1.20.1 mjf gpio_pic_unblock_irqs(struct pic_softc *pic, size_t irq_base, uint32_t irq_mask)
98 1.1.20.1 mjf {
99 1.1.20.1 mjf struct gpio_softc * const gpio = PIC_TO_SOFTC(pic);
100 1.1.20.1 mjf KASSERT(irq_base == 0);
101 1.1.20.1 mjf
102 1.1.20.1 mjf gpio->gpio_enable_mask |= irq_mask;
103 1.1.20.1 mjf /*
104 1.1.20.1 mjf * If this a level source, ack it now. If it's still asserted
105 1.1.20.1 mjf * it'll come back.
106 1.1.20.1 mjf */
107 1.1.20.1 mjf if (irq_mask & gpio->gpio_level_mask)
108 1.1.20.1 mjf GPIO_WRITE(gpio, GPIO_ISR, irq_mask);
109 1.1.20.1 mjf GPIO_WRITE(gpio, GPIO_IMR, gpio->gpio_enable_mask);
110 1.1.20.1 mjf }
111 1.1.20.1 mjf
112 1.1.20.1 mjf void
113 1.1.20.1 mjf gpio_pic_block_irqs(struct pic_softc *pic, size_t irq_base, uint32_t irq_mask)
114 1.1.20.1 mjf {
115 1.1.20.1 mjf struct gpio_softc * const gpio = PIC_TO_SOFTC(pic);
116 1.1.20.1 mjf KASSERT(irq_base == 0);
117 1.1.20.1 mjf
118 1.1.20.1 mjf gpio->gpio_enable_mask &= ~irq_mask;
119 1.1.20.1 mjf GPIO_WRITE(gpio, GPIO_IMR, gpio->gpio_enable_mask);
120 1.1.20.1 mjf }
121 1.1.20.1 mjf
122 1.1.20.1 mjf int
123 1.1.20.1 mjf gpio_pic_find_pending_irqs(struct pic_softc *pic)
124 1.1.20.1 mjf {
125 1.1.20.1 mjf struct gpio_softc * const gpio = PIC_TO_SOFTC(pic);
126 1.1.20.1 mjf uint32_t v;
127 1.1.20.1 mjf uint32_t pending;
128 1.1.20.1 mjf
129 1.1.20.1 mjf v = GPIO_READ(gpio, GPIO_ISR);
130 1.1.20.1 mjf pending = (v & gpio->gpio_enable_mask);
131 1.1.20.1 mjf if (pending == 0)
132 1.1.20.1 mjf return 0;
133 1.1.20.1 mjf
134 1.1.20.1 mjf /*
135 1.1.20.1 mjf * Disable the pending interrupts.
136 1.1.20.1 mjf */
137 1.1.20.1 mjf gpio->gpio_enable_mask &= ~pending;
138 1.1.20.1 mjf GPIO_WRITE(gpio, GPIO_IMR, gpio->gpio_enable_mask);
139 1.1.20.1 mjf
140 1.1.20.1 mjf /*
141 1.1.20.1 mjf * If any of the sources are edge triggered, ack them now so
142 1.1.20.1 mjf * we won't lose them.
143 1.1.20.1 mjf */
144 1.1.20.1 mjf if (v & gpio->gpio_edge_mask)
145 1.1.20.1 mjf GPIO_WRITE(gpio, GPIO_ISR, v & gpio->gpio_edge_mask);
146 1.1.20.1 mjf
147 1.1.20.1 mjf /*
148 1.1.20.1 mjf * Now find all the pending bits and mark them as pending.
149 1.1.20.1 mjf */
150 1.1.20.1 mjf do {
151 1.1.20.1 mjf int irq;
152 1.1.20.1 mjf KASSERT(pending != 0);
153 1.1.20.1 mjf irq = 31 - __builtin_clz(pending);
154 1.1.20.1 mjf pending &= ~__BIT(irq);
155 1.1.20.1 mjf pic_mark_pending(&gpio->gpio_pic, irq);
156 1.1.20.1 mjf } while (pending != 0);
157 1.1.20.1 mjf
158 1.1.20.1 mjf return 1;
159 1.1.20.1 mjf }
160 1.1.20.1 mjf
161 1.1.20.1 mjf #define GPIO_TYPEMAP \
162 1.1.20.1 mjf ((GPIO_ICR_LEVEL_LOW << (2*IST_LEVEL_LOW)) | \
163 1.1.20.1 mjf (GPIO_ICR_LEVEL_HIGH << (2*IST_LEVEL_HIGH)) | \
164 1.1.20.1 mjf (GPIO_ICR_EDGE_RISING << (2*IST_EDGE_RISING)) | \
165 1.1.20.1 mjf (GPIO_ICR_EDGE_FALLING << (2*IST_EDGE_FALLING)))
166 1.1.20.1 mjf
167 1.1.20.1 mjf void
168 1.1.20.1 mjf gpio_pic_establish_irq(struct pic_softc *pic, struct intrsource *is)
169 1.1.20.1 mjf {
170 1.1.20.1 mjf struct gpio_softc * const gpio = PIC_TO_SOFTC(pic);
171 1.1.20.1 mjf KASSERT(is->is_irq < 32);
172 1.1.20.1 mjf uint32_t irq_mask = __BIT(is->is_irq);
173 1.1.20.1 mjf uint32_t v;
174 1.1.20.1 mjf unsigned int icr_shift, icr_reg;
175 1.1.20.1 mjf unsigned int gtype;
176 1.1.20.1 mjf
177 1.1.20.1 mjf /*
178 1.1.20.1 mjf * Make sure the irq isn't enabled and not asserting.
179 1.1.20.1 mjf */
180 1.1.20.1 mjf gpio->gpio_enable_mask &= ~irq_mask;
181 1.1.20.1 mjf GPIO_WRITE(gpio, GPIO_IMR, gpio->gpio_enable_mask);
182 1.1.20.1 mjf GPIO_WRITE(gpio, GPIO_ISR, irq_mask);
183 1.1.20.1 mjf
184 1.1.20.1 mjf /*
185 1.1.20.1 mjf * Convert the type to a gpio type and figure out which bits in what
186 1.1.20.1 mjf * register we have to tweak.
187 1.1.20.1 mjf */
188 1.1.20.1 mjf gtype = (GPIO_TYPEMAP >> (2 * is->is_type)) & 3;
189 1.1.20.1 mjf icr_shift = (is->is_irq & 0x0f) << 1;
190 1.1.20.1 mjf icr_reg = GPIO_ICR1 + ((is->is_irq & 0x10) >> 2);
191 1.1.20.1 mjf
192 1.1.20.1 mjf /*
193 1.1.20.1 mjf * Set the interrupt type.
194 1.1.20.1 mjf */
195 1.1.20.1 mjf v = GPIO_READ(gpio, icr_reg);
196 1.1.20.1 mjf v &= ~(3 << icr_shift);
197 1.1.20.1 mjf v |= gtype << icr_shift;
198 1.1.20.1 mjf GPIO_WRITE(gpio, icr_reg, v);
199 1.1.20.1 mjf
200 1.1.20.1 mjf /*
201 1.1.20.1 mjf * Mark it as input.
202 1.1.20.1 mjf */
203 1.1.20.1 mjf v = GPIO_READ(gpio, GPIO_DIR);
204 1.1.20.1 mjf v &= ~irq_mask;
205 1.1.20.1 mjf GPIO_WRITE(gpio, GPIO_DIR, v);
206 1.1.20.1 mjf
207 1.1.20.1 mjf /*
208 1.1.20.1 mjf * Now record the type of interrupt.
209 1.1.20.1 mjf */
210 1.1.20.1 mjf if (gtype == GPIO_ICR_EDGE_RISING || gtype == GPIO_ICR_EDGE_FALLING) {
211 1.1.20.1 mjf gpio->gpio_edge_mask |= irq_mask;
212 1.1.20.1 mjf gpio->gpio_level_mask &= ~irq_mask;
213 1.1.20.1 mjf } else {
214 1.1.20.1 mjf gpio->gpio_edge_mask &= ~irq_mask;
215 1.1.20.1 mjf gpio->gpio_level_mask |= irq_mask;
216 1.1.20.1 mjf }
217 1.1.20.1 mjf }
218 1.1.20.1 mjf
219 1.1.20.1 mjf static int gpio_match(device_t, cfdata_t, void *);
220 1.1.20.1 mjf static void gpio_attach(device_t, device_t, void *);
221 1.1.20.1 mjf
222 1.1.20.1 mjf CFATTACH_DECL(imxgpio,
223 1.1.20.1 mjf sizeof(struct gpio_softc),
224 1.1.20.1 mjf gpio_match, gpio_attach,
225 1.1.20.1 mjf NULL, NULL);
226 1.1.20.1 mjf
227 1.1.20.1 mjf #if NGPIO > 0
228 1.1.20.1 mjf
229 1.1.20.1 mjf static int
230 1.1.20.1 mjf imxgpio_pin_read(void *arg, int pin)
231 1.1.20.1 mjf {
232 1.1.20.1 mjf struct gpio_softc * const gpio = arg;
233 1.1.20.1 mjf
234 1.1.20.1 mjf return (GPIO_READ(gpio, GPIO_DR) >> pin) & 1;
235 1.1.20.1 mjf }
236 1.1.20.1 mjf
237 1.1.20.1 mjf static void
238 1.1.20.1 mjf imxgpio_pin_write(void *arg, int pin, int value)
239 1.1.20.1 mjf {
240 1.1.20.1 mjf struct gpio_softc * const gpio = arg;
241 1.1.20.1 mjf uint32_t mask = 1 << pin;
242 1.1.20.1 mjf uint32_t old, new;
243 1.1.20.1 mjf
244 1.1.20.1 mjf old = GPIO_READ(gpio, GPIO_DR);
245 1.1.20.1 mjf if (value)
246 1.1.20.1 mjf new = old | mask;
247 1.1.20.1 mjf else
248 1.1.20.1 mjf new = old & ~mask;
249 1.1.20.1 mjf
250 1.1.20.1 mjf if (old != new)
251 1.1.20.1 mjf GPIO_WRITE(gpio, GPIO_DR, new);
252 1.1.20.1 mjf }
253 1.1.20.1 mjf
254 1.1.20.1 mjf static void
255 1.1.20.1 mjf imxgpio_pin_ctl(void *arg, int pin, int flags)
256 1.1.20.1 mjf {
257 1.1.20.1 mjf struct gpio_softc * const gpio = arg;
258 1.1.20.1 mjf uint32_t mask = 1 << pin;
259 1.1.20.1 mjf uint32_t old, new;
260 1.1.20.1 mjf
261 1.1.20.1 mjf old = GPIO_READ(gpio, GPIO_DIR);
262 1.1.20.1 mjf new = old;
263 1.1.20.1 mjf switch (flags & (GPIO_PIN_INPUT|GPIO_PIN_OUTPUT)) {
264 1.1.20.1 mjf case GPIO_PIN_INPUT: new |= mask; break;
265 1.1.20.1 mjf case GPIO_PIN_OUTPUT: new &= ~mask; break;
266 1.1.20.1 mjf default: return;
267 1.1.20.1 mjf }
268 1.1.20.1 mjf if (old != new)
269 1.1.20.1 mjf GPIO_WRITE(gpio, GPIO_DIR, new);
270 1.1.20.1 mjf }
271 1.1.20.1 mjf
272 1.1.20.1 mjf static void
273 1.1.20.1 mjf gpio_defer(device_t self)
274 1.1.20.1 mjf {
275 1.1.20.1 mjf struct gpio_softc * const gpio = (void *) self;
276 1.1.20.1 mjf struct gpio_chipset_tag * const gp = &gpio->gpio_chipset;
277 1.1.20.1 mjf struct gpiobus_attach_args gba;
278 1.1.20.1 mjf gpio_pin_t *pins;
279 1.1.20.1 mjf uint32_t mask, dir, value;
280 1.1.20.1 mjf int pin;
281 1.1.20.1 mjf
282 1.1.20.1 mjf gp->gp_cookie = gpio;
283 1.1.20.1 mjf gp->gp_pin_read = imxgpio_pin_read;
284 1.1.20.1 mjf gp->gp_pin_write = imxgpio_pin_write;
285 1.1.20.1 mjf gp->gp_pin_ctl = imxgpio_pin_ctl;
286 1.1.20.1 mjf
287 1.1.20.1 mjf gba.gba_gc = gp;
288 1.1.20.1 mjf gba.gba_pins = gpio->gpio_pins;
289 1.1.20.1 mjf gba.gba_npins = __arraycount(gpio->gpio_pins);
290 1.1.20.1 mjf
291 1.1.20.1 mjf dir = GPIO_READ(gpio, GPIO_DIR);
292 1.1.20.1 mjf value = GPIO_READ(gpio, GPIO_DR);
293 1.1.20.1 mjf for (pin = 0, mask = 1, pins = gpio->gpio_pins;
294 1.1.20.1 mjf pin < 32; pin++, mask <<= 1, pins++) {
295 1.1.20.1 mjf pins->pin_num = pin;
296 1.1.20.1 mjf if ((gpio->gpio_edge_mask|gpio->gpio_level_mask) & mask)
297 1.1.20.1 mjf pins->pin_caps = GPIO_PIN_INPUT;
298 1.1.20.1 mjf else
299 1.1.20.1 mjf pins->pin_caps = GPIO_PIN_INPUT|GPIO_PIN_OUTPUT;
300 1.1.20.1 mjf pins->pin_flags =
301 1.1.20.1 mjf (dir & mask) ? GPIO_PIN_OUTPUT : GPIO_PIN_INPUT;
302 1.1.20.1 mjf pins->pin_state =
303 1.1.20.1 mjf (value & mask) ? GPIO_PIN_HIGH : GPIO_PIN_LOW;
304 1.1.20.1 mjf }
305 1.1.20.1 mjf
306 1.1.20.1 mjf config_found_ia(self, "gpiobus", &gba, gpiobus_print);
307 1.1.20.1 mjf }
308 1.1.20.1 mjf #endif /* NGPIO > 0 */
309 1.1.20.1 mjf
310 1.1.20.1 mjf int
311 1.1.20.1 mjf gpio_match(device_t parent, cfdata_t cfdata, void *aux)
312 1.1.20.1 mjf {
313 1.1.20.1 mjf struct ahb_attach_args *ahba = aux;
314 1.1.20.1 mjf bus_space_handle_t memh;
315 1.1.20.1 mjf bus_size_t size;
316 1.1.20.1 mjf int error;
317 1.1.20.1 mjf
318 1.1.20.1 mjf if (ahba->ahba_addr != GPIO1_BASE
319 1.1.20.1 mjf && ahba->ahba_addr != GPIO2_BASE
320 1.1.20.1 mjf && ahba->ahba_addr != GPIO3_BASE)
321 1.1.20.1 mjf return 0;
322 1.1.20.1 mjf
323 1.1.20.1 mjf size = (ahba->ahba_size == AHBCF_SIZE_DEFAULT) ? GPIO_SIZE : ahba->ahba_size;
324 1.1.20.1 mjf
325 1.1.20.1 mjf error = bus_space_map(ahba->ahba_memt, ahba->ahba_addr, size, 0, &memh);
326 1.1.20.1 mjf if (error)
327 1.1.20.1 mjf return 0;
328 1.1.20.1 mjf
329 1.1.20.1 mjf bus_space_unmap(ahba->ahba_memt, memh, size);
330 1.1.20.1 mjf return 1;
331 1.1.20.1 mjf }
332 1.1.20.1 mjf
333 1.1.20.1 mjf void
334 1.1.20.1 mjf gpio_attach(device_t parent, device_t self, void *aux)
335 1.1.20.1 mjf {
336 1.1.20.1 mjf struct ahb_attach_args * const ahba = aux;
337 1.1.20.1 mjf struct gpio_softc * const gpio = (void *) self;
338 1.1.20.1 mjf int error;
339 1.1.20.1 mjf
340 1.1.20.1 mjf if (ahba->ahba_size == AHBCF_SIZE_DEFAULT)
341 1.1.20.1 mjf ahba->ahba_size = GPIO_SIZE;
342 1.1.20.1 mjf
343 1.1.20.1 mjf gpio->gpio_memt = ahba->ahba_memt;
344 1.1.20.1 mjf error = bus_space_map(ahba->ahba_memt, ahba->ahba_addr, ahba->ahba_size,
345 1.1.20.1 mjf 0, &gpio->gpio_memh);
346 1.1.20.1 mjf
347 1.1.20.1 mjf if (error) {
348 1.1.20.1 mjf aprint_error(": failed to map register %#lx@%#lx: %d\n",
349 1.1.20.1 mjf ahba->ahba_size, ahba->ahba_addr, error);
350 1.1.20.1 mjf return;
351 1.1.20.1 mjf }
352 1.1.20.1 mjf
353 1.1.20.1 mjf if (ahba->ahba_irqbase != AHBCF_IRQBASE_DEFAULT) {
354 1.1.20.1 mjf gpio->gpio_pic.pic_ops = &gpio_pic_ops;
355 1.1.20.1 mjf strlcpy(gpio->gpio_pic.pic_name, self->dv_xname,
356 1.1.20.1 mjf sizeof(gpio->gpio_pic.pic_name));
357 1.1.20.1 mjf gpio->gpio_pic.pic_maxsources = 32;
358 1.1.20.1 mjf pic_add(&gpio->gpio_pic, ahba->ahba_irqbase);
359 1.1.20.1 mjf aprint_normal(": interrupts %d..%d",
360 1.1.20.1 mjf ahba->ahba_irqbase, ahba->ahba_irqbase + 31);
361 1.1.20.1 mjf }
362 1.1.20.1 mjf aprint_normal("\n");
363 1.1.20.1 mjf #if NGPIO > 0
364 1.1.20.1 mjf config_interrupts(self, gpio_defer);
365 1.1.20.1 mjf #endif
366 1.1.20.1 mjf }
367