Emit an interrupt-controller node for the GICv5 CPU interface. This provides the interrupt parent and allows guests to use PPIs. Reviewed-by: Vladimir Murzin Tested-by: Vladimir Murzin Signed-off-by: Sascha Bischoff --- arm64/gic.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/arm64/gic.c b/arm64/gic.c index 83b034e3..9a8f9916 100644 --- a/arm64/gic.c +++ b/arm64/gic.c @@ -519,6 +519,8 @@ static int gic__init_gic(struct kvm *kvm) } late_init(gic__init_gic) +static void gic__generate_gicv5_fdt_nodes(void *fdt, struct kvm *kvm); + void gic__generate_fdt_nodes(void *fdt, struct kvm *kvm) { const char *compatible, *msi_compatible = NULL; @@ -549,6 +551,8 @@ void gic__generate_fdt_nodes(void *fdt, struct kvm *kvm) reg_prop[2] = cpu_to_fdt64(gic_redists_base); reg_prop[3] = cpu_to_fdt64(gic_redists_size); break; + case IRQCHIP_GICV5: + return gic__generate_gicv5_fdt_nodes(fdt, kvm); default: return; } @@ -582,6 +586,22 @@ void gic__generate_fdt_nodes(void *fdt, struct kvm *kvm) _FDT(fdt_end_node(fdt)); } +static void gic__generate_gicv5_fdt_nodes(void *fdt, struct kvm *kvm) +{ + _FDT(fdt_begin_node(fdt, "gicv5-cpuif")); + _FDT(fdt_property_string(fdt, "compatible", "arm,gic-v5")); + _FDT(fdt_property_cell(fdt, "#interrupt-cells", GIC_FDT_IRQ_NUM_CELLS)); + _FDT(fdt_property(fdt, "interrupt-controller", NULL, 0)); + _FDT(fdt_property_cell(fdt, "#address-cells", 2)); + _FDT(fdt_property_cell(fdt, "#size-cells", 2)); + _FDT(fdt_property(fdt, "ranges", NULL, 0)); + + /* Use a hard-coded phandle for the GIC to help wire things up */ + _FDT(fdt_property_cell(fdt, "phandle", PHANDLE_GIC)); + + _FDT(fdt_end_node(fdt)); +} + u32 gic__get_fdt_irq_cpumask(struct kvm *kvm) { /* Only for GICv2 */ -- 2.34.1