From 5ebc699ab26633a23c4c6d2b85aba67457df996a Mon Sep 17 00:00:00 2001 From: Oleksandr Tymoshenko Date: Wed, 2 May 2018 20:04:25 +0000 Subject: [PATCH] Unbreak RaspberryPi 2 boot after r332839 r332839 changed number of cells per interrupt for local_intc from 1 to 2 to pass type of IRQ. Driver expected only 1 cell so after r332839 all interrupt children of local_intc failed to allocate IRQ resource. Fix this regression by relaxing check for number of cells in interrupt property to be either 1 or 2. PR: 227904 --- sys/arm/broadcom/bcm2835/bcm2836.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sys/arm/broadcom/bcm2835/bcm2836.c b/sys/arm/broadcom/bcm2835/bcm2836.c index f78305b154e1..15febf8811bf 100644 --- a/sys/arm/broadcom/bcm2835/bcm2836.c +++ b/sys/arm/broadcom/bcm2835/bcm2836.c @@ -454,9 +454,11 @@ bcm_lintc_map_intr(device_t dev, struct intr_map_data *data, return (ENOTSUP); daf = (struct intr_map_data_fdt *)data; - if (daf->ncells != 1 || daf->cells[0] >= BCM_LINTC_NIRQS) + if (daf->ncells > 2 || daf->cells[0] >= BCM_LINTC_NIRQS) return (EINVAL); + /* TODO: handle IRQ type here */ + sc = device_get_softc(dev); *isrcp = &sc->bls_isrcs[daf->cells[0]].bli_isrc; return (0);