Lines Matching refs:sei
58 struct mvebu_sei *sei = irq_data_get_irq_chip_data(d); in mvebu_sei_ack_irq() local
62 sei->base + GICP_SECR(reg_idx)); in mvebu_sei_ack_irq()
67 struct mvebu_sei *sei = irq_data_get_irq_chip_data(d); in mvebu_sei_mask_irq() local
72 raw_spin_lock_irqsave(&sei->mask_lock, flags); in mvebu_sei_mask_irq()
73 reg = readl_relaxed(sei->base + GICP_SEMR(reg_idx)); in mvebu_sei_mask_irq()
75 writel_relaxed(reg, sei->base + GICP_SEMR(reg_idx)); in mvebu_sei_mask_irq()
76 raw_spin_unlock_irqrestore(&sei->mask_lock, flags); in mvebu_sei_mask_irq()
81 struct mvebu_sei *sei = irq_data_get_irq_chip_data(d); in mvebu_sei_unmask_irq() local
86 raw_spin_lock_irqsave(&sei->mask_lock, flags); in mvebu_sei_unmask_irq()
87 reg = readl_relaxed(sei->base + GICP_SEMR(reg_idx)); in mvebu_sei_unmask_irq()
89 writel_relaxed(reg, sei->base + GICP_SEMR(reg_idx)); in mvebu_sei_unmask_irq()
90 raw_spin_unlock_irqrestore(&sei->mask_lock, flags); in mvebu_sei_unmask_irq()
141 struct mvebu_sei *sei = data->chip_data; in mvebu_sei_cp_compose_msi_msg() local
142 phys_addr_t set = sei->res->start + GICP_SET_SEI_OFFSET; in mvebu_sei_cp_compose_msi_msg()
144 msg->data = data->hwirq + sei->caps->cp_range.first; in mvebu_sei_cp_compose_msi_msg()
170 struct mvebu_sei *sei = domain->host_data; in mvebu_sei_domain_alloc() local
175 &mvebu_sei_irq_chip, sei); in mvebu_sei_domain_alloc()
211 struct mvebu_sei *sei = domain->host_data; in mvebu_sei_ap_alloc() local
221 fwspec.param[0] = hwirq + sei->caps->ap_range.first; in mvebu_sei_ap_alloc()
228 &mvebu_sei_ap_irq_chip, sei, in mvebu_sei_ap_alloc()
241 static void mvebu_sei_cp_release_irq(struct mvebu_sei *sei, unsigned long hwirq) in mvebu_sei_cp_release_irq() argument
243 mutex_lock(&sei->cp_msi_lock); in mvebu_sei_cp_release_irq()
244 clear_bit(hwirq, sei->cp_msi_bitmap); in mvebu_sei_cp_release_irq()
245 mutex_unlock(&sei->cp_msi_lock); in mvebu_sei_cp_release_irq()
252 struct mvebu_sei *sei = domain->host_data; in mvebu_sei_cp_domain_alloc() local
261 mutex_lock(&sei->cp_msi_lock); in mvebu_sei_cp_domain_alloc()
262 hwirq = find_first_zero_bit(sei->cp_msi_bitmap, in mvebu_sei_cp_domain_alloc()
263 sei->caps->cp_range.size); in mvebu_sei_cp_domain_alloc()
264 if (hwirq < sei->caps->cp_range.size) in mvebu_sei_cp_domain_alloc()
265 set_bit(hwirq, sei->cp_msi_bitmap); in mvebu_sei_cp_domain_alloc()
266 mutex_unlock(&sei->cp_msi_lock); in mvebu_sei_cp_domain_alloc()
268 if (hwirq == sei->caps->cp_range.size) in mvebu_sei_cp_domain_alloc()
273 fwspec.param[0] = hwirq + sei->caps->cp_range.first; in mvebu_sei_cp_domain_alloc()
280 &mvebu_sei_cp_irq_chip, sei, in mvebu_sei_cp_domain_alloc()
286 mvebu_sei_cp_release_irq(sei, hwirq); in mvebu_sei_cp_domain_alloc()
293 struct mvebu_sei *sei = domain->host_data; in mvebu_sei_cp_domain_free() local
296 if (nr_irqs != 1 || d->hwirq >= sei->caps->cp_range.size) { in mvebu_sei_cp_domain_free()
297 dev_err(sei->dev, "Invalid hwirq %lu\n", d->hwirq); in mvebu_sei_cp_domain_free()
301 mvebu_sei_cp_release_irq(sei, d->hwirq); in mvebu_sei_cp_domain_free()
327 struct mvebu_sei *sei = irq_desc_get_handler_data(desc); in mvebu_sei_handle_cascade_irq() local
337 irqmap = readl_relaxed(sei->base + GICP_SECR(idx)); in mvebu_sei_handle_cascade_irq()
343 virq = irq_find_mapping(sei->sei_domain, hwirq); in mvebu_sei_handle_cascade_irq()
349 dev_warn(sei->dev, in mvebu_sei_handle_cascade_irq()
357 static void mvebu_sei_reset(struct mvebu_sei *sei) in mvebu_sei_reset() argument
363 writel_relaxed(0xFFFFFFFF, sei->base + GICP_SECR(reg_idx)); in mvebu_sei_reset()
364 writel_relaxed(0xFFFFFFFF, sei->base + GICP_SEMR(reg_idx)); in mvebu_sei_reset()
372 struct mvebu_sei *sei; in mvebu_sei_probe() local
376 sei = devm_kzalloc(&pdev->dev, sizeof(*sei), GFP_KERNEL); in mvebu_sei_probe()
377 if (!sei) in mvebu_sei_probe()
380 sei->dev = &pdev->dev; in mvebu_sei_probe()
382 mutex_init(&sei->cp_msi_lock); in mvebu_sei_probe()
383 raw_spin_lock_init(&sei->mask_lock); in mvebu_sei_probe()
385 sei->res = platform_get_resource(pdev, IORESOURCE_MEM, 0); in mvebu_sei_probe()
386 sei->base = devm_ioremap_resource(sei->dev, sei->res); in mvebu_sei_probe()
387 if (IS_ERR(sei->base)) { in mvebu_sei_probe()
388 dev_err(sei->dev, "Failed to remap SEI resource\n"); in mvebu_sei_probe()
389 return PTR_ERR(sei->base); in mvebu_sei_probe()
393 sei->caps = of_device_get_match_data(&pdev->dev); in mvebu_sei_probe()
394 if (!sei->caps) { in mvebu_sei_probe()
395 dev_err(sei->dev, in mvebu_sei_probe()
406 dev_err(sei->dev, "Failed to retrieve top-level SPI IRQ\n"); in mvebu_sei_probe()
411 sei->sei_domain = irq_domain_create_linear(of_node_to_fwnode(node), in mvebu_sei_probe()
412 (sei->caps->ap_range.size + in mvebu_sei_probe()
413 sei->caps->cp_range.size), in mvebu_sei_probe()
415 sei); in mvebu_sei_probe()
416 if (!sei->sei_domain) { in mvebu_sei_probe()
417 dev_err(sei->dev, "Failed to create SEI IRQ domain\n"); in mvebu_sei_probe()
422 irq_domain_update_bus_token(sei->sei_domain, DOMAIN_BUS_NEXUS); in mvebu_sei_probe()
425 sei->ap_domain = irq_domain_create_hierarchy(sei->sei_domain, 0, in mvebu_sei_probe()
426 sei->caps->ap_range.size, in mvebu_sei_probe()
429 sei); in mvebu_sei_probe()
430 if (!sei->ap_domain) { in mvebu_sei_probe()
431 dev_err(sei->dev, "Failed to create AP IRQ domain\n"); in mvebu_sei_probe()
436 irq_domain_update_bus_token(sei->ap_domain, DOMAIN_BUS_WIRED); in mvebu_sei_probe()
439 sei->cp_domain = irq_domain_create_hierarchy(sei->sei_domain, 0, in mvebu_sei_probe()
440 sei->caps->cp_range.size, in mvebu_sei_probe()
443 sei); in mvebu_sei_probe()
444 if (!sei->cp_domain) { in mvebu_sei_probe()
450 irq_domain_update_bus_token(sei->cp_domain, DOMAIN_BUS_GENERIC_MSI); in mvebu_sei_probe()
454 sei->cp_domain); in mvebu_sei_probe()
461 mvebu_sei_reset(sei); in mvebu_sei_probe()
465 sei); in mvebu_sei_probe()
470 irq_domain_remove(sei->cp_domain); in mvebu_sei_probe()
472 irq_domain_remove(sei->ap_domain); in mvebu_sei_probe()
474 irq_domain_remove(sei->sei_domain); in mvebu_sei_probe()