Lines Matching full:cd

101 	struct octeon_ciu_chip_data *cd;  in octeon_irq_set_ciu_mapping()  local
103 cd = kzalloc(sizeof(*cd), GFP_KERNEL); in octeon_irq_set_ciu_mapping()
104 if (!cd) in octeon_irq_set_ciu_mapping()
109 cd->line = line; in octeon_irq_set_ciu_mapping()
110 cd->bit = bit; in octeon_irq_set_ciu_mapping()
111 cd->gpio_line = gpio_line; in octeon_irq_set_ciu_mapping()
113 irq_set_chip_data(irq, cd); in octeon_irq_set_ciu_mapping()
121 struct octeon_ciu_chip_data *cd = irq_data_get_irq_chip_data(data); in octeon_irq_free_cd() local
124 kfree(cd); in octeon_irq_free_cd()
163 struct octeon_core_chip_data *cd = irq_data_get_irq_chip_data(data); in octeon_irq_core_ack() local
164 unsigned int bit = cd->bit; in octeon_irq_core_ack()
179 struct octeon_core_chip_data *cd = irq_data_get_irq_chip_data(data); in octeon_irq_core_eoi() local
186 set_c0_status(0x100 << cd->bit); in octeon_irq_core_eoi()
192 struct octeon_core_chip_data *cd = irq_data_get_irq_chip_data(data); in octeon_irq_core_set_enable_local() local
193 unsigned int mask = 0x100 << cd->bit; in octeon_irq_core_set_enable_local()
198 if (cd->desired_en) in octeon_irq_core_set_enable_local()
207 struct octeon_core_chip_data *cd = irq_data_get_irq_chip_data(data); in octeon_irq_core_disable() local
208 cd->desired_en = false; in octeon_irq_core_disable()
213 struct octeon_core_chip_data *cd = irq_data_get_irq_chip_data(data); in octeon_irq_core_enable() local
214 cd->desired_en = true; in octeon_irq_core_enable()
219 struct octeon_core_chip_data *cd = irq_data_get_irq_chip_data(data); in octeon_irq_core_bus_lock() local
221 mutex_lock(&cd->core_irq_mutex); in octeon_irq_core_bus_lock()
226 struct octeon_core_chip_data *cd = irq_data_get_irq_chip_data(data); in octeon_irq_core_bus_sync_unlock() local
228 if (cd->desired_en != cd->current_en) { in octeon_irq_core_bus_sync_unlock()
231 cd->current_en = cd->desired_en; in octeon_irq_core_bus_sync_unlock()
234 mutex_unlock(&cd->core_irq_mutex); in octeon_irq_core_bus_sync_unlock()
255 struct octeon_core_chip_data *cd; in octeon_irq_init_core() local
258 cd = &octeon_irq_core_chip_data[i]; in octeon_irq_init_core()
259 cd->current_en = false; in octeon_irq_init_core()
260 cd->desired_en = false; in octeon_irq_init_core()
261 cd->bit = i; in octeon_irq_init_core()
262 mutex_init(&cd->core_irq_mutex); in octeon_irq_init_core()
265 irq_set_chip_data(irq, cd); in octeon_irq_init_core()
278 struct octeon_ciu_chip_data *cd = irq_data_get_irq_chip_data(data); in next_cpu_for_irq() local
281 cpu = cd->current_cpu; in next_cpu_for_irq()
296 cd->current_cpu = cpu; in next_cpu_for_irq()
309 struct octeon_ciu_chip_data *cd; in octeon_irq_ciu_enable() local
312 cd = irq_data_get_irq_chip_data(data); in octeon_irq_ciu_enable()
315 if (cd->line == 0) { in octeon_irq_ciu_enable()
317 __set_bit(cd->bit, pen); in octeon_irq_ciu_enable()
326 __set_bit(cd->bit, pen); in octeon_irq_ciu_enable()
341 struct octeon_ciu_chip_data *cd; in octeon_irq_ciu_enable_local() local
344 cd = irq_data_get_irq_chip_data(data); in octeon_irq_ciu_enable_local()
347 if (cd->line == 0) { in octeon_irq_ciu_enable_local()
349 __set_bit(cd->bit, pen); in octeon_irq_ciu_enable_local()
358 __set_bit(cd->bit, pen); in octeon_irq_ciu_enable_local()
373 struct octeon_ciu_chip_data *cd; in octeon_irq_ciu_disable_local() local
376 cd = irq_data_get_irq_chip_data(data); in octeon_irq_ciu_disable_local()
379 if (cd->line == 0) { in octeon_irq_ciu_disable_local()
381 __clear_bit(cd->bit, pen); in octeon_irq_ciu_disable_local()
390 __clear_bit(cd->bit, pen); in octeon_irq_ciu_disable_local()
406 struct octeon_ciu_chip_data *cd; in octeon_irq_ciu_disable_all() local
409 cd = irq_data_get_irq_chip_data(data); in octeon_irq_ciu_disable_all()
414 if (cd->line == 0) in octeon_irq_ciu_disable_all()
420 __clear_bit(cd->bit, pen); in octeon_irq_ciu_disable_all()
426 if (cd->line == 0) in octeon_irq_ciu_disable_all()
439 struct octeon_ciu_chip_data *cd; in octeon_irq_ciu_enable_all() local
442 cd = irq_data_get_irq_chip_data(data); in octeon_irq_ciu_enable_all()
447 if (cd->line == 0) in octeon_irq_ciu_enable_all()
453 __set_bit(cd->bit, pen); in octeon_irq_ciu_enable_all()
459 if (cd->line == 0) in octeon_irq_ciu_enable_all()
475 struct octeon_ciu_chip_data *cd; in octeon_irq_ciu_enable_v2() local
477 cd = irq_data_get_irq_chip_data(data); in octeon_irq_ciu_enable_v2()
478 mask = 1ull << (cd->bit); in octeon_irq_ciu_enable_v2()
484 if (cd->line == 0) { in octeon_irq_ciu_enable_v2()
486 set_bit(cd->bit, &per_cpu(octeon_irq_ciu0_en_mirror, cpu)); in octeon_irq_ciu_enable_v2()
490 set_bit(cd->bit, &per_cpu(octeon_irq_ciu1_en_mirror, cpu)); in octeon_irq_ciu_enable_v2()
503 struct octeon_ciu_chip_data *cd; in octeon_irq_ciu_enable_sum2() local
505 cd = irq_data_get_irq_chip_data(data); in octeon_irq_ciu_enable_sum2()
506 mask = 1ull << (cd->bit); in octeon_irq_ciu_enable_sum2()
519 struct octeon_ciu_chip_data *cd; in octeon_irq_ciu_disable_local_sum2() local
521 cd = irq_data_get_irq_chip_data(data); in octeon_irq_ciu_disable_local_sum2()
522 mask = 1ull << (cd->bit); in octeon_irq_ciu_disable_local_sum2()
532 struct octeon_ciu_chip_data *cd; in octeon_irq_ciu_ack_sum2() local
534 cd = irq_data_get_irq_chip_data(data); in octeon_irq_ciu_ack_sum2()
535 mask = 1ull << (cd->bit); in octeon_irq_ciu_ack_sum2()
543 struct octeon_ciu_chip_data *cd; in octeon_irq_ciu_disable_all_sum2() local
546 cd = irq_data_get_irq_chip_data(data); in octeon_irq_ciu_disable_all_sum2()
547 mask = 1ull << (cd->bit); in octeon_irq_ciu_disable_all_sum2()
563 struct octeon_ciu_chip_data *cd; in octeon_irq_ciu_enable_local_v2() local
565 cd = irq_data_get_irq_chip_data(data); in octeon_irq_ciu_enable_local_v2()
566 mask = 1ull << (cd->bit); in octeon_irq_ciu_enable_local_v2()
568 if (cd->line == 0) { in octeon_irq_ciu_enable_local_v2()
570 set_bit(cd->bit, this_cpu_ptr(&octeon_irq_ciu0_en_mirror)); in octeon_irq_ciu_enable_local_v2()
574 set_bit(cd->bit, this_cpu_ptr(&octeon_irq_ciu1_en_mirror)); in octeon_irq_ciu_enable_local_v2()
582 struct octeon_ciu_chip_data *cd; in octeon_irq_ciu_disable_local_v2() local
584 cd = irq_data_get_irq_chip_data(data); in octeon_irq_ciu_disable_local_v2()
585 mask = 1ull << (cd->bit); in octeon_irq_ciu_disable_local_v2()
587 if (cd->line == 0) { in octeon_irq_ciu_disable_local_v2()
589 clear_bit(cd->bit, this_cpu_ptr(&octeon_irq_ciu0_en_mirror)); in octeon_irq_ciu_disable_local_v2()
593 clear_bit(cd->bit, this_cpu_ptr(&octeon_irq_ciu1_en_mirror)); in octeon_irq_ciu_disable_local_v2()
604 struct octeon_ciu_chip_data *cd; in octeon_irq_ciu_ack() local
606 cd = irq_data_get_irq_chip_data(data); in octeon_irq_ciu_ack()
607 mask = 1ull << (cd->bit); in octeon_irq_ciu_ack()
609 if (cd->line == 0) { in octeon_irq_ciu_ack()
625 struct octeon_ciu_chip_data *cd; in octeon_irq_ciu_disable_all_v2() local
627 cd = irq_data_get_irq_chip_data(data); in octeon_irq_ciu_disable_all_v2()
628 mask = 1ull << (cd->bit); in octeon_irq_ciu_disable_all_v2()
630 if (cd->line == 0) { in octeon_irq_ciu_disable_all_v2()
633 clear_bit(cd->bit, in octeon_irq_ciu_disable_all_v2()
640 clear_bit(cd->bit, in octeon_irq_ciu_disable_all_v2()
655 struct octeon_ciu_chip_data *cd; in octeon_irq_ciu_enable_all_v2() local
657 cd = irq_data_get_irq_chip_data(data); in octeon_irq_ciu_enable_all_v2()
658 mask = 1ull << (cd->bit); in octeon_irq_ciu_enable_all_v2()
660 if (cd->line == 0) { in octeon_irq_ciu_enable_all_v2()
663 set_bit(cd->bit, in octeon_irq_ciu_enable_all_v2()
670 set_bit(cd->bit, in octeon_irq_ciu_enable_all_v2()
692 struct octeon_ciu_chip_data *cd; in octeon_irq_gpio_setup() local
695 cd = irq_data_get_irq_chip_data(data); in octeon_irq_gpio_setup()
706 cvmx_write_csr(CVMX_GPIO_BIT_CFGX(cd->gpio_line), cfg.u64); in octeon_irq_gpio_setup()
736 struct octeon_ciu_chip_data *cd; in octeon_irq_ciu_disable_gpio_v2() local
738 cd = irq_data_get_irq_chip_data(data); in octeon_irq_ciu_disable_gpio_v2()
739 cvmx_write_csr(CVMX_GPIO_BIT_CFGX(cd->gpio_line), 0); in octeon_irq_ciu_disable_gpio_v2()
746 struct octeon_ciu_chip_data *cd; in octeon_irq_ciu_disable_gpio() local
748 cd = irq_data_get_irq_chip_data(data); in octeon_irq_ciu_disable_gpio()
749 cvmx_write_csr(CVMX_GPIO_BIT_CFGX(cd->gpio_line), 0); in octeon_irq_ciu_disable_gpio()
756 struct octeon_ciu_chip_data *cd; in octeon_irq_ciu_gpio_ack() local
759 cd = irq_data_get_irq_chip_data(data); in octeon_irq_ciu_gpio_ack()
760 mask = 1ull << (cd->gpio_line); in octeon_irq_ciu_gpio_ack()
797 struct octeon_ciu_chip_data *cd; in octeon_irq_ciu_set_affinity() local
801 cd = irq_data_get_irq_chip_data(data); in octeon_irq_ciu_set_affinity()
821 if (cd->line == 0) in octeon_irq_ciu_set_affinity()
828 __set_bit(cd->bit, pen); in octeon_irq_ciu_set_affinity()
830 __clear_bit(cd->bit, pen); in octeon_irq_ciu_set_affinity()
838 if (cd->line == 0) in octeon_irq_ciu_set_affinity()
859 struct octeon_ciu_chip_data *cd; in octeon_irq_ciu_set_affinity_v2() local
864 cd = irq_data_get_irq_chip_data(data); in octeon_irq_ciu_set_affinity_v2()
865 mask = 1ull << cd->bit; in octeon_irq_ciu_set_affinity_v2()
867 if (cd->line == 0) { in octeon_irq_ciu_set_affinity_v2()
873 set_bit(cd->bit, pen); in octeon_irq_ciu_set_affinity_v2()
876 clear_bit(cd->bit, pen); in octeon_irq_ciu_set_affinity_v2()
886 set_bit(cd->bit, pen); in octeon_irq_ciu_set_affinity_v2()
889 clear_bit(cd->bit, pen); in octeon_irq_ciu_set_affinity_v2()
904 struct octeon_ciu_chip_data *cd; in octeon_irq_ciu_set_affinity_sum2() local
909 cd = irq_data_get_irq_chip_data(data); in octeon_irq_ciu_set_affinity_sum2()
910 mask = 1ull << cd->bit; in octeon_irq_ciu_set_affinity_sum2()
1664 struct octeon_ciu_chip_data *cd; in octeon_irq_ciu2_wd_enable() local
1666 cd = irq_data_get_irq_chip_data(data); in octeon_irq_ciu2_wd_enable()
1667 mask = 1ull << (cd->bit); in octeon_irq_ciu2_wd_enable()
1670 (0x1000ull * cd->line); in octeon_irq_ciu2_wd_enable()
1681 struct octeon_ciu_chip_data *cd; in octeon_irq_ciu2_enable() local
1683 cd = irq_data_get_irq_chip_data(data); in octeon_irq_ciu2_enable()
1684 mask = 1ull << (cd->bit); in octeon_irq_ciu2_enable()
1687 (0x1000ull * cd->line); in octeon_irq_ciu2_enable()
1696 struct octeon_ciu_chip_data *cd; in octeon_irq_ciu2_enable_local() local
1698 cd = irq_data_get_irq_chip_data(data); in octeon_irq_ciu2_enable_local()
1699 mask = 1ull << (cd->bit); in octeon_irq_ciu2_enable_local()
1702 (0x1000ull * cd->line); in octeon_irq_ciu2_enable_local()
1712 struct octeon_ciu_chip_data *cd; in octeon_irq_ciu2_disable_local() local
1714 cd = irq_data_get_irq_chip_data(data); in octeon_irq_ciu2_disable_local()
1715 mask = 1ull << (cd->bit); in octeon_irq_ciu2_disable_local()
1718 (0x1000ull * cd->line); in octeon_irq_ciu2_disable_local()
1728 struct octeon_ciu_chip_data *cd; in octeon_irq_ciu2_ack() local
1730 cd = irq_data_get_irq_chip_data(data); in octeon_irq_ciu2_ack()
1731 mask = 1ull << (cd->bit); in octeon_irq_ciu2_ack()
1733 en_addr = CVMX_CIU2_RAW_PPX_IP2_WRKQ(coreid) + (0x1000ull * cd->line); in octeon_irq_ciu2_ack()
1742 struct octeon_ciu_chip_data *cd; in octeon_irq_ciu2_disable_all() local
1744 cd = irq_data_get_irq_chip_data(data); in octeon_irq_ciu2_disable_all()
1745 mask = 1ull << (cd->bit); in octeon_irq_ciu2_disable_all()
1749 octeon_coreid_for_cpu(cpu)) + (0x1000ull * cd->line); in octeon_irq_ciu2_disable_all()
1811 struct octeon_ciu_chip_data *cd; in octeon_irq_ciu2_set_affinity() local
1816 cd = irq_data_get_irq_chip_data(data); in octeon_irq_ciu2_set_affinity()
1817 mask = 1ull << cd->bit; in octeon_irq_ciu2_set_affinity()
1825 (0x1000ull * cd->line); in octeon_irq_ciu2_set_affinity()
1829 (0x1000ull * cd->line); in octeon_irq_ciu2_set_affinity()
1846 struct octeon_ciu_chip_data *cd; in octeon_irq_ciu2_disable_gpio() local
1848 cd = irq_data_get_irq_chip_data(data); in octeon_irq_ciu2_disable_gpio()
1850 cvmx_write_csr(CVMX_GPIO_BIT_CFGX(cd->gpio_line), 0); in octeon_irq_ciu2_disable_gpio()
2146 struct octeon_irq_cib_chip_data *cd = irq_data_get_irq_chip_data(data); in octeon_irq_cib_enable() local
2147 struct octeon_irq_cib_host_data *host_data = cd->host_data; in octeon_irq_cib_enable()
2151 en |= 1ull << cd->bit; in octeon_irq_cib_enable()
2160 struct octeon_irq_cib_chip_data *cd = irq_data_get_irq_chip_data(data); in octeon_irq_cib_disable() local
2161 struct octeon_irq_cib_host_data *host_data = cd->host_data; in octeon_irq_cib_disable()
2165 en &= ~(1ull << cd->bit); in octeon_irq_cib_disable()
2218 struct octeon_irq_cib_chip_data *cd; in octeon_irq_cib_map() local
2226 cd = kzalloc(sizeof(*cd), GFP_KERNEL); in octeon_irq_cib_map()
2227 if (!cd) in octeon_irq_cib_map()
2230 cd->host_data = host_data; in octeon_irq_cib_map()
2231 cd->bit = hw; in octeon_irq_cib_map()
2235 irq_set_chip_data(virq, cd); in octeon_irq_cib_map()
2411 struct octeon_ciu_chip_data *cd; in octeon_irq_ciu3_enable() local
2415 cd = irq_data_get_irq_chip_data(data); in octeon_irq_ciu3_enable()
2419 cvmx_write_csr(cd->ciu3_addr + CIU3_ISC_W1C(cd->intsn), isc_w1c.u64); in octeon_irq_ciu3_enable()
2421 isc_ctl_addr = cd->ciu3_addr + CIU3_ISC_CTL(cd->intsn); in octeon_irq_ciu3_enable()
2434 struct octeon_ciu_chip_data *cd; in octeon_irq_ciu3_disable() local
2436 cd = irq_data_get_irq_chip_data(data); in octeon_irq_ciu3_disable()
2441 isc_ctl_addr = cd->ciu3_addr + CIU3_ISC_CTL(cd->intsn); in octeon_irq_ciu3_disable()
2442 cvmx_write_csr(cd->ciu3_addr + CIU3_ISC_W1C(cd->intsn), isc_w1c.u64); in octeon_irq_ciu3_disable()
2451 struct octeon_ciu_chip_data *cd; in octeon_irq_ciu3_ack() local
2461 cd = irq_data_get_irq_chip_data(data); in octeon_irq_ciu3_ack()
2466 isc_w1c_addr = cd->ciu3_addr + CIU3_ISC_W1C(cd->intsn); in octeon_irq_ciu3_ack()
2475 struct octeon_ciu_chip_data *cd; in octeon_irq_ciu3_mask() local
2477 cd = irq_data_get_irq_chip_data(data); in octeon_irq_ciu3_mask()
2482 isc_w1c_addr = cd->ciu3_addr + CIU3_ISC_W1C(cd->intsn); in octeon_irq_ciu3_mask()
2491 struct octeon_ciu_chip_data *cd; in octeon_irq_ciu3_mask_ack() local
2494 cd = irq_data_get_irq_chip_data(data); in octeon_irq_ciu3_mask_ack()
2506 isc_w1c_addr = cd->ciu3_addr + CIU3_ISC_W1C(cd->intsn); in octeon_irq_ciu3_mask_ack()
2520 struct octeon_ciu_chip_data *cd = irq_data_get_irq_chip_data(data); in octeon_irq_ciu3_set_affinity() local
2522 if (!cpumask_subset(dest, cpumask_of_node(cd->ciu_node))) in octeon_irq_ciu3_set_affinity()
2528 cd = irq_data_get_irq_chip_data(data); in octeon_irq_ciu3_set_affinity()
2532 cd->current_cpu = cpu; in octeon_irq_ciu3_set_affinity()
2536 cvmx_write_csr(cd->ciu3_addr + CIU3_ISC_W1C(cd->intsn), isc_w1c.u64); in octeon_irq_ciu3_set_affinity()
2538 isc_ctl_addr = cd->ciu3_addr + CIU3_ISC_CTL(cd->intsn); in octeon_irq_ciu3_set_affinity()
2569 struct octeon_ciu_chip_data *cd = kzalloc_node(sizeof(*cd), GFP_KERNEL, in octeon_irq_ciu3_mapx() local
2571 if (!cd) in octeon_irq_ciu3_mapx()
2573 cd->intsn = hw; in octeon_irq_ciu3_mapx()
2574 cd->current_cpu = -1; in octeon_irq_ciu3_mapx()
2575 cd->ciu3_addr = ciu3_info->ciu3_addr; in octeon_irq_ciu3_mapx()
2576 cd->ciu_node = ciu3_info->node; in octeon_irq_ciu3_mapx()
2578 irq_set_chip_data(virq, cd); in octeon_irq_ciu3_mapx()