qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH target-arm v7 05/15] arm: xlnx-zynqmp: Add GIC


From: Peter Maydell
Subject: Re: [Qemu-devel] [PATCH target-arm v7 05/15] arm: xlnx-zynqmp: Add GIC
Date: Thu, 7 May 2015 15:02:36 +0100

On 6 May 2015 at 23:50, Peter Crosthwaite <address@hidden> wrote:
> Add the GIC and connect IRQ outputs to the CPUs. The GIC regions are
> under-decoded through a 64k address region so implement aliases
> accordingly.

> +    assert(ARRAY_SIZE(xlnx_zynqmp_gic_regions) == XLNX_ZYNQMP_GIC_REGIONS);
> +    for (i = 0; i < XLNX_ZYNQMP_GIC_REGIONS; i++) {
> +        SysBusDevice *gic = SYS_BUS_DEVICE(&s->gic);
> +        const XlnxZynqMPGICRegion *r = &xlnx_zynqmp_gic_regions[i];
> +        MemoryRegion *mr = sysbus_mmio_get_region(gic, r->region_index);
> +        uint32_t addr = r->address;
> +        int j;
> +
> +        sysbus_mmio_map(gic, r->region_index, addr);
> +
> +        for (j = 0; j < XLNX_ZYNQMP_GIC_ALIASES; j++) {
> +            MemoryRegion *alias = &s->gic_mr[i][j];
> +
> +            addr += ARM_GIC_REGION_SIZE;

Since the frequency at which the GICC region repeats in the memory
map is actually board dependent, you could just use a board
specific constant here.

> +            memory_region_init_alias(alias, OBJECT(s), "zynqmp-gic-alias", 
> mr,
> +                                     0, ARM_GIC_REGION_SIZE);

...and here you could use memory_region_size(mr), I suppose,
or just the board-specific value again.

-- PMM



reply via email to

[Prev in Thread] Current Thread [Next in Thread]