Lines Matching full:intc
90 static inline unsigned int reg_enable(struct bcm6345_l1_chip *intc, in reg_enable() argument
94 return (1 * intc->n_words - word - 1) * sizeof(u32); in reg_enable()
96 return (0 * intc->n_words + word) * sizeof(u32); in reg_enable()
100 static inline unsigned int reg_status(struct bcm6345_l1_chip *intc, in reg_status() argument
104 return (2 * intc->n_words - word - 1) * sizeof(u32); in reg_status()
106 return (1 * intc->n_words + word) * sizeof(u32); in reg_status()
110 static inline unsigned int cpu_for_irq(struct bcm6345_l1_chip *intc, in cpu_for_irq() argument
113 return cpumask_first_and(&intc->cpumask, irq_data_get_affinity_mask(d)); in cpu_for_irq()
118 struct bcm6345_l1_chip *intc = irq_desc_get_handler_data(desc); in bcm6345_l1_irq_handle() local
124 cpu = intc->cpus[cpu_logical_map(smp_processor_id())]; in bcm6345_l1_irq_handle()
126 cpu = intc->cpus[0]; in bcm6345_l1_irq_handle()
131 for (idx = 0; idx < intc->n_words; idx++) { in bcm6345_l1_irq_handle()
137 pending = __raw_readl(cpu->map_base + reg_status(intc, idx)); in bcm6345_l1_irq_handle()
138 pending &= __raw_readl(cpu->map_base + reg_enable(intc, idx)); in bcm6345_l1_irq_handle()
141 irq = irq_linear_revmap(intc->domain, base + hwirq); in bcm6345_l1_irq_handle()
154 struct bcm6345_l1_chip *intc = irq_data_get_irq_chip_data(d); in __bcm6345_l1_unmask() local
157 unsigned int cpu_idx = cpu_for_irq(intc, d); in __bcm6345_l1_unmask()
159 intc->cpus[cpu_idx]->enable_cache[word] |= mask; in __bcm6345_l1_unmask()
160 __raw_writel(intc->cpus[cpu_idx]->enable_cache[word], in __bcm6345_l1_unmask()
161 intc->cpus[cpu_idx]->map_base + reg_enable(intc, word)); in __bcm6345_l1_unmask()
166 struct bcm6345_l1_chip *intc = irq_data_get_irq_chip_data(d); in __bcm6345_l1_mask() local
169 unsigned int cpu_idx = cpu_for_irq(intc, d); in __bcm6345_l1_mask()
171 intc->cpus[cpu_idx]->enable_cache[word] &= ~mask; in __bcm6345_l1_mask()
172 __raw_writel(intc->cpus[cpu_idx]->enable_cache[word], in __bcm6345_l1_mask()
173 intc->cpus[cpu_idx]->map_base + reg_enable(intc, word)); in __bcm6345_l1_mask()
178 struct bcm6345_l1_chip *intc = irq_data_get_irq_chip_data(d); in bcm6345_l1_unmask() local
181 raw_spin_lock_irqsave(&intc->lock, flags); in bcm6345_l1_unmask()
183 raw_spin_unlock_irqrestore(&intc->lock, flags); in bcm6345_l1_unmask()
188 struct bcm6345_l1_chip *intc = irq_data_get_irq_chip_data(d); in bcm6345_l1_mask() local
191 raw_spin_lock_irqsave(&intc->lock, flags); in bcm6345_l1_mask()
193 raw_spin_unlock_irqrestore(&intc->lock, flags); in bcm6345_l1_mask()
200 struct bcm6345_l1_chip *intc = irq_data_get_irq_chip_data(d); in bcm6345_l1_set_affinity() local
203 unsigned int old_cpu = cpu_for_irq(intc, d); in bcm6345_l1_set_affinity()
209 if (!cpumask_and(&valid, &intc->cpumask, dest)) in bcm6345_l1_set_affinity()
218 raw_spin_lock_irqsave(&intc->lock, flags); in bcm6345_l1_set_affinity()
220 enabled = intc->cpus[old_cpu]->enable_cache[word] & mask; in bcm6345_l1_set_affinity()
229 raw_spin_unlock_irqrestore(&intc->lock, flags); in bcm6345_l1_set_affinity()
238 struct bcm6345_l1_chip *intc) in bcm6345_l1_init_one() argument
250 if (!intc->n_words) in bcm6345_l1_init_one()
251 intc->n_words = n_words; in bcm6345_l1_init_one()
252 else if (intc->n_words != n_words) in bcm6345_l1_init_one()
255 cpu = intc->cpus[idx] = kzalloc(sizeof(*cpu) + n_words * sizeof(u32), in bcm6345_l1_init_one()
266 __raw_writel(0, cpu->map_base + reg_enable(intc, i)); in bcm6345_l1_init_one()
275 bcm6345_l1_irq_handle, intc); in bcm6345_l1_init_one()
305 struct bcm6345_l1_chip *intc; in bcm6345_l1_of_init() local
309 intc = kzalloc(sizeof(*intc), GFP_KERNEL); in bcm6345_l1_of_init()
310 if (!intc) in bcm6345_l1_of_init()
314 ret = bcm6345_l1_init_one(dn, idx, intc); in bcm6345_l1_of_init()
316 pr_err("failed to init intc L1 for cpu %d: %d\n", in bcm6345_l1_of_init()
319 cpumask_set_cpu(idx, &intc->cpumask); in bcm6345_l1_of_init()
322 if (!cpumask_weight(&intc->cpumask)) { in bcm6345_l1_of_init()
327 raw_spin_lock_init(&intc->lock); in bcm6345_l1_of_init()
329 intc->domain = irq_domain_add_linear(dn, IRQS_PER_WORD * intc->n_words, in bcm6345_l1_of_init()
331 intc); in bcm6345_l1_of_init()
332 if (!intc->domain) { in bcm6345_l1_of_init()
337 pr_info("registered BCM6345 L1 intc (IRQs: %d)\n", in bcm6345_l1_of_init()
338 IRQS_PER_WORD * intc->n_words); in bcm6345_l1_of_init()
339 for_each_cpu(idx, &intc->cpumask) { in bcm6345_l1_of_init()
340 struct bcm6345_l1_cpu *cpu = intc->cpus[idx]; in bcm6345_l1_of_init()
350 struct bcm6345_l1_cpu *cpu = intc->cpus[idx]; in bcm6345_l1_of_init()
359 kfree(intc); in bcm6345_l1_of_init()
363 IRQCHIP_DECLARE(bcm6345_l1, "brcm,bcm6345-l1-intc", bcm6345_l1_of_init);