| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * Broadcom BCM6345 style Level 1 interrupt controller driver |
|---|
| 3 | 4 | * |
|---|
| 4 | 5 | * Copyright (C) 2014 Broadcom Corporation |
|---|
| 5 | 6 | * Copyright 2015 Simon Arlott |
|---|
| 6 | | - * |
|---|
| 7 | | - * This program is free software; you can redistribute it and/or modify |
|---|
| 8 | | - * it under the terms of the GNU General Public License version 2 as |
|---|
| 9 | | - * published by the Free Software Foundation. |
|---|
| 10 | 7 | * |
|---|
| 11 | 8 | * This is based on the BCM7038 (which supports SMP) but with a single |
|---|
| 12 | 9 | * enable register instead of separate mask/set/clear registers. |
|---|
| .. | .. |
|---|
| 85 | 82 | }; |
|---|
| 86 | 83 | |
|---|
| 87 | 84 | struct bcm6345_l1_cpu { |
|---|
| 85 | + struct bcm6345_l1_chip *intc; |
|---|
| 88 | 86 | void __iomem *map_base; |
|---|
| 89 | 87 | unsigned int parent_irq; |
|---|
| 90 | 88 | u32 enable_cache[]; |
|---|
| .. | .. |
|---|
| 118 | 116 | |
|---|
| 119 | 117 | static void bcm6345_l1_irq_handle(struct irq_desc *desc) |
|---|
| 120 | 118 | { |
|---|
| 121 | | - struct bcm6345_l1_chip *intc = irq_desc_get_handler_data(desc); |
|---|
| 122 | | - struct bcm6345_l1_cpu *cpu; |
|---|
| 119 | + struct bcm6345_l1_cpu *cpu = irq_desc_get_handler_data(desc); |
|---|
| 120 | + struct bcm6345_l1_chip *intc = cpu->intc; |
|---|
| 123 | 121 | struct irq_chip *chip = irq_desc_get_chip(desc); |
|---|
| 124 | 122 | unsigned int idx; |
|---|
| 125 | | - |
|---|
| 126 | | -#ifdef CONFIG_SMP |
|---|
| 127 | | - cpu = intc->cpus[cpu_logical_map(smp_processor_id())]; |
|---|
| 128 | | -#else |
|---|
| 129 | | - cpu = intc->cpus[0]; |
|---|
| 130 | | -#endif |
|---|
| 131 | 123 | |
|---|
| 132 | 124 | chained_irq_enter(chip, desc); |
|---|
| 133 | 125 | |
|---|
| .. | .. |
|---|
| 260 | 252 | if (!cpu) |
|---|
| 261 | 253 | return -ENOMEM; |
|---|
| 262 | 254 | |
|---|
| 255 | + cpu->intc = intc; |
|---|
| 263 | 256 | cpu->map_base = ioremap(res.start, sz); |
|---|
| 264 | 257 | if (!cpu->map_base) |
|---|
| 265 | 258 | return -ENOMEM; |
|---|
| .. | .. |
|---|
| 275 | 268 | return -EINVAL; |
|---|
| 276 | 269 | } |
|---|
| 277 | 270 | irq_set_chained_handler_and_data(cpu->parent_irq, |
|---|
| 278 | | - bcm6345_l1_irq_handle, intc); |
|---|
| 271 | + bcm6345_l1_irq_handle, cpu); |
|---|
| 279 | 272 | |
|---|
| 280 | 273 | return 0; |
|---|
| 281 | 274 | } |
|---|