[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-devel] [PATCH 2/5] ARM: ITS: Populate host_its_list from ACPI MADT Table
From: Manish Jaggi <mjaggi@xxxxxxxxxx> Added gicv3_its_acpi_init to update host_its_list from MADT table. For ACPI, host_its sturcture stores dt_node as NULL. Future TOD0: Cleanup :(1) Remove from host_its dt_node as it is required only for ACPI Enhancement :(2) Provide a method to access translation_id and other fields of madt generic translator. Signed-off-by: Manish Jaggi <mjaggi@xxxxxxxxxx> --- xen/arch/arm/gic-v3-its.c | 14 ++++++++++++++ xen/arch/arm/gic-v3.c | 8 ++++++++ xen/include/asm-arm/gic_v3_its.h | 13 +++++++++++++ 3 files changed, 35 insertions(+) diff --git a/xen/arch/arm/gic-v3-its.c b/xen/arch/arm/gic-v3-its.c index f844a0d..c4f1288 100644 --- a/xen/arch/arm/gic-v3-its.c +++ b/xen/arch/arm/gic-v3-its.c @@ -32,6 +32,7 @@ #include <asm/page.h> #define ITS_CMD_QUEUE_SZ SZ_1M +#define ACPI_GICV3_ITS_MEM_SIZE (SZ_64K) /* * No lock here, as this list gets only populated upon boot while scanning @@ -1020,6 +1021,19 @@ void gicv3_its_dt_init(const struct dt_device_node *node) } } +#ifdef CONFIG_ACPI +int gicv3_its_acpi_init(struct acpi_subtable_header *header, + const unsigned long end) +{ + struct acpi_madt_generic_translator *its; + + its = (struct acpi_madt_generic_translator *)header; + + return add_to_host_its_list(its->base_address, + ACPI_GICV3_ITS_MEM_SIZE, NULL); +} +#endif + /* * Local variables: * mode: C diff --git a/xen/arch/arm/gic-v3.c b/xen/arch/arm/gic-v3.c index f990eae..0be8942 100644 --- a/xen/arch/arm/gic-v3.c +++ b/xen/arch/arm/gic-v3.c @@ -1567,6 +1567,14 @@ static void __init gicv3_acpi_init(void) gicv3.rdist_stride = 0; + /* Parse ITS information */ + count = acpi_table_parse_madt(ACPI_MADT_TYPE_GENERIC_TRANSLATOR, + gicv3_its_acpi_init, 0); + + if ( count <= 0 ) + panic("GICv3: Can't get ITS entry"); + + /* * In ACPI, 0 is considered as the invalid address. However the rest * of the initialization rely on the invalid address to be diff --git a/xen/include/asm-arm/gic_v3_its.h b/xen/include/asm-arm/gic_v3_its.h index 1fac1c7..2b7493d 100644 --- a/xen/include/asm-arm/gic_v3_its.h +++ b/xen/include/asm-arm/gic_v3_its.h @@ -105,6 +105,7 @@ #include <xen/device_tree.h> #include <xen/rbtree.h> +#include <xen/acpi.h> #define HOST_ITS_FLUSH_CMD_QUEUE (1U << 0) #define HOST_ITS_USES_PTA (1U << 1) @@ -135,6 +136,10 @@ extern struct list_head host_its_list; /* Parse the host DT and pick up all host ITSes. */ void gicv3_its_dt_init(const struct dt_device_node *node); +#ifdef CONFIG_ACPI +int gicv3_its_acpi_init(struct acpi_subtable_header *header, + const unsigned long end); +#endif bool gicv3_its_host_has_its(void); unsigned int vgic_v3_its_count(const struct domain *d); @@ -196,6 +201,14 @@ static inline void gicv3_its_dt_init(const struct dt_device_node *node) { } +#ifdef CONFIG_ACPI +static inline int gicv3_its_acpi_init(struct acpi_subtable_header *header, + const unsigned long end) +{ + return false; +} +#endif + static inline bool gicv3_its_host_has_its(void) { return false; -- 2.7.4 _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx https://lists.xen.org/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |