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
This commit is contained in:
Olivier Houchard 2008-04-20 23:29:06 +00:00
parent 6935a973da
commit e19357d3a5
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=178366
3 changed files with 14 additions and 1 deletions

View File

@ -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;

View File

@ -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),

View File

@ -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 */