On 2014-3-19 16:51, Tomasz Nowicki wrote:
On 19.03.2014 04:51, Ashwin Chaugule wrote:
Once we get the table header pointer to the MADT in the callback from acpi_parse_table(), we can use it to probe the GIC and its distributors.
Signed-off-by: Ashwin Chaugule ashwin.chaugule@linaro.org
drivers/acpi/plat/arm-core.c | 54 ++++++++++++++------------------------------ 1 file changed, 17 insertions(+), 37 deletions(-)
diff --git a/drivers/acpi/plat/arm-core.c b/drivers/acpi/plat/arm-core.c index 87e93b2..7a93fef 100644 --- a/drivers/acpi/plat/arm-core.c +++ b/drivers/acpi/plat/arm-core.c @@ -92,19 +92,6 @@ void __init __acpi_unmap_table(char *map, unsigned long size) return; }
-static int __init acpi_parse_madt(struct acpi_table_header *table) -{
- struct acpi_table_madt *madt;
- madt = (struct acpi_table_madt *)table;
- if (!madt) {
pr_warn(PREFIX "Unable to get MADT\n");
return -ENODEV;
- }
- return 0;
-}
- /*
- GIC structures on ARM are somthing like Local APIC structures on x86,
- which means GIC cpu interfaces for GICv2/v3. Every GIC structure in
@@ -146,20 +133,21 @@ acpi_parse_gic_distributor(struct acpi_subtable_header *header, return 0; }
-/*
- Parse GIC cpu interface related entries in MADT
- returns 0 on success, < 0 on error
- */
-static int __init acpi_parse_madt_gic_entries(void) +static int __init acpi_parse_madt(struct acpi_table_header *header) {
- struct acpi_table_madt *madt; int count;
- /*
* do a partial walk of MADT to determine how many CPUs
* we have including disabled CPUs
*/
- count = acpi_table_parse_madt(ACPI_MADT_TYPE_GENERIC_INTERRUPT,
acpi_parse_gic, MAX_GIC_CPU_INTERFACE);
- madt = (struct acpi_table_madt *)header;
- if (!madt) {
Hanjun, are we going to use some of "struct acpi_table_madt" fields here? If not, we could just get rid of this casting and use "header" pointer directly.
Yes, we are going to get the "Local Interrupt Controller Address" field here for GIC initialization.
Thanks Hanjun