diff options
author | Julien Grall <julien.grall@arm.com> | 2016-04-11 11:32:53 -0400 |
---|---|---|
committer | Christoffer Dall <christoffer.dall@linaro.org> | 2016-05-03 06:54:21 -0400 |
commit | bafa9193d00c7bfff4c4aea0d48cd2b55a6378c2 (patch) | |
tree | 6b4ecd614a593e5d5f0f6704ba656ffd46ddefb8 /drivers/irqchip/irq-gic.c | |
parent | d9b5e41591ca6bc6678e287b5ffe7fac2e07436e (diff) |
irqchip/gic-v2: Gather ACPI specific data in a single structure
The ACPI code requires to use global variables in order to collect
information from the tables.
For now, a single global variable is used, but more will be added in a
subsequent patch. To make clear they are ACPI specific, gather all the
information in a single structure.
Signed-off-by: Julien Grall <julien.grall@arm.com>
Acked-by: Christofer Dall <christoffer.dall@linaro.org>
Acked-by: Hanjun Guo <hanjun.guo@linaro.org>
Signed-off-by: Christoffer Dall <christoffer.dall@linaro.org>
Diffstat (limited to 'drivers/irqchip/irq-gic.c')
-rw-r--r-- | drivers/irqchip/irq-gic.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/drivers/irqchip/irq-gic.c b/drivers/irqchip/irq-gic.c index 282344b95ec2..7a73786596cd 100644 --- a/drivers/irqchip/irq-gic.c +++ b/drivers/irqchip/irq-gic.c | |||
@@ -1245,7 +1245,10 @@ IRQCHIP_DECLARE(pl390, "arm,pl390", gic_of_init); | |||
1245 | #endif | 1245 | #endif |
1246 | 1246 | ||
1247 | #ifdef CONFIG_ACPI | 1247 | #ifdef CONFIG_ACPI |
1248 | static phys_addr_t cpu_phy_base __initdata; | 1248 | static struct |
1249 | { | ||
1250 | phys_addr_t cpu_phys_base; | ||
1251 | } acpi_data __initdata; | ||
1249 | 1252 | ||
1250 | static int __init | 1253 | static int __init |
1251 | gic_acpi_parse_madt_cpu(struct acpi_subtable_header *header, | 1254 | gic_acpi_parse_madt_cpu(struct acpi_subtable_header *header, |
@@ -1265,10 +1268,10 @@ gic_acpi_parse_madt_cpu(struct acpi_subtable_header *header, | |||
1265 | * All CPU interface addresses have to be the same. | 1268 | * All CPU interface addresses have to be the same. |
1266 | */ | 1269 | */ |
1267 | gic_cpu_base = processor->base_address; | 1270 | gic_cpu_base = processor->base_address; |
1268 | if (cpu_base_assigned && gic_cpu_base != cpu_phy_base) | 1271 | if (cpu_base_assigned && gic_cpu_base != acpi_data.cpu_phys_base) |
1269 | return -EINVAL; | 1272 | return -EINVAL; |
1270 | 1273 | ||
1271 | cpu_phy_base = gic_cpu_base; | 1274 | acpi_data.cpu_phys_base = gic_cpu_base; |
1272 | cpu_base_assigned = 1; | 1275 | cpu_base_assigned = 1; |
1273 | return 0; | 1276 | return 0; |
1274 | } | 1277 | } |
@@ -1316,7 +1319,7 @@ static int __init gic_v2_acpi_init(struct acpi_subtable_header *header, | |||
1316 | return -EINVAL; | 1319 | return -EINVAL; |
1317 | } | 1320 | } |
1318 | 1321 | ||
1319 | cpu_base = ioremap(cpu_phy_base, ACPI_GIC_CPU_IF_MEM_SIZE); | 1322 | cpu_base = ioremap(acpi_data.cpu_phys_base, ACPI_GIC_CPU_IF_MEM_SIZE); |
1320 | if (!cpu_base) { | 1323 | if (!cpu_base) { |
1321 | pr_err("Unable to map GICC registers\n"); | 1324 | pr_err("Unable to map GICC registers\n"); |
1322 | return -ENOMEM; | 1325 | return -ENOMEM; |