diff options
author | imp <imp@FreeBSD.org> | 2012-07-12 02:58:45 +0000 |
---|---|---|
committer | imp <imp@FreeBSD.org> | 2012-07-12 02:58:45 +0000 |
commit | 8cc7a49b9609578a34b73a544be8d8cd3b7faacf (patch) | |
tree | 41072dce977d30d8360565a0d526330e42067f71 /sys/arm/at91/at91sam9g20.c | |
parent | a32f7c6c144e4a515379e6f4ec89a48a4e50f8b2 (diff) | |
download | FreeBSD-src-8cc7a49b9609578a34b73a544be8d8cd3b7faacf.zip FreeBSD-src-8cc7a49b9609578a34b73a544be8d8cd3b7faacf.tar.gz |
Export the interrupt status vector via soc_data. Set the interrupt
priorities in the AIC in the atmelarm driver before attaching the
children. Delete redunant copies of the code.
Diffstat (limited to 'sys/arm/at91/at91sam9g20.c')
-rw-r--r-- | sys/arm/at91/at91sam9g20.c | 41 |
1 files changed, 3 insertions, 38 deletions
diff --git a/sys/arm/at91/at91sam9g20.c b/sys/arm/at91/at91sam9g20.c index 4b87ad0..905d0ea 100644 --- a/sys/arm/at91/at91sam9g20.c +++ b/sys/arm/at91/at91sam9g20.c @@ -51,8 +51,6 @@ struct at91sam9_softc { device_t dev; bus_space_tag_t sc_st; bus_space_handle_t sc_sh; - bus_space_handle_t sc_sys_sh; - bus_space_handle_t sc_aic_sh; bus_space_handle_t sc_matrix_sh; }; @@ -191,47 +189,13 @@ at91_attach(device_t dev) { struct at91_pmc_clock *clk; struct at91sam9_softc *sc = device_get_softc(dev); - int i; - struct at91_softc *at91sc = device_get_softc(device_get_parent(dev)); + uint32_t i; sc->sc_st = at91sc->sc_st; sc->sc_sh = at91sc->sc_sh; sc->dev = dev; - /* - * XXX These values work for the RM9200, SAM926[01], and SAM9G20 - * will have to fix this when we want to support anything else. XXX - */ - if (bus_space_subregion(sc->sc_st, sc->sc_sh, AT91SAM9G20_SYS_BASE, - AT91SAM9G20_SYS_SIZE, &sc->sc_sys_sh) != 0) - panic("Enable to map system registers"); - - if (bus_space_subregion(sc->sc_st, sc->sc_sh, AT91SAM9G20_AIC_BASE, - AT91SAM9G20_AIC_SIZE, &sc->sc_aic_sh) != 0) - panic("Enable to map system registers"); - - /* XXX Hack to tell atmelarm about the AIC */ - at91sc->sc_aic_sh = sc->sc_aic_sh; - - for (i = 0; i < 32; i++) { - bus_space_write_4(sc->sc_st, sc->sc_aic_sh, IC_SVR + - i * 4, i); - /* Priority. */ - bus_space_write_4(sc->sc_st, sc->sc_aic_sh, IC_SMR + i * 4, - at91_irq_prio[i]); - if (i < 8) - bus_space_write_4(sc->sc_st, sc->sc_aic_sh, IC_EOICR, - 1); - } - - bus_space_write_4(sc->sc_st, sc->sc_aic_sh, IC_SPU, 32); - /* No debug. */ - bus_space_write_4(sc->sc_st, sc->sc_aic_sh, IC_DCR, 0); - /* Disable and clear all interrupts. */ - bus_space_write_4(sc->sc_st, sc->sc_aic_sh, IC_IDCR, 0xffffffff); - bus_space_write_4(sc->sc_st, sc->sc_aic_sh, IC_ICCR, 0xffffffff); - if (bus_space_subregion(sc->sc_st, sc->sc_sh, AT91SAM9G20_MATRIX_BASE, AT91SAM9G20_MATRIX_SIZE, &sc->sc_matrix_sh) != 0) @@ -301,7 +265,8 @@ DRIVER_MODULE(at91sam, atmelarm, at91sam9_driver, at91sam9_devclass, 0, 0); static struct at91_soc_data soc_data = { .soc_delay = at91_pit_delay, - .soc_reset = at91_rst_cpu_reset + .soc_reset = at91_rst_cpu_reset, + .soc_irq_prio = at91_irq_prio, }; AT91_SOC(AT91_T_SAM9G20, &soc_data); |