• Home
  • Raw
  • Download

Lines Matching +full:cpu +full:- +full:intc

17  * ENABLE/STATUS words are packed next to each other for each CPU:
22 * 0x1000_0028: CPU0_W0_STATUS IRQs 31-63
23 * 0x1000_002c: CPU0_W1_STATUS IRQs 0-31
26 * 0x1000_0038: CPU1_W0_STATUS IRQs 31-63
27 * 0x1000_003c: CPU1_W1_STATUS IRQs 0-31
34 * 0x1000_0030: CPU0_W0_STATUS IRQs 96-127
35 * 0x1000_0034: CPU0_W1_STATUS IRQs 64-95
36 * 0x1000_0038: CPU0_W2_STATUS IRQs 32-63
37 * 0x1000_003c: CPU0_W3_STATUS IRQs 0-31
42 * 0x1000_0050: CPU1_W0_STATUS IRQs 96-127
43 * 0x1000_0054: CPU1_W1_STATUS IRQs 64-95
44 * 0x1000_0058: CPU1_W2_STATUS IRQs 32-63
45 * 0x1000_005c: CPU1_W3_STATUS IRQs 0-31
47 * IRQs are numbered in CPU native endian order
48 * (which is big-endian in these examples)
93 static inline unsigned int reg_enable(struct bcm6345_l1_chip *intc, in reg_enable() argument
97 return (1 * intc->n_words - word - 1) * sizeof(u32); in reg_enable()
99 return (0 * intc->n_words + word) * sizeof(u32); in reg_enable()
103 static inline unsigned int reg_status(struct bcm6345_l1_chip *intc, in reg_status() argument
107 return (2 * intc->n_words - word - 1) * sizeof(u32); in reg_status()
109 return (1 * intc->n_words + word) * sizeof(u32); in reg_status()
113 static inline unsigned int cpu_for_irq(struct bcm6345_l1_chip *intc, in cpu_for_irq() argument
116 return cpumask_first_and(&intc->cpumask, irq_data_get_affinity_mask(d)); in cpu_for_irq()
121 struct bcm6345_l1_chip *intc = irq_desc_get_handler_data(desc); in bcm6345_l1_irq_handle() local
122 struct bcm6345_l1_cpu *cpu; in bcm6345_l1_irq_handle() local
127 cpu = intc->cpus[cpu_logical_map(smp_processor_id())]; in bcm6345_l1_irq_handle()
129 cpu = intc->cpus[0]; in bcm6345_l1_irq_handle()
134 for (idx = 0; idx < intc->n_words; idx++) { in bcm6345_l1_irq_handle()
140 pending = __raw_readl(cpu->map_base + reg_status(intc, idx)); in bcm6345_l1_irq_handle()
141 pending &= __raw_readl(cpu->map_base + reg_enable(intc, idx)); in bcm6345_l1_irq_handle()
144 irq = irq_linear_revmap(intc->domain, base + hwirq); in bcm6345_l1_irq_handle()
157 struct bcm6345_l1_chip *intc = irq_data_get_irq_chip_data(d); in __bcm6345_l1_unmask() local
158 u32 word = d->hwirq / IRQS_PER_WORD; in __bcm6345_l1_unmask()
159 u32 mask = BIT(d->hwirq % IRQS_PER_WORD); in __bcm6345_l1_unmask()
160 unsigned int cpu_idx = cpu_for_irq(intc, d); in __bcm6345_l1_unmask()
162 intc->cpus[cpu_idx]->enable_cache[word] |= mask; in __bcm6345_l1_unmask()
163 __raw_writel(intc->cpus[cpu_idx]->enable_cache[word], in __bcm6345_l1_unmask()
164 intc->cpus[cpu_idx]->map_base + reg_enable(intc, word)); in __bcm6345_l1_unmask()
169 struct bcm6345_l1_chip *intc = irq_data_get_irq_chip_data(d); in __bcm6345_l1_mask() local
170 u32 word = d->hwirq / IRQS_PER_WORD; in __bcm6345_l1_mask()
171 u32 mask = BIT(d->hwirq % IRQS_PER_WORD); in __bcm6345_l1_mask()
172 unsigned int cpu_idx = cpu_for_irq(intc, d); in __bcm6345_l1_mask()
174 intc->cpus[cpu_idx]->enable_cache[word] &= ~mask; in __bcm6345_l1_mask()
175 __raw_writel(intc->cpus[cpu_idx]->enable_cache[word], in __bcm6345_l1_mask()
176 intc->cpus[cpu_idx]->map_base + reg_enable(intc, word)); in __bcm6345_l1_mask()
181 struct bcm6345_l1_chip *intc = irq_data_get_irq_chip_data(d); in bcm6345_l1_unmask() local
184 raw_spin_lock_irqsave(&intc->lock, flags); in bcm6345_l1_unmask()
186 raw_spin_unlock_irqrestore(&intc->lock, flags); in bcm6345_l1_unmask()
191 struct bcm6345_l1_chip *intc = irq_data_get_irq_chip_data(d); in bcm6345_l1_mask() local
194 raw_spin_lock_irqsave(&intc->lock, flags); in bcm6345_l1_mask()
196 raw_spin_unlock_irqrestore(&intc->lock, flags); in bcm6345_l1_mask()
203 struct bcm6345_l1_chip *intc = irq_data_get_irq_chip_data(d); in bcm6345_l1_set_affinity() local
204 u32 word = d->hwirq / IRQS_PER_WORD; in bcm6345_l1_set_affinity()
205 u32 mask = BIT(d->hwirq % IRQS_PER_WORD); in bcm6345_l1_set_affinity()
206 unsigned int old_cpu = cpu_for_irq(intc, d); in bcm6345_l1_set_affinity()
212 if (!cpumask_and(&valid, &intc->cpumask, dest)) in bcm6345_l1_set_affinity()
213 return -EINVAL; in bcm6345_l1_set_affinity()
217 return -EINVAL; in bcm6345_l1_set_affinity()
221 raw_spin_lock_irqsave(&intc->lock, flags); in bcm6345_l1_set_affinity()
223 enabled = intc->cpus[old_cpu]->enable_cache[word] & mask; in bcm6345_l1_set_affinity()
232 raw_spin_unlock_irqrestore(&intc->lock, flags); in bcm6345_l1_set_affinity()
241 struct bcm6345_l1_chip *intc) in bcm6345_l1_init_one() argument
245 struct bcm6345_l1_cpu *cpu; in bcm6345_l1_init_one() local
249 return -EINVAL; in bcm6345_l1_init_one()
253 if (!intc->n_words) in bcm6345_l1_init_one()
254 intc->n_words = n_words; in bcm6345_l1_init_one()
255 else if (intc->n_words != n_words) in bcm6345_l1_init_one()
256 return -EINVAL; in bcm6345_l1_init_one()
258 cpu = intc->cpus[idx] = kzalloc(sizeof(*cpu) + n_words * sizeof(u32), in bcm6345_l1_init_one()
260 if (!cpu) in bcm6345_l1_init_one()
261 return -ENOMEM; in bcm6345_l1_init_one()
263 cpu->map_base = ioremap(res.start, sz); in bcm6345_l1_init_one()
264 if (!cpu->map_base) in bcm6345_l1_init_one()
265 return -ENOMEM; in bcm6345_l1_init_one()
268 cpu->enable_cache[i] = 0; in bcm6345_l1_init_one()
269 __raw_writel(0, cpu->map_base + reg_enable(intc, i)); in bcm6345_l1_init_one()
272 cpu->parent_irq = irq_of_parse_and_map(dn, idx); in bcm6345_l1_init_one()
273 if (!cpu->parent_irq) { in bcm6345_l1_init_one()
274 pr_err("failed to map parent interrupt %d\n", cpu->parent_irq); in bcm6345_l1_init_one()
275 return -EINVAL; in bcm6345_l1_init_one()
277 irq_set_chained_handler_and_data(cpu->parent_irq, in bcm6345_l1_init_one()
278 bcm6345_l1_irq_handle, intc); in bcm6345_l1_init_one()
284 .name = "bcm6345-l1",
295 irq_set_chip_data(virq, d->host_data); in bcm6345_l1_map()
308 struct bcm6345_l1_chip *intc; in bcm6345_l1_of_init() local
312 intc = kzalloc(sizeof(*intc), GFP_KERNEL); in bcm6345_l1_of_init()
313 if (!intc) in bcm6345_l1_of_init()
314 return -ENOMEM; in bcm6345_l1_of_init()
317 ret = bcm6345_l1_init_one(dn, idx, intc); in bcm6345_l1_of_init()
319 pr_err("failed to init intc L1 for cpu %d: %d\n", in bcm6345_l1_of_init()
322 cpumask_set_cpu(idx, &intc->cpumask); in bcm6345_l1_of_init()
325 if (!cpumask_weight(&intc->cpumask)) { in bcm6345_l1_of_init()
326 ret = -ENODEV; in bcm6345_l1_of_init()
330 raw_spin_lock_init(&intc->lock); in bcm6345_l1_of_init()
332 intc->domain = irq_domain_add_linear(dn, IRQS_PER_WORD * intc->n_words, in bcm6345_l1_of_init()
334 intc); in bcm6345_l1_of_init()
335 if (!intc->domain) { in bcm6345_l1_of_init()
336 ret = -ENOMEM; in bcm6345_l1_of_init()
340 pr_info("registered BCM6345 L1 intc (IRQs: %d)\n", in bcm6345_l1_of_init()
341 IRQS_PER_WORD * intc->n_words); in bcm6345_l1_of_init()
342 for_each_cpu(idx, &intc->cpumask) { in bcm6345_l1_of_init()
343 struct bcm6345_l1_cpu *cpu = intc->cpus[idx]; in bcm6345_l1_of_init() local
345 pr_info(" CPU%u at MMIO 0x%p (irq = %d)\n", idx, in bcm6345_l1_of_init()
346 cpu->map_base, cpu->parent_irq); in bcm6345_l1_of_init()
353 struct bcm6345_l1_cpu *cpu = intc->cpus[idx]; in bcm6345_l1_of_init() local
355 if (cpu) { in bcm6345_l1_of_init()
356 if (cpu->map_base) in bcm6345_l1_of_init()
357 iounmap(cpu->map_base); in bcm6345_l1_of_init()
358 kfree(cpu); in bcm6345_l1_of_init()
362 kfree(intc); in bcm6345_l1_of_init()
366 IRQCHIP_DECLARE(bcm6345_l1, "brcm,bcm6345-l1-intc", bcm6345_l1_of_init);