Lines Matching +full:firmware +full:- +full:initialized
1 /*-
2 * SPDX-License-Identifier: BSD-2-Clause
47 #include <dt-bindings/interrupt-controller/irq.h>
84 bool initialized; member
90 { -1, 0 }
94 {"marvell,cp110-icu-nsr", ICU_TYPE_NSR},
95 {"marvell,cp110-icu-sei", ICU_TYPE_SEI},
99 #define RD4(sc, reg) bus_read_4((sc)->res, (reg))
100 #define WR4(sc, reg, val) bus_write_4((sc)->res, (reg), (val))
109 if (ofw_bus_search_compatible(dev, compat_data)->ocd_data == 0) in mv_cp110_icu_probe()
125 sc->dev = dev; in mv_cp110_icu_attach()
127 sc->type = (int)ofw_bus_search_compatible(dev, compat_data)->ocd_data; in mv_cp110_icu_attach()
128 sc->initialized = false; in mv_cp110_icu_attach()
130 if (OF_getencprop(node, "msi-parent", &msi_parent, in mv_cp110_icu_attach()
132 device_printf(dev, "cannot find msi-parent property\n"); in mv_cp110_icu_attach()
136 if ((sc->parent = OF_device_from_xref(msi_parent)) == NULL) { in mv_cp110_icu_attach()
137 device_printf(dev, "cannot find msi-parent device\n"); in mv_cp110_icu_attach()
140 if (bus_alloc_resources(dev, mv_cp110_icu_res_spec, &sc->res) != 0) { in mv_cp110_icu_attach()
151 sc->parent_map_data = (struct intr_map_data_fdt *)intr_alloc_map_data( in mv_cp110_icu_attach()
155 /* Clear any previous mapping done by firmware. */ in mv_cp110_icu_attach()
167 bus_release_resources(dev, mv_cp110_icu_res_spec, &sc->res); in mv_cp110_icu_attach()
178 if (daf->ncells != 2) in mv_cp110_icu_convert_map_data()
181 irq_no = daf->cells[0]; in mv_cp110_icu_convert_map_data()
185 irq_type = daf->cells[1]; in mv_cp110_icu_convert_map_data()
190 /* ICU -> GICP/SEI mapping is set in mv_cp110_icu_map_intr. */ in mv_cp110_icu_convert_map_data()
194 sc->parent_map_data->ncells = 2; in mv_cp110_icu_convert_map_data()
195 sc->parent_map_data->cells[0] = reg & ICU_INT_MASK; in mv_cp110_icu_convert_map_data()
196 sc->parent_map_data->cells[1] = irq_type; in mv_cp110_icu_convert_map_data()
198 return ((struct intr_map_data *)sc->parent_map_data); in mv_cp110_icu_convert_map_data()
218 return (PIC_ACTIVATE_INTR(sc->parent, isrc, res, data)); in mv_cp110_icu_activate_intr()
227 PIC_ENABLE_INTR(sc->parent, isrc); in mv_cp110_icu_enable_intr()
237 PIC_DISABLE_INTR(sc->parent, isrc); in mv_cp110_icu_disable_intr()
244 if (sc->initialized) in mv_cp110_icu_init()
247 switch (sc->type) { in mv_cp110_icu_init()
263 sc->initialized = true; in mv_cp110_icu_init()
278 if (data->type != INTR_MAP_DATA_FDT) in mv_cp110_icu_map_intr()
283 if (daf->ncells != 2) in mv_cp110_icu_map_intr()
286 irq_no = daf->cells[0]; in mv_cp110_icu_map_intr()
290 irq_type = daf->cells[1]; in mv_cp110_icu_map_intr()
300 ret = MSI_ALLOC_MSI(sc->parent, dev, 1, 1, NULL, isrcp); in mv_cp110_icu_map_intr()
304 ret = MSI_MAP_MSI(sc->parent, dev, *isrcp, &addr, &vector); in mv_cp110_icu_map_intr()
311 if (sc->type == ICU_TYPE_NSR) in mv_cp110_icu_map_intr()
333 (*isrcp)->isrc_dev = sc->dev; in mv_cp110_icu_map_intr()
338 MSI_RELEASE_MSI(sc->parent, dev, 1, isrcp); in mv_cp110_icu_map_intr()
351 if (data->type != INTR_MAP_DATA_FDT) in mv_cp110_icu_deactivate_intr()
356 if (daf->ncells != 2) in mv_cp110_icu_deactivate_intr()
359 irq_no = daf->cells[0]; in mv_cp110_icu_deactivate_intr()
367 ret = PIC_DEACTIVATE_INTR(sc->parent, isrc, res, data); in mv_cp110_icu_deactivate_intr()
371 return (MSI_RELEASE_MSI(sc->parent, dev, 1, &isrc)); in mv_cp110_icu_deactivate_intr()
385 return (PIC_SETUP_INTR(sc->parent, isrc, res, data)); in mv_cp110_icu_setup_intr()
399 return (PIC_TEARDOWN_INTR(sc->parent, isrc, res, data)); in mv_cp110_icu_teardown_intr()
409 PIC_PRE_ITHREAD(sc->parent, isrc); in mv_cp110_icu_pre_ithread()
419 PIC_POST_ITHREAD(sc->parent, isrc); in mv_cp110_icu_post_ithread()
429 PIC_POST_FILTER(sc->parent, isrc); in mv_cp110_icu_post_filter()