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