aboutsummaryrefslogtreecommitdiff
path: root/sys/arm/arm/pl310.c
diff options
context:
space:
mode:
authorOleksandr Tymoshenko <gonzo@FreeBSD.org>2015-04-02 03:25:35 +0000
committerOleksandr Tymoshenko <gonzo@FreeBSD.org>2015-04-02 03:25:35 +0000
commit0daa281ac00d93a00d9138819e6dd5795b7edc75 (patch)
tree3f53be5ede508ad9e7dca3f40d8abee95a13c1d8 /sys/arm/arm/pl310.c
parent076562d0a9414facad55104780fc621f3a305352 (diff)
downloadsrc-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/pl310.c')
-rw-r--r--sys/arm/arm/pl310.c21
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");
}