Lines Matching full:intc

83 static inline unsigned int reg_status(struct bcm7038_l1_chip *intc,  in reg_status()  argument
86 return (0 * intc->n_words + word) * sizeof(u32); in reg_status()
89 static inline unsigned int reg_mask_status(struct bcm7038_l1_chip *intc, in reg_mask_status() argument
92 return (1 * intc->n_words + word) * sizeof(u32); in reg_mask_status()
95 static inline unsigned int reg_mask_set(struct bcm7038_l1_chip *intc, in reg_mask_set() argument
98 return (2 * intc->n_words + word) * sizeof(u32); in reg_mask_set()
101 static inline unsigned int reg_mask_clr(struct bcm7038_l1_chip *intc, in reg_mask_clr() argument
104 return (3 * intc->n_words + word) * sizeof(u32); in reg_mask_clr()
125 struct bcm7038_l1_chip *intc = irq_desc_get_handler_data(desc); in bcm7038_l1_irq_handle() local
131 cpu = intc->cpus[cpu_logical_map(smp_processor_id())]; in bcm7038_l1_irq_handle()
133 cpu = intc->cpus[0]; in bcm7038_l1_irq_handle()
138 for (idx = 0; idx < intc->n_words; idx++) { in bcm7038_l1_irq_handle()
143 raw_spin_lock_irqsave(&intc->lock, flags); in bcm7038_l1_irq_handle()
144 pending = l1_readl(cpu->map_base + reg_status(intc, idx)) & in bcm7038_l1_irq_handle()
146 raw_spin_unlock_irqrestore(&intc->lock, flags); in bcm7038_l1_irq_handle()
149 generic_handle_irq(irq_find_mapping(intc->domain, in bcm7038_l1_irq_handle()
159 struct bcm7038_l1_chip *intc = irq_data_get_irq_chip_data(d); in __bcm7038_l1_unmask() local
163 intc->cpus[cpu_idx]->mask_cache[word] &= ~mask; in __bcm7038_l1_unmask()
164 l1_writel(mask, intc->cpus[cpu_idx]->map_base + in __bcm7038_l1_unmask()
165 reg_mask_clr(intc, word)); in __bcm7038_l1_unmask()
170 struct bcm7038_l1_chip *intc = irq_data_get_irq_chip_data(d); in __bcm7038_l1_mask() local
174 intc->cpus[cpu_idx]->mask_cache[word] |= mask; in __bcm7038_l1_mask()
175 l1_writel(mask, intc->cpus[cpu_idx]->map_base + in __bcm7038_l1_mask()
176 reg_mask_set(intc, word)); in __bcm7038_l1_mask()
181 struct bcm7038_l1_chip *intc = irq_data_get_irq_chip_data(d); in bcm7038_l1_unmask() local
184 raw_spin_lock_irqsave(&intc->lock, flags); in bcm7038_l1_unmask()
185 __bcm7038_l1_unmask(d, intc->affinity[d->hwirq]); in bcm7038_l1_unmask()
186 raw_spin_unlock_irqrestore(&intc->lock, flags); in bcm7038_l1_unmask()
191 struct bcm7038_l1_chip *intc = irq_data_get_irq_chip_data(d); in bcm7038_l1_mask() local
194 raw_spin_lock_irqsave(&intc->lock, flags); in bcm7038_l1_mask()
195 __bcm7038_l1_mask(d, intc->affinity[d->hwirq]); in bcm7038_l1_mask()
196 raw_spin_unlock_irqrestore(&intc->lock, flags); in bcm7038_l1_mask()
203 struct bcm7038_l1_chip *intc = irq_data_get_irq_chip_data(d); in bcm7038_l1_set_affinity() local
211 raw_spin_lock_irqsave(&intc->lock, flags); in bcm7038_l1_set_affinity()
213 was_disabled = !!(intc->cpus[intc->affinity[hw]]->mask_cache[word] & in bcm7038_l1_set_affinity()
215 __bcm7038_l1_mask(d, intc->affinity[hw]); in bcm7038_l1_set_affinity()
216 intc->affinity[hw] = first_cpu; in bcm7038_l1_set_affinity()
220 raw_spin_unlock_irqrestore(&intc->lock, flags); in bcm7038_l1_set_affinity()
255 struct bcm7038_l1_chip *intc) in bcm7038_l1_init_one() argument
270 else if (!intc->n_words) in bcm7038_l1_init_one()
271 intc->n_words = n_words; in bcm7038_l1_init_one()
272 else if (intc->n_words != n_words) in bcm7038_l1_init_one()
276 intc->irq_fwd_mask, n_words); in bcm7038_l1_init_one()
283 cpu = intc->cpus[idx] = kzalloc(sizeof(*cpu) + n_words * sizeof(u32), in bcm7038_l1_init_one()
293 l1_writel(~intc->irq_fwd_mask[i], in bcm7038_l1_init_one()
294 cpu->map_base + reg_mask_set(intc, i)); in bcm7038_l1_init_one()
295 l1_writel(intc->irq_fwd_mask[i], in bcm7038_l1_init_one()
296 cpu->map_base + reg_mask_clr(intc, i)); in bcm7038_l1_init_one()
297 cpu->mask_cache[i] = ~intc->irq_fwd_mask[i]; in bcm7038_l1_init_one()
310 intc); in bcm7038_l1_init_one()
328 struct bcm7038_l1_chip *intc; in bcm7038_l1_suspend() local
339 list_for_each_entry(intc, &bcm7038_l1_intcs_list, list) { in bcm7038_l1_suspend()
340 for (word = 0; word < intc->n_words; word++) { in bcm7038_l1_suspend()
341 val = intc->wake_mask[word] | intc->irq_fwd_mask[word]; in bcm7038_l1_suspend()
343 intc->cpus[boot_cpu]->map_base + reg_mask_set(intc, word)); in bcm7038_l1_suspend()
345 intc->cpus[boot_cpu]->map_base + reg_mask_clr(intc, word)); in bcm7038_l1_suspend()
354 struct bcm7038_l1_chip *intc; in bcm7038_l1_resume() local
363 list_for_each_entry(intc, &bcm7038_l1_intcs_list, list) { in bcm7038_l1_resume()
364 for (word = 0; word < intc->n_words; word++) { in bcm7038_l1_resume()
365 l1_writel(intc->cpus[boot_cpu]->mask_cache[word], in bcm7038_l1_resume()
366 intc->cpus[boot_cpu]->map_base + reg_mask_set(intc, word)); in bcm7038_l1_resume()
367 l1_writel(~intc->cpus[boot_cpu]->mask_cache[word], in bcm7038_l1_resume()
368 intc->cpus[boot_cpu]->map_base + reg_mask_clr(intc, word)); in bcm7038_l1_resume()
380 struct bcm7038_l1_chip *intc = irq_data_get_irq_chip_data(d); in bcm7038_l1_set_wake() local
385 raw_spin_lock_irqsave(&intc->lock, flags); in bcm7038_l1_set_wake()
387 intc->wake_mask[word] |= mask; in bcm7038_l1_set_wake()
389 intc->wake_mask[word] &= ~mask; in bcm7038_l1_set_wake()
390 raw_spin_unlock_irqrestore(&intc->lock, flags); in bcm7038_l1_set_wake()
412 struct bcm7038_l1_chip *intc = d->host_data; in bcm7038_l1_map() local
416 if (intc->irq_fwd_mask[word] & mask) in bcm7038_l1_map()
433 struct bcm7038_l1_chip *intc; in bcm7038_l1_of_init() local
436 intc = kzalloc(sizeof(*intc), GFP_KERNEL); in bcm7038_l1_of_init()
437 if (!intc) in bcm7038_l1_of_init()
440 raw_spin_lock_init(&intc->lock); in bcm7038_l1_of_init()
442 ret = bcm7038_l1_init_one(dn, idx, intc); in bcm7038_l1_of_init()
446 pr_err("failed to remap intc L1 registers\n"); in bcm7038_l1_of_init()
451 intc->domain = irq_domain_add_linear(dn, IRQS_PER_WORD * intc->n_words, in bcm7038_l1_of_init()
453 intc); in bcm7038_l1_of_init()
454 if (!intc->domain) { in bcm7038_l1_of_init()
462 list_add_tail(&intc->list, &bcm7038_l1_intcs_list); in bcm7038_l1_of_init()
469 pr_info("registered BCM7038 L1 intc (%pOF, IRQs: %d)\n", in bcm7038_l1_of_init()
470 dn, IRQS_PER_WORD * intc->n_words); in bcm7038_l1_of_init()
476 struct bcm7038_l1_cpu *cpu = intc->cpus[idx]; in bcm7038_l1_of_init()
485 kfree(intc); in bcm7038_l1_of_init()
489 IRQCHIP_DECLARE(bcm7038_l1, "brcm,bcm7038-l1-intc", bcm7038_l1_of_init);