]> xenbits.xensource.com Git - xen.git/commitdiff
ARM: ITS: Populate host_its_list from ACPI MADT Table
authorManish Jaggi <mjaggi@cavium.com>
Tue, 10 Oct 2017 12:52:29 +0000 (18:22 +0530)
committerStefano Stabellini <sstabellini@kernel.org>
Tue, 10 Oct 2017 20:25:46 +0000 (13:25 -0700)
Added gicv3_its_acpi_init to update host_its_list from MADT table.
For ACPI, host_its structure stores dt_node as NULL.

Signed-off-by: Manish Jaggi <mjaggi@cavium.com>
Reviewed-by: Andre Przywara <andre.przywara@arm.com>
Acked-by: Julien Grall <julien.grall@linaro.org>
xen/arch/arm/gic-v3-its.c
xen/arch/arm/gic-v3.c
xen/include/asm-arm/gic_v3_its.h

index 06109919d14a26e6fb14751d7d3c6f2703a720bb..3023ee5669cccf1b2e2413a756dd503bcbbd3c89 100644 (file)
@@ -18,6 +18,7 @@
  * along with this program; If not, see <http://www.gnu.org/licenses/>.
  */
 
+#include <xen/acpi.h>
 #include <xen/lib.h>
 #include <xen/delay.h>
 #include <xen/libfdt/libfdt.h>
@@ -1018,6 +1019,29 @@ void gicv3_its_dt_init(const struct dt_device_node *node)
     }
 }
 
+#ifdef CONFIG_ACPI
+static int gicv3_its_acpi_probe(struct acpi_subtable_header *header,
+                                const unsigned long end)
+{
+    struct acpi_madt_generic_translator *its;
+
+    its = (struct acpi_madt_generic_translator *)header;
+    if ( BAD_MADT_ENTRY(its, end) )
+        return -EINVAL;
+
+    add_to_host_its_list(its->base_address, GICV3_ITS_SIZE, NULL);
+
+    return 0;
+}
+
+void gicv3_its_acpi_init(void)
+{
+    /* Parse ITS information */
+    acpi_table_parse_madt(ACPI_MADT_TYPE_GENERIC_TRANSLATOR,
+                          gicv3_its_acpi_probe, 0);
+}
+#endif
+
 /*
  * Local variables:
  * mode: C
index 0c5ac1d9951ad08d4a82005d25b8a552565025e1..7dd6fb92e2e55465710f13ae1742213e18f38415 100644 (file)
@@ -1567,6 +1567,8 @@ static void __init gicv3_acpi_init(void)
 
     gicv3.rdist_stride = 0;
 
+    gicv3_its_acpi_init();
+
     /*
      * In ACPI, 0 is considered as the invalid address. However the rest
      * of the initialization rely on the invalid address to be
index 1fac1c7f267fc34346fb95ee3e3ee44ff9a24894..73d1fd10ccdcfbc3f285f7ff8c1da74bead05408 100644 (file)
 #define GITS_CMD_DISCARD                0x0f
 
 #define ITS_DOORBELL_OFFSET             0x10040
+#define GICV3_ITS_SIZE                  SZ_128K
 
 #include <xen/device_tree.h>
 #include <xen/rbtree.h>
@@ -135,6 +136,9 @@ 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
+void gicv3_its_acpi_init(void);
+#endif
 bool gicv3_its_host_has_its(void);
 
 unsigned int vgic_v3_its_count(const struct domain *d);
@@ -196,6 +200,12 @@ static inline void gicv3_its_dt_init(const struct dt_device_node *node)
 {
 }
 
+#ifdef CONFIG_ACPI
+static inline void gicv3_its_acpi_init(void)
+{
+}
+#endif
+
 static inline bool gicv3_its_host_has_its(void)
 {
     return false;