Lines Matching +full:ast2500 +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
55 unsigned int mask = scu_ic->irq_enable << ASPEED_SCU_IC_STATUS_SHIFT; in aspeed_scu_ic_irq_handler()
60 * The SCU IC has just one register to control its operation and read in aspeed_scu_ic_irq_handler()
69 regmap_read(scu_ic->scu, scu_ic->reg, &sts); in aspeed_scu_ic_irq_handler()
70 enabled = sts & scu_ic->irq_enable; in aspeed_scu_ic_irq_handler()
73 bit = scu_ic->irq_shift; in aspeed_scu_ic_irq_handler()
74 max = scu_ic->num_irqs + bit; in aspeed_scu_ic_irq_handler()
77 irq = irq_find_mapping(scu_ic->irq_domain, in aspeed_scu_ic_irq_handler()
78 bit - scu_ic->irq_shift); in aspeed_scu_ic_irq_handler()
81 regmap_update_bits(scu_ic->scu, scu_ic->reg, mask, in aspeed_scu_ic_irq_handler()
91 unsigned int mask = BIT(data->hwirq + scu_ic->irq_shift) | in aspeed_scu_ic_irq_mask()
92 (scu_ic->irq_enable << ASPEED_SCU_IC_STATUS_SHIFT); in aspeed_scu_ic_irq_mask()
99 regmap_update_bits(scu_ic->scu, scu_ic->reg, mask, 0); in aspeed_scu_ic_irq_mask()
105 unsigned int bit = BIT(data->hwirq + scu_ic->irq_shift); in aspeed_scu_ic_irq_unmask()
107 (scu_ic->irq_enable << ASPEED_SCU_IC_STATUS_SHIFT); in aspeed_scu_ic_irq_unmask()
114 regmap_update_bits(scu_ic->scu, scu_ic->reg, mask, bit); in aspeed_scu_ic_irq_unmask()
121 return -EINVAL; in aspeed_scu_ic_irq_set_affinity()
125 .name = "aspeed-scu-ic",
135 irq_set_chip_data(irq, domain->host_data); in aspeed_scu_ic_map()
150 if (!node->parent) { in aspeed_scu_ic_of_init_common()
151 rc = -ENODEV; in aspeed_scu_ic_of_init_common()
155 scu_ic->scu = syscon_node_to_regmap(node->parent); in aspeed_scu_ic_of_init_common()
156 if (IS_ERR(scu_ic->scu)) { in aspeed_scu_ic_of_init_common()
157 rc = PTR_ERR(scu_ic->scu); in aspeed_scu_ic_of_init_common()
167 scu_ic->irq_domain = irq_domain_add_linear(node, scu_ic->num_irqs, in aspeed_scu_ic_of_init_common()
170 if (!scu_ic->irq_domain) { in aspeed_scu_ic_of_init_common()
171 rc = -ENOMEM; in aspeed_scu_ic_of_init_common()
192 return -ENOMEM; in aspeed_scu_ic_of_init()
194 scu_ic->irq_enable = ASPEED_SCU_IC_ENABLE; in aspeed_scu_ic_of_init()
195 scu_ic->irq_shift = ASPEED_SCU_IC_SHIFT; in aspeed_scu_ic_of_init()
196 scu_ic->num_irqs = ASPEED_SCU_IC_NUM_IRQS; in aspeed_scu_ic_of_init()
197 scu_ic->reg = ASPEED_SCU_IC_REG; in aspeed_scu_ic_of_init()
208 return -ENOMEM; in aspeed_ast2600_scu_ic0_of_init()
210 scu_ic->irq_enable = ASPEED_AST2600_SCU_IC0_ENABLE; in aspeed_ast2600_scu_ic0_of_init()
211 scu_ic->irq_shift = ASPEED_AST2600_SCU_IC0_SHIFT; in aspeed_ast2600_scu_ic0_of_init()
212 scu_ic->num_irqs = ASPEED_AST2600_SCU_IC0_NUM_IRQS; in aspeed_ast2600_scu_ic0_of_init()
213 scu_ic->reg = ASPEED_AST2600_SCU_IC0_REG; in aspeed_ast2600_scu_ic0_of_init()
224 return -ENOMEM; in aspeed_ast2600_scu_ic1_of_init()
226 scu_ic->irq_enable = ASPEED_AST2600_SCU_IC1_ENABLE; in aspeed_ast2600_scu_ic1_of_init()
227 scu_ic->irq_shift = ASPEED_AST2600_SCU_IC1_SHIFT; in aspeed_ast2600_scu_ic1_of_init()
228 scu_ic->num_irqs = ASPEED_AST2600_SCU_IC1_NUM_IRQS; in aspeed_ast2600_scu_ic1_of_init()
229 scu_ic->reg = ASPEED_AST2600_SCU_IC1_REG; in aspeed_ast2600_scu_ic1_of_init()
234 IRQCHIP_DECLARE(ast2400_scu_ic, "aspeed,ast2400-scu-ic", aspeed_scu_ic_of_init);
235 IRQCHIP_DECLARE(ast2500_scu_ic, "aspeed,ast2500-scu-ic", aspeed_scu_ic_of_init);
236 IRQCHIP_DECLARE(ast2600_scu_ic0, "aspeed,ast2600-scu-ic0",
238 IRQCHIP_DECLARE(ast2600_scu_ic1, "aspeed,ast2600-scu-ic1",