diff options
author | Oleksandr Tymoshenko <gonzo@FreeBSD.org> | 2015-04-02 03:25:35 +0000 |
---|---|---|
committer | Oleksandr Tymoshenko <gonzo@FreeBSD.org> | 2015-04-02 03:25:35 +0000 |
commit | 0daa281ac00d93a00d9138819e6dd5795b7edc75 (patch) | |
tree | 3f53be5ede508ad9e7dca3f40d8abee95a13c1d8 /sys/arm/arm | |
parent | 076562d0a9414facad55104780fc621f3a305352 (diff) | |
download | src-0daa281ac00d93a00d9138819e6dd5795b7edc75.tar.gz src-0daa281ac00d93a00d9138819e6dd5795b7edc75.zip |
- Make interrupt resource optional: some upstream FDT blobs (e.g. TI's) do
not have interupt property in pl310 node. Interrupt is used only to
detect cache activity when L2 cache is disabled, it's not vital for
normal operations.
- Fix intrhook allocation/initialization
Notes
Notes:
svn path=/head/; revision=280979
Diffstat (limited to 'sys/arm/arm')
-rw-r--r-- | sys/arm/arm/pl310.c | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/sys/arm/arm/pl310.c b/sys/arm/arm/pl310.c index b354bf886871..3305f35c80f8 100644 --- a/sys/arm/arm/pl310.c +++ b/sys/arm/arm/pl310.c @@ -420,6 +420,7 @@ pl310_config_intr(void *arg) config_intrhook_disestablish(sc->sc_ich); free(sc->sc_ich, M_DEVBUF); + sc->sc_ich = NULL; } static int @@ -453,7 +454,7 @@ pl310_attach(device_t dev) sc->sc_irq_res = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, RF_ACTIVE | RF_SHAREABLE); if (sc->sc_irq_res == NULL) { - panic("Cannot allocate IRQ\n"); + device_printf(dev, "cannot allocate IRQ, not using interrupt\n"); } pl310_softc = sc; @@ -505,14 +506,18 @@ pl310_attach(device_t dev) if (bootverbose) pl310_print_config(sc); } else { - malloc(sizeof(*sc->sc_ich), M_DEVBUF, M_WAITOK); - sc->sc_ich->ich_func = pl310_config_intr; - sc->sc_ich->ich_arg = sc; - if (config_intrhook_establish(sc->sc_ich) != 0) { - device_printf(dev, - "config_intrhook_establish failed\n"); - return(ENXIO); + if (sc->sc_irq_res != NULL) { + sc->sc_ich = malloc(sizeof(*sc->sc_ich), M_DEVBUF, M_WAITOK); + sc->sc_ich->ich_func = pl310_config_intr; + sc->sc_ich->ich_arg = sc; + if (config_intrhook_establish(sc->sc_ich) != 0) { + device_printf(dev, + "config_intrhook_establish failed\n"); + free(sc->sc_ich, M_DEVBUF); + return(ENXIO); + } } + device_printf(dev, "L2 Cache disabled\n"); } |