Index: sys/arm/arm/gic.c =================================================================== --- sys/arm/arm/gic.c +++ sys/arm/arm/gic.c @@ -835,6 +835,26 @@ #endif static int +gic_map_msi(device_t dev, struct intr_map_data_msi *msi_data, u_int *irqp, + enum intr_polarity *polp, enum intr_trigger *trigp) +{ + struct gic_irqsrc *gi; + + /* Map a non-GICv2m MSI */ + gi = (struct gic_irqsrc *)msi_data->isrc; + if (gi == NULL) + return (ENXIO); + + *irqp = gi->gi_irq; + + /* MSI/MSI-X interrupts are always edge triggered with high polarity */ + *polp = INTR_POLARITY_HIGH; + *trigp = INTR_TRIGGER_EDGE; + + return (0); +} + +static int gic_map_intr(device_t dev, struct intr_map_data *data, u_int *irqp, enum intr_polarity *polp, enum intr_trigger *trigp) { @@ -842,6 +862,7 @@ enum intr_polarity pol; enum intr_trigger trig; struct arm_gic_softc *sc; + struct intr_map_data_msi *dam; #ifdef FDT struct intr_map_data_fdt *daf; #endif @@ -860,6 +881,12 @@ __func__)); break; #endif + case INTR_MAP_DATA_MSI: + /* Non-GICv2m MSI */ + dam = (struct intr_map_data_msi *)data; + if (gic_map_msi(dev, dam, &irq, &pol, &trig) != 0) + return (EINVAL); + break; default: return (ENOTSUP); } @@ -907,6 +934,7 @@ enum intr_polarity pol; if ((gi->gi_flags & GI_FLAG_MSI) == GI_FLAG_MSI) { + /* GICv2m MSI */ pol = gi->gi_pol; trig = gi->gi_trig; KASSERT(pol == INTR_POLARITY_HIGH,