Lines Matching refs:intc

79 static inline unsigned int reg_status(struct bcm7038_l1_chip *intc,  in reg_status()  argument
82 return (0 * intc->n_words + word) * sizeof(u32); in reg_status()
85 static inline unsigned int reg_mask_status(struct bcm7038_l1_chip *intc, in reg_mask_status() argument
88 return (1 * intc->n_words + word) * sizeof(u32); in reg_mask_status()
91 static inline unsigned int reg_mask_set(struct bcm7038_l1_chip *intc, in reg_mask_set() argument
94 return (2 * intc->n_words + word) * sizeof(u32); in reg_mask_set()
97 static inline unsigned int reg_mask_clr(struct bcm7038_l1_chip *intc, in reg_mask_clr() argument
100 return (3 * intc->n_words + word) * sizeof(u32); in reg_mask_clr()
121 struct bcm7038_l1_chip *intc = irq_desc_get_handler_data(desc); in bcm7038_l1_irq_handle() local
127 cpu = intc->cpus[cpu_logical_map(smp_processor_id())]; in bcm7038_l1_irq_handle()
129 cpu = intc->cpus[0]; in bcm7038_l1_irq_handle()
134 for (idx = 0; idx < intc->n_words; idx++) { in bcm7038_l1_irq_handle()
139 raw_spin_lock_irqsave(&intc->lock, flags); in bcm7038_l1_irq_handle()
140 pending = l1_readl(cpu->map_base + reg_status(intc, idx)) & in bcm7038_l1_irq_handle()
142 raw_spin_unlock_irqrestore(&intc->lock, flags); in bcm7038_l1_irq_handle()
145 generic_handle_domain_irq(intc->domain, base + hwirq); in bcm7038_l1_irq_handle()
153 struct bcm7038_l1_chip *intc = irq_data_get_irq_chip_data(d); in __bcm7038_l1_unmask() local
157 intc->cpus[cpu_idx]->mask_cache[word] &= ~mask; in __bcm7038_l1_unmask()
158 l1_writel(mask, intc->cpus[cpu_idx]->map_base + in __bcm7038_l1_unmask()
159 reg_mask_clr(intc, word)); in __bcm7038_l1_unmask()
164 struct bcm7038_l1_chip *intc = irq_data_get_irq_chip_data(d); in __bcm7038_l1_mask() local
168 intc->cpus[cpu_idx]->mask_cache[word] |= mask; in __bcm7038_l1_mask()
169 l1_writel(mask, intc->cpus[cpu_idx]->map_base + in __bcm7038_l1_mask()
170 reg_mask_set(intc, word)); in __bcm7038_l1_mask()
175 struct bcm7038_l1_chip *intc = irq_data_get_irq_chip_data(d); in bcm7038_l1_unmask() local
178 raw_spin_lock_irqsave(&intc->lock, flags); in bcm7038_l1_unmask()
179 __bcm7038_l1_unmask(d, intc->affinity[d->hwirq]); in bcm7038_l1_unmask()
180 raw_spin_unlock_irqrestore(&intc->lock, flags); in bcm7038_l1_unmask()
185 struct bcm7038_l1_chip *intc = irq_data_get_irq_chip_data(d); in bcm7038_l1_mask() local
188 raw_spin_lock_irqsave(&intc->lock, flags); in bcm7038_l1_mask()
189 __bcm7038_l1_mask(d, intc->affinity[d->hwirq]); in bcm7038_l1_mask()
190 raw_spin_unlock_irqrestore(&intc->lock, flags); in bcm7038_l1_mask()
198 struct bcm7038_l1_chip *intc = irq_data_get_irq_chip_data(d); in bcm7038_l1_set_affinity() local
206 raw_spin_lock_irqsave(&intc->lock, flags); in bcm7038_l1_set_affinity()
208 was_disabled = !!(intc->cpus[intc->affinity[hw]]->mask_cache[word] & in bcm7038_l1_set_affinity()
210 __bcm7038_l1_mask(d, intc->affinity[hw]); in bcm7038_l1_set_affinity()
211 intc->affinity[hw] = first_cpu; in bcm7038_l1_set_affinity()
215 raw_spin_unlock_irqrestore(&intc->lock, flags); in bcm7038_l1_set_affinity()
224 struct bcm7038_l1_chip *intc) in bcm7038_l1_init_one() argument
239 else if (!intc->n_words) in bcm7038_l1_init_one()
240 intc->n_words = n_words; in bcm7038_l1_init_one()
241 else if (intc->n_words != n_words) in bcm7038_l1_init_one()
245 intc->irq_fwd_mask, n_words); in bcm7038_l1_init_one()
252 cpu = intc->cpus[idx] = kzalloc(sizeof(*cpu) + n_words * sizeof(u32), in bcm7038_l1_init_one()
262 l1_writel(~intc->irq_fwd_mask[i], in bcm7038_l1_init_one()
263 cpu->map_base + reg_mask_set(intc, i)); in bcm7038_l1_init_one()
264 l1_writel(intc->irq_fwd_mask[i], in bcm7038_l1_init_one()
265 cpu->map_base + reg_mask_clr(intc, i)); in bcm7038_l1_init_one()
266 cpu->mask_cache[i] = ~intc->irq_fwd_mask[i]; in bcm7038_l1_init_one()
279 intc); in bcm7038_l1_init_one()
297 struct bcm7038_l1_chip *intc; in bcm7038_l1_suspend() local
308 list_for_each_entry(intc, &bcm7038_l1_intcs_list, list) { in bcm7038_l1_suspend()
309 for (word = 0; word < intc->n_words; word++) { in bcm7038_l1_suspend()
310 val = intc->wake_mask[word] | intc->irq_fwd_mask[word]; in bcm7038_l1_suspend()
312 intc->cpus[boot_cpu]->map_base + reg_mask_set(intc, word)); in bcm7038_l1_suspend()
314 intc->cpus[boot_cpu]->map_base + reg_mask_clr(intc, word)); in bcm7038_l1_suspend()
323 struct bcm7038_l1_chip *intc; in bcm7038_l1_resume() local
332 list_for_each_entry(intc, &bcm7038_l1_intcs_list, list) { in bcm7038_l1_resume()
333 for (word = 0; word < intc->n_words; word++) { in bcm7038_l1_resume()
334 l1_writel(intc->cpus[boot_cpu]->mask_cache[word], in bcm7038_l1_resume()
335 intc->cpus[boot_cpu]->map_base + reg_mask_set(intc, word)); in bcm7038_l1_resume()
336 l1_writel(~intc->cpus[boot_cpu]->mask_cache[word], in bcm7038_l1_resume()
337 intc->cpus[boot_cpu]->map_base + reg_mask_clr(intc, word)); in bcm7038_l1_resume()
349 struct bcm7038_l1_chip *intc = irq_data_get_irq_chip_data(d); in bcm7038_l1_set_wake() local
354 raw_spin_lock_irqsave(&intc->lock, flags); in bcm7038_l1_set_wake()
356 intc->wake_mask[word] |= mask; in bcm7038_l1_set_wake()
358 intc->wake_mask[word] &= ~mask; in bcm7038_l1_set_wake()
359 raw_spin_unlock_irqrestore(&intc->lock, flags); in bcm7038_l1_set_wake()
380 struct bcm7038_l1_chip *intc = d->host_data; in bcm7038_l1_map() local
384 if (intc->irq_fwd_mask[word] & mask) in bcm7038_l1_map()
401 struct bcm7038_l1_chip *intc; in bcm7038_l1_of_init() local
404 intc = kzalloc(sizeof(*intc), GFP_KERNEL); in bcm7038_l1_of_init()
405 if (!intc) in bcm7038_l1_of_init()
408 raw_spin_lock_init(&intc->lock); in bcm7038_l1_of_init()
410 ret = bcm7038_l1_init_one(dn, idx, intc); in bcm7038_l1_of_init()
419 intc->domain = irq_domain_add_linear(dn, IRQS_PER_WORD * intc->n_words, in bcm7038_l1_of_init()
421 intc); in bcm7038_l1_of_init()
422 if (!intc->domain) { in bcm7038_l1_of_init()
430 list_add_tail(&intc->list, &bcm7038_l1_intcs_list); in bcm7038_l1_of_init()
438 dn, IRQS_PER_WORD * intc->n_words); in bcm7038_l1_of_init()
444 struct bcm7038_l1_cpu *cpu = intc->cpus[idx]; in bcm7038_l1_of_init()
453 kfree(intc); in bcm7038_l1_of_init()