Lines Matching refs:intc
84 struct bcm6345_l1_chip *intc; member
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()
119 struct bcm6345_l1_chip *intc = cpu->intc; in bcm6345_l1_irq_handle() local
125 for (idx = 0; idx < intc->n_words; idx++) { in bcm6345_l1_irq_handle()
130 pending = __raw_readl(cpu->map_base + reg_status(intc, idx)); in bcm6345_l1_irq_handle()
131 pending &= __raw_readl(cpu->map_base + reg_enable(intc, idx)); in bcm6345_l1_irq_handle()
134 if (generic_handle_domain_irq(intc->domain, base + hwirq)) in bcm6345_l1_irq_handle()
144 struct bcm6345_l1_chip *intc = irq_data_get_irq_chip_data(d); in __bcm6345_l1_unmask() local
147 unsigned int cpu_idx = cpu_for_irq(intc, d); in __bcm6345_l1_unmask()
149 intc->cpus[cpu_idx]->enable_cache[word] |= mask; in __bcm6345_l1_unmask()
150 __raw_writel(intc->cpus[cpu_idx]->enable_cache[word], in __bcm6345_l1_unmask()
151 intc->cpus[cpu_idx]->map_base + reg_enable(intc, word)); in __bcm6345_l1_unmask()
156 struct bcm6345_l1_chip *intc = irq_data_get_irq_chip_data(d); in __bcm6345_l1_mask() local
159 unsigned int cpu_idx = cpu_for_irq(intc, d); in __bcm6345_l1_mask()
161 intc->cpus[cpu_idx]->enable_cache[word] &= ~mask; in __bcm6345_l1_mask()
162 __raw_writel(intc->cpus[cpu_idx]->enable_cache[word], in __bcm6345_l1_mask()
163 intc->cpus[cpu_idx]->map_base + reg_enable(intc, word)); in __bcm6345_l1_mask()
168 struct bcm6345_l1_chip *intc = irq_data_get_irq_chip_data(d); in bcm6345_l1_unmask() local
171 raw_spin_lock_irqsave(&intc->lock, flags); in bcm6345_l1_unmask()
173 raw_spin_unlock_irqrestore(&intc->lock, flags); in bcm6345_l1_unmask()
178 struct bcm6345_l1_chip *intc = irq_data_get_irq_chip_data(d); in bcm6345_l1_mask() local
181 raw_spin_lock_irqsave(&intc->lock, flags); in bcm6345_l1_mask()
183 raw_spin_unlock_irqrestore(&intc->lock, flags); in bcm6345_l1_mask()
190 struct bcm6345_l1_chip *intc = irq_data_get_irq_chip_data(d); in bcm6345_l1_set_affinity() local
193 unsigned int old_cpu = cpu_for_irq(intc, d); in bcm6345_l1_set_affinity()
198 new_cpu = cpumask_first_and_and(&intc->cpumask, dest, cpu_online_mask); in bcm6345_l1_set_affinity()
204 raw_spin_lock_irqsave(&intc->lock, flags); in bcm6345_l1_set_affinity()
206 enabled = intc->cpus[old_cpu]->enable_cache[word] & mask; in bcm6345_l1_set_affinity()
215 raw_spin_unlock_irqrestore(&intc->lock, flags); in bcm6345_l1_set_affinity()
224 struct bcm6345_l1_chip *intc) in bcm6345_l1_init_one() argument
236 if (!intc->n_words) in bcm6345_l1_init_one()
237 intc->n_words = n_words; in bcm6345_l1_init_one()
238 else if (intc->n_words != n_words) in bcm6345_l1_init_one()
241 cpu = intc->cpus[idx] = kzalloc(struct_size(cpu, enable_cache, n_words), in bcm6345_l1_init_one()
246 cpu->intc = intc; in bcm6345_l1_init_one()
256 __raw_writel(0, cpu->map_base + reg_enable(intc, i)); in bcm6345_l1_init_one()
295 struct bcm6345_l1_chip *intc; in bcm6345_l1_of_init() local
299 intc = kzalloc(sizeof(*intc), GFP_KERNEL); in bcm6345_l1_of_init()
300 if (!intc) in bcm6345_l1_of_init()
304 ret = bcm6345_l1_init_one(dn, idx, intc); in bcm6345_l1_of_init()
309 cpumask_set_cpu(idx, &intc->cpumask); in bcm6345_l1_of_init()
312 if (cpumask_empty(&intc->cpumask)) { in bcm6345_l1_of_init()
317 raw_spin_lock_init(&intc->lock); in bcm6345_l1_of_init()
319 intc->domain = irq_domain_add_linear(dn, IRQS_PER_WORD * intc->n_words, in bcm6345_l1_of_init()
321 intc); in bcm6345_l1_of_init()
322 if (!intc->domain) { in bcm6345_l1_of_init()
328 IRQS_PER_WORD * intc->n_words); in bcm6345_l1_of_init()
329 for_each_cpu(idx, &intc->cpumask) { in bcm6345_l1_of_init()
330 struct bcm6345_l1_cpu *cpu = intc->cpus[idx]; in bcm6345_l1_of_init()
339 struct bcm6345_l1_cpu *cpu = intc->cpus[idx]; in bcm6345_l1_of_init()
348 kfree(intc); in bcm6345_l1_of_init()