[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-arm] [RFC 6/8] hw/arm/virt: Allow GICv3 DT node with multiple
From: |
Peter Maydell |
Subject: |
Re: [Qemu-arm] [RFC 6/8] hw/arm/virt: Allow GICv3 DT node with multiple redistributor regions |
Date: |
Fri, 13 Apr 2018 14:36:03 +0100 |
On 27 March 2018 at 15:15, Eric Auger <address@hidden> wrote:
> This patch adds the GICState handle in the virtual machine state and
> allows to create a GIC device tree node advertising multiple redistributor
> regions.
>
> There is one range per distributor region following the GIC distributor.
> Please refer to kernel documentation for further details:
> Documentation/devicetree/bindings/interrupt-controller/arm,gic-v3.txt
>
> Signed-off-by: Eric Auger <address@hidden>
> +
> + num_reg_values = 4 * (s->nb_redist_regions + 1);
> + regs = g_new0(uint64_t, num_reg_values);
> + qemu_fdt_setprop_cell(vms->fdt, "/intc", "#redistributor-regions",
> + s->nb_redist_regions);
> + regs[0] = 2;
> + regs[1] = vms->memmap[VIRT_GIC_DIST].base;
> + regs[2] = 2;
> + regs[3] = vms->memmap[VIRT_GIC_DIST].size;
> +
> + for (r = 1; r <= s->nb_redist_regions; r++) {
> + regs[4 * r] = 2;
> + regs[4 * r + 1] = s->redist_region[r - 1].base;
> + regs[4 * r + 2] = 2;
> + /* count redistributors of 2 x 64kB pages */
> + regs[4 * r + 3] = (uint64_t)s->redist_region[r - 1].count << 17;
Board code shouldn't be reaching into the GIC device state struct like this.
> + }
> + qemu_fdt_setprop_sized_cells_from_array(vms->fdt, "/intc", "reg",
> + num_reg_values / 2, regs);
> + g_free(regs);
> +
> if (vms->virt) {
> qemu_fdt_setprop_cells(vms->fdt, "/intc", "interrupts",
thanks
-- PMM
- Re: [Qemu-arm] [RFC 6/8] hw/arm/virt: Allow GICv3 DT node with multiple redistributor regions,
Peter Maydell <=