Lines Matching +full:ast2600 +full:- +full:scu
1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * Aspeed AST24XX, AST25XX, and AST26XX SCU Interrupt Controller
41 struct regmap *scu; member
54 unsigned int mask = scu_ic->irq_enable << ASPEED_SCU_IC_STATUS_SHIFT; in aspeed_scu_ic_irq_handler()
59 * The SCU IC has just one register to control its operation and read in aspeed_scu_ic_irq_handler()
68 regmap_read(scu_ic->scu, scu_ic->reg, &sts); in aspeed_scu_ic_irq_handler()
69 enabled = sts & scu_ic->irq_enable; in aspeed_scu_ic_irq_handler()
72 bit = scu_ic->irq_shift; in aspeed_scu_ic_irq_handler()
73 max = scu_ic->num_irqs + bit; in aspeed_scu_ic_irq_handler()
76 generic_handle_domain_irq(scu_ic->irq_domain, in aspeed_scu_ic_irq_handler()
77 bit - scu_ic->irq_shift); in aspeed_scu_ic_irq_handler()
79 regmap_write_bits(scu_ic->scu, scu_ic->reg, mask, in aspeed_scu_ic_irq_handler()
89 unsigned int mask = BIT(data->hwirq + scu_ic->irq_shift) | in aspeed_scu_ic_irq_mask()
90 (scu_ic->irq_enable << ASPEED_SCU_IC_STATUS_SHIFT); in aspeed_scu_ic_irq_mask()
97 regmap_update_bits(scu_ic->scu, scu_ic->reg, mask, 0); in aspeed_scu_ic_irq_mask()
103 unsigned int bit = BIT(data->hwirq + scu_ic->irq_shift); in aspeed_scu_ic_irq_unmask()
105 (scu_ic->irq_enable << ASPEED_SCU_IC_STATUS_SHIFT); in aspeed_scu_ic_irq_unmask()
112 regmap_update_bits(scu_ic->scu, scu_ic->reg, mask, bit); in aspeed_scu_ic_irq_unmask()
119 return -EINVAL; in aspeed_scu_ic_irq_set_affinity()
123 .name = "aspeed-scu-ic",
133 irq_set_chip_data(irq, domain->host_data); in aspeed_scu_ic_map()
148 if (!node->parent) { in aspeed_scu_ic_of_init_common()
149 rc = -ENODEV; in aspeed_scu_ic_of_init_common()
153 scu_ic->scu = syscon_node_to_regmap(node->parent); in aspeed_scu_ic_of_init_common()
154 if (IS_ERR(scu_ic->scu)) { in aspeed_scu_ic_of_init_common()
155 rc = PTR_ERR(scu_ic->scu); in aspeed_scu_ic_of_init_common()
161 rc = -EINVAL; in aspeed_scu_ic_of_init_common()
165 scu_ic->irq_domain = irq_domain_add_linear(node, scu_ic->num_irqs, in aspeed_scu_ic_of_init_common()
168 if (!scu_ic->irq_domain) { in aspeed_scu_ic_of_init_common()
169 rc = -ENOMEM; in aspeed_scu_ic_of_init_common()
190 return -ENOMEM; in aspeed_scu_ic_of_init()
192 scu_ic->irq_enable = ASPEED_SCU_IC_ENABLE; in aspeed_scu_ic_of_init()
193 scu_ic->irq_shift = ASPEED_SCU_IC_SHIFT; in aspeed_scu_ic_of_init()
194 scu_ic->num_irqs = ASPEED_SCU_IC_NUM_IRQS; in aspeed_scu_ic_of_init()
195 scu_ic->reg = ASPEED_SCU_IC_REG; in aspeed_scu_ic_of_init()
206 return -ENOMEM; in aspeed_ast2600_scu_ic0_of_init()
208 scu_ic->irq_enable = ASPEED_AST2600_SCU_IC0_ENABLE; in aspeed_ast2600_scu_ic0_of_init()
209 scu_ic->irq_shift = ASPEED_AST2600_SCU_IC0_SHIFT; in aspeed_ast2600_scu_ic0_of_init()
210 scu_ic->num_irqs = ASPEED_AST2600_SCU_IC0_NUM_IRQS; in aspeed_ast2600_scu_ic0_of_init()
211 scu_ic->reg = ASPEED_AST2600_SCU_IC0_REG; in aspeed_ast2600_scu_ic0_of_init()
222 return -ENOMEM; in aspeed_ast2600_scu_ic1_of_init()
224 scu_ic->irq_enable = ASPEED_AST2600_SCU_IC1_ENABLE; in aspeed_ast2600_scu_ic1_of_init()
225 scu_ic->irq_shift = ASPEED_AST2600_SCU_IC1_SHIFT; in aspeed_ast2600_scu_ic1_of_init()
226 scu_ic->num_irqs = ASPEED_AST2600_SCU_IC1_NUM_IRQS; in aspeed_ast2600_scu_ic1_of_init()
227 scu_ic->reg = ASPEED_AST2600_SCU_IC1_REG; in aspeed_ast2600_scu_ic1_of_init()
232 IRQCHIP_DECLARE(ast2400_scu_ic, "aspeed,ast2400-scu-ic", aspeed_scu_ic_of_init);
233 IRQCHIP_DECLARE(ast2500_scu_ic, "aspeed,ast2500-scu-ic", aspeed_scu_ic_of_init);
234 IRQCHIP_DECLARE(ast2600_scu_ic0, "aspeed,ast2600-scu-ic0",
236 IRQCHIP_DECLARE(ast2600_scu_ic1, "aspeed,ast2600-scu-ic1",