Lines Matching refs:intc

80 static inline unsigned int reg_status(struct bcm7038_l1_chip *intc,  in reg_status()  argument
83 return (0 * intc->n_words + word) * sizeof(u32); in reg_status()
86 static inline unsigned int reg_mask_status(struct bcm7038_l1_chip *intc, in reg_mask_status() argument
89 return (1 * intc->n_words + word) * sizeof(u32); in reg_mask_status()
92 static inline unsigned int reg_mask_set(struct bcm7038_l1_chip *intc, in reg_mask_set() argument
95 return (2 * intc->n_words + word) * sizeof(u32); in reg_mask_set()
98 static inline unsigned int reg_mask_clr(struct bcm7038_l1_chip *intc, in reg_mask_clr() argument
101 return (3 * intc->n_words + word) * sizeof(u32); in reg_mask_clr()
122 struct bcm7038_l1_chip *intc = irq_desc_get_handler_data(desc); in bcm7038_l1_irq_handle() local
128 cpu = intc->cpus[cpu_logical_map(smp_processor_id())]; in bcm7038_l1_irq_handle()
130 cpu = intc->cpus[0]; in bcm7038_l1_irq_handle()
135 for (idx = 0; idx < intc->n_words; idx++) { in bcm7038_l1_irq_handle()
140 raw_spin_lock_irqsave(&intc->lock, flags); in bcm7038_l1_irq_handle()
141 pending = l1_readl(cpu->map_base + reg_status(intc, idx)) & in bcm7038_l1_irq_handle()
143 raw_spin_unlock_irqrestore(&intc->lock, flags); in bcm7038_l1_irq_handle()
146 generic_handle_domain_irq(intc->domain, base + hwirq); in bcm7038_l1_irq_handle()
154 struct bcm7038_l1_chip *intc = irq_data_get_irq_chip_data(d); in __bcm7038_l1_unmask() local
158 intc->cpus[cpu_idx]->mask_cache[word] &= ~mask; in __bcm7038_l1_unmask()
159 l1_writel(mask, intc->cpus[cpu_idx]->map_base + in __bcm7038_l1_unmask()
160 reg_mask_clr(intc, word)); in __bcm7038_l1_unmask()
165 struct bcm7038_l1_chip *intc = irq_data_get_irq_chip_data(d); in __bcm7038_l1_mask() local
169 intc->cpus[cpu_idx]->mask_cache[word] |= mask; in __bcm7038_l1_mask()
170 l1_writel(mask, intc->cpus[cpu_idx]->map_base + in __bcm7038_l1_mask()
171 reg_mask_set(intc, word)); in __bcm7038_l1_mask()
176 struct bcm7038_l1_chip *intc = irq_data_get_irq_chip_data(d); in bcm7038_l1_unmask() local
179 raw_spin_lock_irqsave(&intc->lock, flags); in bcm7038_l1_unmask()
180 __bcm7038_l1_unmask(d, intc->affinity[d->hwirq]); in bcm7038_l1_unmask()
181 raw_spin_unlock_irqrestore(&intc->lock, flags); in bcm7038_l1_unmask()
186 struct bcm7038_l1_chip *intc = irq_data_get_irq_chip_data(d); in bcm7038_l1_mask() local
189 raw_spin_lock_irqsave(&intc->lock, flags); in bcm7038_l1_mask()
190 __bcm7038_l1_mask(d, intc->affinity[d->hwirq]); in bcm7038_l1_mask()
191 raw_spin_unlock_irqrestore(&intc->lock, flags); in bcm7038_l1_mask()
199 struct bcm7038_l1_chip *intc = irq_data_get_irq_chip_data(d); in bcm7038_l1_set_affinity() local
207 raw_spin_lock_irqsave(&intc->lock, flags); in bcm7038_l1_set_affinity()
209 was_disabled = !!(intc->cpus[intc->affinity[hw]]->mask_cache[word] & in bcm7038_l1_set_affinity()
211 __bcm7038_l1_mask(d, intc->affinity[hw]); in bcm7038_l1_set_affinity()
212 intc->affinity[hw] = first_cpu; in bcm7038_l1_set_affinity()
216 raw_spin_unlock_irqrestore(&intc->lock, flags); in bcm7038_l1_set_affinity()
225 struct bcm7038_l1_chip *intc) in bcm7038_l1_init_one() argument
240 else if (!intc->n_words) in bcm7038_l1_init_one()
241 intc->n_words = n_words; in bcm7038_l1_init_one()
242 else if (intc->n_words != n_words) in bcm7038_l1_init_one()
246 intc->irq_fwd_mask, n_words); in bcm7038_l1_init_one()
253 cpu = intc->cpus[idx] = kzalloc(sizeof(*cpu) + n_words * sizeof(u32), in bcm7038_l1_init_one()
263 l1_writel(~intc->irq_fwd_mask[i], in bcm7038_l1_init_one()
264 cpu->map_base + reg_mask_set(intc, i)); in bcm7038_l1_init_one()
265 l1_writel(intc->irq_fwd_mask[i], in bcm7038_l1_init_one()
266 cpu->map_base + reg_mask_clr(intc, i)); in bcm7038_l1_init_one()
267 cpu->mask_cache[i] = ~intc->irq_fwd_mask[i]; in bcm7038_l1_init_one()
280 intc); in bcm7038_l1_init_one()
298 struct bcm7038_l1_chip *intc; in bcm7038_l1_suspend() local
309 list_for_each_entry(intc, &bcm7038_l1_intcs_list, list) { in bcm7038_l1_suspend()
310 for (word = 0; word < intc->n_words; word++) { in bcm7038_l1_suspend()
311 val = intc->wake_mask[word] | intc->irq_fwd_mask[word]; in bcm7038_l1_suspend()
313 intc->cpus[boot_cpu]->map_base + reg_mask_set(intc, word)); in bcm7038_l1_suspend()
315 intc->cpus[boot_cpu]->map_base + reg_mask_clr(intc, word)); in bcm7038_l1_suspend()
324 struct bcm7038_l1_chip *intc; in bcm7038_l1_resume() local
333 list_for_each_entry(intc, &bcm7038_l1_intcs_list, list) { in bcm7038_l1_resume()
334 for (word = 0; word < intc->n_words; word++) { in bcm7038_l1_resume()
335 l1_writel(intc->cpus[boot_cpu]->mask_cache[word], in bcm7038_l1_resume()
336 intc->cpus[boot_cpu]->map_base + reg_mask_set(intc, word)); in bcm7038_l1_resume()
337 l1_writel(~intc->cpus[boot_cpu]->mask_cache[word], in bcm7038_l1_resume()
338 intc->cpus[boot_cpu]->map_base + reg_mask_clr(intc, word)); in bcm7038_l1_resume()
350 struct bcm7038_l1_chip *intc = irq_data_get_irq_chip_data(d); in bcm7038_l1_set_wake() local
355 raw_spin_lock_irqsave(&intc->lock, flags); in bcm7038_l1_set_wake()
357 intc->wake_mask[word] |= mask; in bcm7038_l1_set_wake()
359 intc->wake_mask[word] &= ~mask; in bcm7038_l1_set_wake()
360 raw_spin_unlock_irqrestore(&intc->lock, flags); in bcm7038_l1_set_wake()
381 struct bcm7038_l1_chip *intc = d->host_data; in bcm7038_l1_map() local
385 if (intc->irq_fwd_mask[word] & mask) in bcm7038_l1_map()
402 struct bcm7038_l1_chip *intc; in bcm7038_l1_of_init() local
405 intc = kzalloc(sizeof(*intc), GFP_KERNEL); in bcm7038_l1_of_init()
406 if (!intc) in bcm7038_l1_of_init()
409 raw_spin_lock_init(&intc->lock); in bcm7038_l1_of_init()
411 ret = bcm7038_l1_init_one(dn, idx, intc); in bcm7038_l1_of_init()
420 intc->domain = irq_domain_add_linear(dn, IRQS_PER_WORD * intc->n_words, in bcm7038_l1_of_init()
422 intc); in bcm7038_l1_of_init()
423 if (!intc->domain) { in bcm7038_l1_of_init()
431 list_add_tail(&intc->list, &bcm7038_l1_intcs_list); in bcm7038_l1_of_init()
439 dn, IRQS_PER_WORD * intc->n_words); in bcm7038_l1_of_init()
445 struct bcm7038_l1_cpu *cpu = intc->cpus[idx]; in bcm7038_l1_of_init()
454 kfree(intc); in bcm7038_l1_of_init()