Lines Matching refs:irqc

914 static int __init aic_init_smp(struct aic_irq_chip *irqc, struct device_node *node)  in aic_init_smp()  argument
919 ipi_domain = irq_domain_create_linear(irqc->hw_domain->fwnode, AIC_NR_SWIPI, in aic_init_smp()
920 &aic_ipi_domain_ops, irqc); in aic_init_smp()
937 irqc->ipi_domain = ipi_domain; in aic_init_smp()
1051 struct aic_irq_chip *irqc; in aic_of_ic_init() local
1059 irqc = kzalloc(sizeof(*irqc), GFP_KERNEL); in aic_of_ic_init()
1060 if (!irqc) { in aic_of_ic_init()
1065 irqc->base = regs; in aic_of_ic_init()
1071 irqc->info = *(struct aic_info *)match->data; in aic_of_ic_init()
1073 aic_irqc = irqc; in aic_of_ic_init()
1075 switch (irqc->info.version) { in aic_of_ic_init()
1079 info = aic_ic_read(irqc, AIC_INFO); in aic_of_ic_init()
1080 irqc->nr_irq = FIELD_GET(AIC_INFO_NR_IRQ, info); in aic_of_ic_init()
1081 irqc->max_irq = AIC_MAX_IRQ; in aic_of_ic_init()
1082 irqc->nr_die = irqc->max_die = 1; in aic_of_ic_init()
1084 off = start_off = irqc->info.target_cpu; in aic_of_ic_init()
1085 off += sizeof(u32) * irqc->max_irq; /* TARGET_CPU */ in aic_of_ic_init()
1087 irqc->event = irqc->base; in aic_of_ic_init()
1094 info1 = aic_ic_read(irqc, AIC2_INFO1); in aic_of_ic_init()
1095 info3 = aic_ic_read(irqc, AIC2_INFO3); in aic_of_ic_init()
1097 irqc->nr_irq = FIELD_GET(AIC2_INFO1_NR_IRQ, info1); in aic_of_ic_init()
1098 irqc->max_irq = FIELD_GET(AIC2_INFO3_MAX_IRQ, info3); in aic_of_ic_init()
1099 irqc->nr_die = FIELD_GET(AIC2_INFO1_LAST_DIE, info1) + 1; in aic_of_ic_init()
1100 irqc->max_die = FIELD_GET(AIC2_INFO3_MAX_DIE, info3); in aic_of_ic_init()
1102 off = start_off = irqc->info.irq_cfg; in aic_of_ic_init()
1103 off += sizeof(u32) * irqc->max_irq; /* IRQ_CFG */ in aic_of_ic_init()
1105 irqc->event = of_iomap(node, 1); in aic_of_ic_init()
1106 if (WARN_ON(!irqc->event)) in aic_of_ic_init()
1113 irqc->info.sw_set = off; in aic_of_ic_init()
1114 off += sizeof(u32) * (irqc->max_irq >> 5); /* SW_SET */ in aic_of_ic_init()
1115 irqc->info.sw_clr = off; in aic_of_ic_init()
1116 off += sizeof(u32) * (irqc->max_irq >> 5); /* SW_CLR */ in aic_of_ic_init()
1117 irqc->info.mask_set = off; in aic_of_ic_init()
1118 off += sizeof(u32) * (irqc->max_irq >> 5); /* MASK_SET */ in aic_of_ic_init()
1119 irqc->info.mask_clr = off; in aic_of_ic_init()
1120 off += sizeof(u32) * (irqc->max_irq >> 5); /* MASK_CLR */ in aic_of_ic_init()
1121 off += sizeof(u32) * (irqc->max_irq >> 5); /* HW_STATE */ in aic_of_ic_init()
1123 if (irqc->info.fast_ipi) in aic_of_ic_init()
1128 irqc->info.die_stride = off - start_off; in aic_of_ic_init()
1130 irqc->hw_domain = irq_domain_create_tree(of_node_to_fwnode(node), in aic_of_ic_init()
1131 &aic_irq_domain_ops, irqc); in aic_of_ic_init()
1132 if (WARN_ON(!irqc->hw_domain)) in aic_of_ic_init()
1135 irq_domain_update_bus_token(irqc->hw_domain, DOMAIN_BUS_WIRED); in aic_of_ic_init()
1137 if (aic_init_smp(irqc, node)) in aic_of_ic_init()
1145 build_fiq_affinity(irqc, chld); in aic_of_ic_init()
1153 for (die = 0; die < irqc->nr_die; die++) { in aic_of_ic_init()
1154 for (i = 0; i < BITS_TO_U32(irqc->nr_irq); i++) in aic_of_ic_init()
1155 aic_ic_write(irqc, irqc->info.mask_set + off + i * 4, U32_MAX); in aic_of_ic_init()
1156 for (i = 0; i < BITS_TO_U32(irqc->nr_irq); i++) in aic_of_ic_init()
1157 aic_ic_write(irqc, irqc->info.sw_clr + off + i * 4, U32_MAX); in aic_of_ic_init()
1158 if (irqc->info.target_cpu) in aic_of_ic_init()
1159 for (i = 0; i < irqc->nr_irq; i++) in aic_of_ic_init()
1160 aic_ic_write(irqc, irqc->info.target_cpu + off + i * 4, 1); in aic_of_ic_init()
1161 off += irqc->info.die_stride; in aic_of_ic_init()
1164 if (irqc->info.version == 2) { in aic_of_ic_init()
1165 u32 config = aic_ic_read(irqc, AIC2_CONFIG); in aic_of_ic_init()
1168 aic_ic_write(irqc, AIC2_CONFIG, config); in aic_of_ic_init()
1184 irqc->nr_irq, irqc->max_irq, irqc->nr_die, irqc->max_die, AIC_NR_FIQ, AIC_NR_SWIPI); in aic_of_ic_init()
1189 irq_domain_remove(irqc->hw_domain); in aic_of_ic_init()
1191 if (irqc->event && irqc->event != irqc->base) in aic_of_ic_init()
1192 iounmap(irqc->event); in aic_of_ic_init()
1193 iounmap(irqc->base); in aic_of_ic_init()
1194 kfree(irqc); in aic_of_ic_init()