Lines Matching +full:flags +full:- +full:mask
1 // SPDX-License-Identifier: GPL-2.0-or-later
35 .mask = IPIC_SIMSR_H,
42 .mask = IPIC_SIMSR_H,
49 .mask = IPIC_SIMSR_H,
56 .mask = IPIC_SIMSR_H,
63 .mask = IPIC_SIMSR_H,
70 .mask = IPIC_SIMSR_H,
77 .mask = IPIC_SIMSR_H,
84 .mask = IPIC_SIMSR_H,
91 .mask = IPIC_SIMSR_H,
98 .mask = IPIC_SIMSR_H,
105 .mask = IPIC_SIMSR_H,
112 .mask = IPIC_SIMSR_H,
119 .mask = IPIC_SIMSR_H,
126 .mask = IPIC_SIMSR_H,
133 .mask = IPIC_SIMSR_H,
140 .mask = IPIC_SIMSR_H,
148 .mask = IPIC_SEMSR,
156 .mask = IPIC_SEMSR,
164 .mask = IPIC_SEMSR,
172 .mask = IPIC_SEMSR,
180 .mask = IPIC_SEMSR,
188 .mask = IPIC_SEMSR,
196 .mask = IPIC_SEMSR,
203 .mask = IPIC_SIMSR_H,
210 .mask = IPIC_SIMSR_H,
217 .mask = IPIC_SIMSR_H,
224 .mask = IPIC_SIMSR_H,
231 .mask = IPIC_SIMSR_H,
238 .mask = IPIC_SIMSR_H,
245 .mask = IPIC_SIMSR_H,
252 .mask = IPIC_SIMSR_H,
259 .mask = IPIC_SIMSR_H,
266 .mask = IPIC_SIMSR_H,
273 .mask = IPIC_SIMSR_H,
280 .mask = IPIC_SIMSR_H,
287 .mask = IPIC_SIMSR_H,
294 .mask = IPIC_SIMSR_H,
301 .mask = IPIC_SIMSR_H,
308 .mask = IPIC_SIMSR_H,
316 .mask = IPIC_SEMSR,
323 .mask = IPIC_SIMSR_L,
330 .mask = IPIC_SIMSR_L,
337 .mask = IPIC_SIMSR_L,
344 .mask = IPIC_SIMSR_L,
351 .mask = IPIC_SIMSR_L,
358 .mask = IPIC_SIMSR_L,
365 .mask = IPIC_SIMSR_L,
372 .mask = IPIC_SIMSR_L,
379 .mask = IPIC_SIMSR_L,
385 .mask = IPIC_SIMSR_L,
391 .mask = IPIC_SIMSR_L,
397 .mask = IPIC_SIMSR_L,
403 .mask = IPIC_SIMSR_L,
409 .mask = IPIC_SIMSR_L,
415 .mask = IPIC_SIMSR_L,
421 .mask = IPIC_SIMSR_L,
427 .mask = IPIC_SIMSR_L,
433 .mask = IPIC_SIMSR_L,
439 .mask = IPIC_SIMSR_L,
445 .mask = IPIC_SIMSR_L,
451 .mask = IPIC_SIMSR_L,
457 .mask = IPIC_SIMSR_L,
463 .mask = IPIC_SIMSR_L,
469 .mask = IPIC_SIMSR_L,
475 .mask = IPIC_SIMSR_L,
481 .mask = IPIC_SIMSR_L,
487 .mask = IPIC_SIMSR_L,
493 .mask = IPIC_SIMSR_L,
499 .mask = IPIC_SIMSR_L,
523 struct ipic *ipic = ipic_from_irq(d->irq); in ipic_unmask_irq()
525 unsigned long flags; in ipic_unmask_irq() local
528 raw_spin_lock_irqsave(&ipic_lock, flags); in ipic_unmask_irq()
530 temp = ipic_read(ipic->regs, ipic_info[src].mask); in ipic_unmask_irq()
531 temp |= (1 << (31 - ipic_info[src].bit)); in ipic_unmask_irq()
532 ipic_write(ipic->regs, ipic_info[src].mask, temp); in ipic_unmask_irq()
534 raw_spin_unlock_irqrestore(&ipic_lock, flags); in ipic_unmask_irq()
539 struct ipic *ipic = ipic_from_irq(d->irq); in ipic_mask_irq()
541 unsigned long flags; in ipic_mask_irq() local
544 raw_spin_lock_irqsave(&ipic_lock, flags); in ipic_mask_irq()
546 temp = ipic_read(ipic->regs, ipic_info[src].mask); in ipic_mask_irq()
547 temp &= ~(1 << (31 - ipic_info[src].bit)); in ipic_mask_irq()
548 ipic_write(ipic->regs, ipic_info[src].mask, temp); in ipic_mask_irq()
554 raw_spin_unlock_irqrestore(&ipic_lock, flags); in ipic_mask_irq()
559 struct ipic *ipic = ipic_from_irq(d->irq); in ipic_ack_irq()
561 unsigned long flags; in ipic_ack_irq() local
564 raw_spin_lock_irqsave(&ipic_lock, flags); in ipic_ack_irq()
566 temp = 1 << (31 - ipic_info[src].bit); in ipic_ack_irq()
567 ipic_write(ipic->regs, ipic_info[src].ack, temp); in ipic_ack_irq()
573 raw_spin_unlock_irqrestore(&ipic_lock, flags); in ipic_ack_irq()
578 struct ipic *ipic = ipic_from_irq(d->irq); in ipic_mask_irq_and_ack()
580 unsigned long flags; in ipic_mask_irq_and_ack() local
583 raw_spin_lock_irqsave(&ipic_lock, flags); in ipic_mask_irq_and_ack()
585 temp = ipic_read(ipic->regs, ipic_info[src].mask); in ipic_mask_irq_and_ack()
586 temp &= ~(1 << (31 - ipic_info[src].bit)); in ipic_mask_irq_and_ack()
587 ipic_write(ipic->regs, ipic_info[src].mask, temp); in ipic_mask_irq_and_ack()
589 temp = 1 << (31 - ipic_info[src].bit); in ipic_mask_irq_and_ack()
590 ipic_write(ipic->regs, ipic_info[src].ack, temp); in ipic_mask_irq_and_ack()
596 raw_spin_unlock_irqrestore(&ipic_lock, flags); in ipic_mask_irq_and_ack()
601 struct ipic *ipic = ipic_from_irq(d->irq); in ipic_set_irq_type()
608 /* ipic supports only low assertion and high-to-low change senses in ipic_set_irq_type()
613 return -EINVAL; in ipic_set_irq_type()
619 return -EINVAL; in ipic_set_irq_type()
626 d->chip = &ipic_level_irq_chip; in ipic_set_irq_type()
629 d->chip = &ipic_edge_irq_chip; in ipic_set_irq_type()
639 edibit = (14 - (src - IPIC_IRQ_EXT1)); in ipic_set_irq_type()
641 return (flow_type & IRQ_TYPE_LEVEL_LOW) ? 0 : -EINVAL; in ipic_set_irq_type()
643 vold = ipic_read(ipic->regs, IPIC_SECNR); in ipic_set_irq_type()
650 ipic_write(ipic->regs, IPIC_SECNR, vnew); in ipic_set_irq_type()
683 struct ipic *ipic = h->host_data; in ipic_host_map()
700 struct ipic * __init ipic_init(struct device_node *node, unsigned int flags) in ipic_init() argument
714 ipic->irqhost = irq_domain_add_linear(node, NR_IPIC_INTS, in ipic_init()
716 if (ipic->irqhost == NULL) { in ipic_init()
721 ipic->regs = ioremap(res.start, resource_size(&res)); in ipic_init()
724 ipic_write(ipic->regs, IPIC_SICNR, 0x0); in ipic_init()
728 if (flags & IPIC_SPREADMODE_GRP_A) in ipic_init()
730 if (flags & IPIC_SPREADMODE_GRP_B) in ipic_init()
732 if (flags & IPIC_SPREADMODE_GRP_C) in ipic_init()
734 if (flags & IPIC_SPREADMODE_GRP_D) in ipic_init()
736 if (flags & IPIC_SPREADMODE_MIX_A) in ipic_init()
738 if (flags & IPIC_SPREADMODE_MIX_B) in ipic_init()
741 ipic_write(ipic->regs, IPIC_SICFR, temp); in ipic_init()
745 if (flags & IPIC_DISABLE_MCP_OUT) in ipic_init()
747 ipic_write(ipic->regs, IPIC_SERCR, temp); in ipic_init()
750 temp = ipic_read(ipic->regs, IPIC_SEMSR); in ipic_init()
752 if (flags & IPIC_IRQ0_MCP) in ipic_init()
757 ipic_write(ipic->regs, IPIC_SEMSR, temp); in ipic_init()
760 irq_set_default_host(primary_ipic->irqhost); in ipic_init()
762 ipic_write(ipic->regs, IPIC_SIMSR_H, 0); in ipic_init()
763 ipic_write(ipic->regs, IPIC_SIMSR_L, 0); in ipic_init()
766 primary_ipic->regs); in ipic_init()
773 ipic_write(primary_ipic->regs, IPIC_SIPRR_A, IPIC_PRIORITY_DEFAULT); in ipic_set_default_priority()
774 ipic_write(primary_ipic->regs, IPIC_SIPRR_B, IPIC_PRIORITY_DEFAULT); in ipic_set_default_priority()
775 ipic_write(primary_ipic->regs, IPIC_SIPRR_C, IPIC_PRIORITY_DEFAULT); in ipic_set_default_priority()
776 ipic_write(primary_ipic->regs, IPIC_SIPRR_D, IPIC_PRIORITY_DEFAULT); in ipic_set_default_priority()
777 ipic_write(primary_ipic->regs, IPIC_SMPRR_A, IPIC_PRIORITY_DEFAULT); in ipic_set_default_priority()
778 ipic_write(primary_ipic->regs, IPIC_SMPRR_B, IPIC_PRIORITY_DEFAULT); in ipic_set_default_priority()
783 return primary_ipic ? ipic_read(primary_ipic->regs, IPIC_SERSR) : 0; in ipic_get_mcp_status()
786 void ipic_clear_mcp_status(u32 mask) in ipic_clear_mcp_status() argument
788 ipic_write(primary_ipic->regs, IPIC_SERSR, mask); in ipic_clear_mcp_status()
799 irq = ipic_read(primary_ipic->regs, IPIC_SIVCR) & IPIC_SIVCR_VECTOR_MASK; in ipic_get_irq()
801 if (irq == 0) /* 0 --> no irq is pending */ in ipic_get_irq()
804 return irq_linear_revmap(primary_ipic->irqhost, irq); in ipic_get_irq()
824 ipic_saved_state.sicfr = ipic_read(ipic->regs, IPIC_SICFR); in ipic_suspend()
825 ipic_saved_state.siprr[0] = ipic_read(ipic->regs, IPIC_SIPRR_A); in ipic_suspend()
826 ipic_saved_state.siprr[1] = ipic_read(ipic->regs, IPIC_SIPRR_D); in ipic_suspend()
827 ipic_saved_state.simsr[0] = ipic_read(ipic->regs, IPIC_SIMSR_H); in ipic_suspend()
828 ipic_saved_state.simsr[1] = ipic_read(ipic->regs, IPIC_SIMSR_L); in ipic_suspend()
829 ipic_saved_state.sicnr = ipic_read(ipic->regs, IPIC_SICNR); in ipic_suspend()
830 ipic_saved_state.smprr[0] = ipic_read(ipic->regs, IPIC_SMPRR_A); in ipic_suspend()
831 ipic_saved_state.smprr[1] = ipic_read(ipic->regs, IPIC_SMPRR_B); in ipic_suspend()
832 ipic_saved_state.semsr = ipic_read(ipic->regs, IPIC_SEMSR); in ipic_suspend()
833 ipic_saved_state.secnr = ipic_read(ipic->regs, IPIC_SECNR); in ipic_suspend()
834 ipic_saved_state.sermr = ipic_read(ipic->regs, IPIC_SERMR); in ipic_suspend()
835 ipic_saved_state.sercr = ipic_read(ipic->regs, IPIC_SERCR); in ipic_suspend()
842 ipic_write(ipic->regs, IPIC_SIMSR_H, 0); in ipic_suspend()
843 ipic_write(ipic->regs, IPIC_SIMSR_L, 0); in ipic_suspend()
844 ipic_write(ipic->regs, IPIC_SEMSR, 0); in ipic_suspend()
845 ipic_write(ipic->regs, IPIC_SERMR, 0); in ipic_suspend()
855 ipic_write(ipic->regs, IPIC_SICFR, ipic_saved_state.sicfr); in ipic_resume()
856 ipic_write(ipic->regs, IPIC_SIPRR_A, ipic_saved_state.siprr[0]); in ipic_resume()
857 ipic_write(ipic->regs, IPIC_SIPRR_D, ipic_saved_state.siprr[1]); in ipic_resume()
858 ipic_write(ipic->regs, IPIC_SIMSR_H, ipic_saved_state.simsr[0]); in ipic_resume()
859 ipic_write(ipic->regs, IPIC_SIMSR_L, ipic_saved_state.simsr[1]); in ipic_resume()
860 ipic_write(ipic->regs, IPIC_SICNR, ipic_saved_state.sicnr); in ipic_resume()
861 ipic_write(ipic->regs, IPIC_SMPRR_A, ipic_saved_state.smprr[0]); in ipic_resume()
862 ipic_write(ipic->regs, IPIC_SMPRR_B, ipic_saved_state.smprr[1]); in ipic_resume()
863 ipic_write(ipic->regs, IPIC_SEMSR, ipic_saved_state.semsr); in ipic_resume()
864 ipic_write(ipic->regs, IPIC_SECNR, ipic_saved_state.secnr); in ipic_resume()
865 ipic_write(ipic->regs, IPIC_SERMR, ipic_saved_state.sermr); in ipic_resume()
866 ipic_write(ipic->regs, IPIC_SERCR, ipic_saved_state.sercr); in ipic_resume()
880 if (!primary_ipic || !primary_ipic->regs) in init_ipic_syscore()
881 return -ENODEV; in init_ipic_syscore()