Hi Hanjun,
On 18/05/15 13:59, Hanjun Guo wrote:
From: Tomasz Nowicki <tomasz.nowicki@xxxxxxxxxx>
This self-probe infrastructure works in the similar way as OF,
but there is some different in the mechanism:
For OF, the init fn will be called once it finds comptiable strings
in DT, but for ACPI, we init irqchips by static tables, and in
static ACPI tables, there are no comptiable strings to indicate
irqchips, so every init function with IRQCHIP_ACPI_DECLARE in the
same table will be called, but thanks to the GIC version presented
in ACPI table, we can init different GIC irqchips with this framework.
This triggers an immediate question: If we can find out the GIC version
in the ACPI tables, which can't we just call the irqchips that implement
the support for this version?
i.e: the GICv2 irqchip code would have a line like:
IRQCHIP_ACPI_DECLARE(gic_v2, ACPI_MADT_GIC_VER_V2, gic_v2_acpi_init);
and the probing code would simply call the drivers that have declared
their interest for this version code.
Having code that tests for the version in each driver is not an option
(this is exactly what we're trying to avoid).