Lines Matching refs:intc

84 	struct bcm6345_l1_chip	*intc;
90 static inline unsigned int reg_enable(struct bcm6345_l1_chip *intc,
94 return (1 * intc->n_words - word - 1) * sizeof(u32);
96 return (0 * intc->n_words + word) * sizeof(u32);
100 static inline unsigned int reg_status(struct bcm6345_l1_chip *intc,
104 return (2 * intc->n_words - word - 1) * sizeof(u32);
106 return (1 * intc->n_words + word) * sizeof(u32);
110 static inline unsigned int cpu_for_irq(struct bcm6345_l1_chip *intc,
113 return cpumask_first_and(&intc->cpumask, irq_data_get_affinity_mask(d));
119 struct bcm6345_l1_chip *intc = cpu->intc;
125 for (idx = 0; idx < intc->n_words; idx++) {
130 pending = __raw_readl(cpu->map_base + reg_status(intc, idx));
131 pending &= __raw_readl(cpu->map_base + reg_enable(intc, idx));
134 if (generic_handle_domain_irq(intc->domain, base + hwirq))
144 struct bcm6345_l1_chip *intc = irq_data_get_irq_chip_data(d);
147 unsigned int cpu_idx = cpu_for_irq(intc, d);
149 intc->cpus[cpu_idx]->enable_cache[word] |= mask;
150 __raw_writel(intc->cpus[cpu_idx]->enable_cache[word],
151 intc->cpus[cpu_idx]->map_base + reg_enable(intc, word));
156 struct bcm6345_l1_chip *intc = irq_data_get_irq_chip_data(d);
159 unsigned int cpu_idx = cpu_for_irq(intc, d);
161 intc->cpus[cpu_idx]->enable_cache[word] &= ~mask;
162 __raw_writel(intc->cpus[cpu_idx]->enable_cache[word],
163 intc->cpus[cpu_idx]->map_base + reg_enable(intc, word));
168 struct bcm6345_l1_chip *intc = irq_data_get_irq_chip_data(d);
171 raw_spin_lock_irqsave(&intc->lock, flags);
173 raw_spin_unlock_irqrestore(&intc->lock, flags);
178 struct bcm6345_l1_chip *intc = irq_data_get_irq_chip_data(d);
181 raw_spin_lock_irqsave(&intc->lock, flags);
183 raw_spin_unlock_irqrestore(&intc->lock, flags);
190 struct bcm6345_l1_chip *intc = irq_data_get_irq_chip_data(d);
193 unsigned int old_cpu = cpu_for_irq(intc, d);
199 if (!cpumask_and(&valid, &intc->cpumask, dest))
208 raw_spin_lock_irqsave(&intc->lock, flags);
210 enabled = intc->cpus[old_cpu]->enable_cache[word] & mask;
219 raw_spin_unlock_irqrestore(&intc->lock, flags);
228 struct bcm6345_l1_chip *intc)
240 if (!intc->n_words)
241 intc->n_words = n_words;
242 else if (intc->n_words != n_words)
245 cpu = intc->cpus[idx] = kzalloc(sizeof(*cpu) + n_words * sizeof(u32),
250 cpu->intc = intc;
256 pr_err("failed to request intc memory");
260 __raw_writel(0, cpu->map_base + reg_enable(intc, i));
299 struct bcm6345_l1_chip *intc;
303 intc = kzalloc(sizeof(*intc), GFP_KERNEL);
304 if (!intc)
308 ret = bcm6345_l1_init_one(dn, idx, intc);
310 pr_err("failed to init intc L1 for cpu %d: %d\n",
313 cpumask_set_cpu(idx, &intc->cpumask);
316 if (cpumask_empty(&intc->cpumask)) {
321 raw_spin_lock_init(&intc->lock);
323 intc->domain = irq_domain_add_linear(dn, IRQS_PER_WORD * intc->n_words,
325 intc);
326 if (!intc->domain) {
331 pr_info("registered BCM6345 L1 intc (IRQs: %d)\n",
332 IRQS_PER_WORD * intc->n_words);
333 for_each_cpu(idx, &intc->cpumask) {
334 struct bcm6345_l1_cpu *cpu = intc->cpus[idx];
343 struct bcm6345_l1_cpu *cpu = intc->cpus[idx];
352 kfree(intc);
356 IRQCHIP_DECLARE(bcm6345_l1, "brcm,bcm6345-l1-intc", bcm6345_l1_of_init);