Lines Matching refs:msic

78 void axon_msi_debug_setup(struct device_node *dn, struct axon_msic *msic);
81 struct axon_msic *msic) { } in axon_msi_debug_setup() argument
85 static void msic_dcr_write(struct axon_msic *msic, unsigned int dcr_n, u32 val) in msic_dcr_write() argument
89 dcr_write(msic->dcr_host, dcr_n, val); in msic_dcr_write()
95 struct axon_msic *msic = irq_desc_get_handler_data(desc); in axon_msi_cascade() local
100 write_offset = dcr_read(msic->dcr_host, MSIC_WRITE_OFFSET_REG); in axon_msi_cascade()
106 while (msic->read_offset != write_offset && retry < 100) { in axon_msi_cascade()
107 idx = msic->read_offset / sizeof(__le32); in axon_msi_cascade()
108 msi = le32_to_cpu(msic->fifo_virt[idx]); in axon_msi_cascade()
112 write_offset, msic->read_offset, msi); in axon_msi_cascade()
114 if (msi < nr_irqs && irq_get_chip_data(msi) == msic) { in axon_msi_cascade()
116 msic->fifo_virt[idx] = cpu_to_le32(0xffffffff); in axon_msi_cascade()
136 msic->read_offset += MSIC_FIFO_ENTRY_SIZE; in axon_msi_cascade()
137 msic->read_offset &= MSIC_FIFO_SIZE_MASK; in axon_msi_cascade()
143 msic->read_offset += MSIC_FIFO_ENTRY_SIZE; in axon_msi_cascade()
144 msic->read_offset &= MSIC_FIFO_SIZE_MASK; in axon_msi_cascade()
155 struct axon_msic *msic = NULL; in find_msi_translator() local
191 msic = irq_domain->host_data; in find_msi_translator()
196 return msic; in find_msi_translator()
258 struct axon_msic *msic; in axon_msi_setup_msi_irqs() local
260 msic = find_msi_translator(dev); in axon_msi_setup_msi_irqs()
261 if (!msic) in axon_msi_setup_msi_irqs()
269 virq = irq_create_direct_mapping(msic->irq_domain); in axon_msi_setup_msi_irqs()
322 struct axon_msic *msic = dev_get_drvdata(&device->dev); in axon_msi_shutdown() local
326 irq_domain_get_of_node(msic->irq_domain)); in axon_msi_shutdown()
327 tmp = dcr_read(msic->dcr_host, MSIC_CTRL_REG); in axon_msi_shutdown()
329 msic_dcr_write(msic, MSIC_CTRL_REG, tmp); in axon_msi_shutdown()
335 struct axon_msic *msic; in axon_msi_probe() local
341 msic = kzalloc(sizeof(*msic), GFP_KERNEL); in axon_msi_probe()
342 if (!msic) { in axon_msi_probe()
358 msic->dcr_host = dcr_map(dn, dcr_base, dcr_len); in axon_msi_probe()
359 if (!DCR_MAP_OK(msic->dcr_host)) { in axon_msi_probe()
365 msic->fifo_virt = dma_alloc_coherent(&device->dev, MSIC_FIFO_SIZE_BYTES, in axon_msi_probe()
366 &msic->fifo_phys, GFP_KERNEL); in axon_msi_probe()
367 if (!msic->fifo_virt) { in axon_msi_probe()
379 memset(msic->fifo_virt, 0xff, MSIC_FIFO_SIZE_BYTES); in axon_msi_probe()
382 msic->irq_domain = irq_domain_add_nomap(dn, 65536, &msic_host_ops, msic); in axon_msi_probe()
383 if (!msic->irq_domain) { in axon_msi_probe()
389 irq_set_handler_data(virq, msic); in axon_msi_probe()
394 msic_dcr_write(msic, MSIC_BASE_ADDR_HI_REG, msic->fifo_phys >> 32); in axon_msi_probe()
395 msic_dcr_write(msic, MSIC_BASE_ADDR_LO_REG, in axon_msi_probe()
396 msic->fifo_phys & 0xFFFFFFFF); in axon_msi_probe()
397 msic_dcr_write(msic, MSIC_CTRL_REG, in axon_msi_probe()
401 msic->read_offset = dcr_read(msic->dcr_host, MSIC_WRITE_OFFSET_REG) in axon_msi_probe()
404 dev_set_drvdata(&device->dev, msic); in axon_msi_probe()
409 axon_msi_debug_setup(dn, msic); in axon_msi_probe()
416 dma_free_coherent(&device->dev, MSIC_FIFO_SIZE_BYTES, msic->fifo_virt, in axon_msi_probe()
417 msic->fifo_phys); in axon_msi_probe()
419 kfree(msic); in axon_msi_probe()
451 struct axon_msic *msic = data; in msic_set() local
452 out_le32(msic->trigger, val); in msic_set()
464 void axon_msi_debug_setup(struct device_node *dn, struct axon_msic *msic) in axon_msi_debug_setup() argument
475 msic->trigger = ioremap(addr, 0x4); in axon_msi_debug_setup()
476 if (!msic->trigger) { in axon_msi_debug_setup()
483 debugfs_create_file(name, 0600, powerpc_debugfs_root, msic, &fops_msic); in axon_msi_debug_setup()