Lines Matching +full:htvec +full:- +full:1

1 // SPDX-License-Identifier: GPL-2.0
7 #define pr_fmt(fmt) "htvec: " fmt
28 struct htvec { struct
41 struct htvec *priv = irq_desc_get_handler_data(desc); in htvec_irq_dispatch() argument
45 for (i = 0; i < priv->num_parents; i++) { in htvec_irq_dispatch()
46 pending = readl(priv->base + 4 * i); in htvec_irq_dispatch()
50 generic_handle_domain_irq(priv->htvec_domain, in htvec_irq_dispatch()
65 struct htvec *priv = irq_data_get_irq_chip_data(d); in htvec_ack_irq()
67 writel(BIT(VEC_REG_BIT(d->hwirq)), in htvec_ack_irq()
68 priv->base + VEC_REG_IDX(d->hwirq) * 4); in htvec_ack_irq()
75 struct htvec *priv = irq_data_get_irq_chip_data(d); in htvec_mask_irq()
77 raw_spin_lock(&priv->htvec_lock); in htvec_mask_irq()
78 addr = priv->base + HTVEC_EN_OFF; in htvec_mask_irq()
79 addr += VEC_REG_IDX(d->hwirq) * 4; in htvec_mask_irq()
81 reg &= ~BIT(VEC_REG_BIT(d->hwirq)); in htvec_mask_irq()
83 raw_spin_unlock(&priv->htvec_lock); in htvec_mask_irq()
90 struct htvec *priv = irq_data_get_irq_chip_data(d); in htvec_unmask_irq()
92 raw_spin_lock(&priv->htvec_lock); in htvec_unmask_irq()
93 addr = priv->base + HTVEC_EN_OFF; in htvec_unmask_irq()
94 addr += VEC_REG_IDX(d->hwirq) * 4; in htvec_unmask_irq()
96 reg |= BIT(VEC_REG_BIT(d->hwirq)); in htvec_unmask_irq()
98 raw_spin_unlock(&priv->htvec_lock); in htvec_unmask_irq()
114 struct htvec *priv = domain->host_data; in htvec_domain_alloc()
147 static void htvec_reset(struct htvec *priv) in htvec_reset()
152 for (idx = 0; idx < priv->num_parents; idx++) { in htvec_reset()
153 writel_relaxed(0x0, priv->base + HTVEC_EN_OFF + 4 * idx); in htvec_reset()
154 writel_relaxed(0xFFFFFFFF, priv->base + 4 * idx); in htvec_reset()
161 struct htvec *priv; in htvec_of_init()
166 return -ENOMEM; in htvec_of_init()
168 raw_spin_lock_init(&priv->htvec_lock); in htvec_of_init()
169 priv->base = of_iomap(node, 0); in htvec_of_init()
170 if (!priv->base) { in htvec_of_init()
171 err = -ENOMEM; in htvec_of_init()
181 priv->num_parents++; in htvec_of_init()
184 if (!priv->num_parents) { in htvec_of_init()
186 err = -ENODEV; in htvec_of_init()
190 priv->htvec_domain = irq_domain_create_linear(of_node_to_fwnode(node), in htvec_of_init()
191 (VEC_COUNT_PER_REG * priv->num_parents), in htvec_of_init()
193 if (!priv->htvec_domain) { in htvec_of_init()
195 err = -ENOMEM; in htvec_of_init()
201 for (i = 0; i < priv->num_parents; i++) in htvec_of_init()
208 for (; i > 0; i--) in htvec_of_init()
209 irq_dispose_mapping(parent_irq[i - 1]); in htvec_of_init()
211 iounmap(priv->base); in htvec_of_init()
218 IRQCHIP_DECLARE(htvec, "loongson,htvec-1.0", htvec_of_init);