diff options
author | Jonathan Gray <jsg@cvs.openbsd.org> | 2019-10-11 15:12:44 +0000 |
---|---|---|
committer | Jonathan Gray <jsg@cvs.openbsd.org> | 2019-10-11 15:12:44 +0000 |
commit | 3766222f575812c2126c8b3a875094736dce810a (patch) | |
tree | c4e42f0dcd52fd9229aee30e2395c28ad6b24f19 /sys/arch/arm64 | |
parent | a8a2cfb2bfd3d69cedbeb25d0f08b2749fc01bd8 (diff) |
When available use "interrupt-names" to select the fdt idx for dwctwo
interrupt. Required after the dts included with raspberry pi firmware
changed from using idx 1 to idx 0 when introducing "interrupt-names".
Fixes USB devices not probing reported by dtucker@
ok kettenis@ patrick@ deraadt@
Diffstat (limited to 'sys/arch/arm64')
-rw-r--r-- | sys/arch/arm64/dev/bcm2835_dwctwo.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/sys/arch/arm64/dev/bcm2835_dwctwo.c b/sys/arch/arm64/dev/bcm2835_dwctwo.c index d6cfe61fd2a..83a572b6f06 100644 --- a/sys/arch/arm64/dev/bcm2835_dwctwo.c +++ b/sys/arch/arm64/dev/bcm2835_dwctwo.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bcm2835_dwctwo.c,v 1.2 2017/02/22 04:39:30 jsg Exp $ */ +/* $OpenBSD: bcm2835_dwctwo.c,v 1.3 2019/10/11 15:12:43 jsg Exp $ */ /* * Copyright (c) 2015 Masao Uebayashi <uebayasi@tombiinc.com> * @@ -98,6 +98,7 @@ bcm_dwctwo_attach(struct device *parent, struct device *self, void *aux) { struct bcm_dwctwo_softc *sc = (struct bcm_dwctwo_softc *)self; struct fdt_attach_args *faa = aux; + int idx; printf("\n"); @@ -110,7 +111,11 @@ bcm_dwctwo_attach(struct device *parent, struct device *self, void *aux) faa->fa_reg[0].size, 0, &sc->sc_dwc2.sc_ioh)) panic("%s: bus_space_map failed!", __func__); - sc->sc_ih = arm_intr_establish_fdt_idx(faa->fa_node, 1, IPL_USB, + idx = OF_getindex(faa->fa_node, "usb", "interrupt-names"); + if (idx == -1) + idx = 1; + + sc->sc_ih = arm_intr_establish_fdt_idx(faa->fa_node, idx, IPL_USB, dwc2_intr, (void *)&sc->sc_dwc2, sc->sc_dwc2.sc_bus.bdev.dv_xname); if (sc->sc_ih == NULL) panic("%s: intr_establish failed!", __func__); |