summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorcognet <cognet@FreeBSD.org>2008-04-20 23:29:06 +0000
committercognet <cognet@FreeBSD.org>2008-04-20 23:29:06 +0000
commit19c46f4f03d6363bbbe6543e3f4c0fe81f6f3da5 (patch)
treea7483fc0d443624328312a9aa05b50fff4886c2d /sys
parent0249d0d19634037595dbe5b78038a214689c0f96 (diff)
downloadFreeBSD-src-19c46f4f03d6363bbbe6543e3f4c0fe81f6f3da5.zip
FreeBSD-src-19c46f4f03d6363bbbe6543e3f4c0fe81f6f3da5.tar.gz
On the AT91, we need to write on the EOI register after we handle an
interrupt. So, add a new function pointer, arm_post_filter, which defaults to NULL, and which will be used as the post_filter arg for intr_event_create(). Set it properly for the AT91, so that it boots again. Reported by: hps
Diffstat (limited to 'sys')
-rw-r--r--sys/arm/arm/intr.c4
-rw-r--r--sys/arm/at91/at91.c10
-rw-r--r--sys/arm/include/intr.h1
3 files changed, 14 insertions, 1 deletions
diff --git a/sys/arm/arm/intr.c b/sys/arm/arm/intr.c
index ba30bef..edbf47c 100644
--- a/sys/arm/arm/intr.c
+++ b/sys/arm/arm/intr.c
@@ -59,6 +59,8 @@ static int last_printed = 0;
void arm_handler_execute(struct trapframe *, int);
+void (*arm_post_filter)(void *) = NULL;
+
void
arm_setup_irqhandler(const char *name, driver_filter_t *filt,
void (*hand)(void*), void *arg, int irq, int flags, void **cookiep)
@@ -72,7 +74,7 @@ arm_setup_irqhandler(const char *name, driver_filter_t *filt,
if (event == NULL) {
error = intr_event_create(&event, (void *)irq, 0, irq,
(mask_fn)arm_mask_irq, (mask_fn)arm_unmask_irq,
- NULL, NULL, "intr%d:", irq);
+ arm_post_filter, NULL, "intr%d:", irq);
if (error)
return;
intr_events[irq] = event;
diff --git a/sys/arm/at91/at91.c b/sys/arm/at91/at91.c
index 00d5c91..246f73a 100644
--- a/sys/arm/at91/at91.c
+++ b/sys/arm/at91/at91.c
@@ -47,6 +47,8 @@ __FBSDID("$FreeBSD$");
static struct at91_softc *at91_softc;
+static void at91_eoi(void *);
+
static int
at91_bs_map(void *t, bus_addr_t bpa, bus_size_t size, int flags,
bus_space_handle_t *bshp)
@@ -172,6 +174,7 @@ static int
at91_probe(device_t dev)
{
device_set_desc(dev, "AT91 device bus");
+ arm_post_filter = at91_eoi;
return (0);
}
@@ -689,6 +692,13 @@ arm_unmask_irq(uintptr_t nb)
}
+static void
+at91_eoi(void *unused)
+{
+ bus_space_write_4(at91_softc->sc_st, at91_softc->sc_sys_sh,
+ IC_EOICR, 0);
+}
+
static device_method_t at91_methods[] = {
DEVMETHOD(device_probe, at91_probe),
DEVMETHOD(device_attach, at91_attach),
diff --git a/sys/arm/include/intr.h b/sys/arm/include/intr.h
index 2edb428..a252a92 100644
--- a/sys/arm/include/intr.h
+++ b/sys/arm/include/intr.h
@@ -55,4 +55,5 @@ void arm_unmask_irq(uintptr_t);
void arm_setup_irqhandler(const char *, int (*)(void*), void (*)(void*),
void *, int, int, void **);
int arm_remove_irqhandler(void *);
+extern void (*arm_post_filter)(void *);
#endif /* _MACHINE_INTR_H */
OpenPOWER on IntegriCloud