[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-arm] [PATCH v3 3/3] xlnx-zynqmp: Connect the ARM Generic Timer
From: |
Peter Maydell |
Subject: |
Re: [Qemu-arm] [PATCH v3 3/3] xlnx-zynqmp: Connect the ARM Generic Timer |
Date: |
Fri, 6 Jan 2017 12:03:25 +0000 |
On 20 December 2016 at 22:42, Alistair Francis
<address@hidden> wrote:
> Signed-off-by: Alistair Francis <address@hidden>
> ---
>
> hw/arm/xlnx-zynqmp.c | 14 ++++++++++++++
> include/hw/arm/xlnx-zynqmp.h | 2 ++
> 2 files changed, 16 insertions(+)
>
> diff --git a/hw/arm/xlnx-zynqmp.c b/hw/arm/xlnx-zynqmp.c
> index 0d86ba3..f3891ae 100644
> --- a/hw/arm/xlnx-zynqmp.c
> +++ b/hw/arm/xlnx-zynqmp.c
> @@ -38,6 +38,8 @@
> #define SATA_ADDR 0xFD0C0000
> #define SATA_NUM_PORTS 2
>
> +#define ARM_GEN_TIMER_ADDR 0xFF260000
> +
> #define DP_ADDR 0xfd4a0000
> #define DP_IRQ 113
>
> @@ -172,6 +174,10 @@ static void xlnx_zynqmp_init(Object *obj)
> qdev_set_parent_bus(DEVICE(&s->spi[i]), sysbus_get_default());
> }
>
> + object_initialize(&s->arm_gen_timer, sizeof(s->arm_gen_timer),
> + TYPE_ARM_GEN_TIMER);
> + qdev_set_parent_bus(DEVICE(&s->arm_gen_timer), sysbus_get_default());
> +
> object_initialize(&s->dp, sizeof(s->dp), TYPE_XLNX_DP);
> qdev_set_parent_bus(DEVICE(&s->dp), sysbus_get_default());
>
> @@ -405,6 +411,14 @@ static void xlnx_zynqmp_realize(DeviceState *dev, Error
> **errp)
> g_free(bus_name);
> }
>
> + object_property_set_bool(OBJECT(&s->arm_gen_timer), true, "realized",
> &err);
> + if (err) {
> + error_propagate(errp, err);
> + return;
> + }
> + sysbus_mmio_map(SYS_BUS_DEVICE(&s->arm_gen_timer), 0,
> ARM_GEN_TIMER_ADDR);
> + sysbus_mmio_map(SYS_BUS_DEVICE(&s->arm_gen_timer), 1, ARM_GEN_TIMER_ADDR
> - 0x10000);
Having a #define for a base address and then also using
thing - 0x10000 is a bit odd. I'd use two #defines, I think.
(Also avoids the overlong line.)
If we take the "board responsible for only mapping the secure-only
regs into the secure address space" approach this code will need to
change accordingly.
> +
> object_property_set_bool(OBJECT(&s->dp), true, "realized", &err);
> if (err) {
> error_propagate(errp, err);
> diff --git a/include/hw/arm/xlnx-zynqmp.h b/include/hw/arm/xlnx-zynqmp.h
> index c2931bf..8deabb4 100644
> --- a/include/hw/arm/xlnx-zynqmp.h
> +++ b/include/hw/arm/xlnx-zynqmp.h
> @@ -26,6 +26,7 @@
> #include "hw/ide/ahci.h"
> #include "hw/sd/sdhci.h"
> #include "hw/ssi/xilinx_spips.h"
> +#include "hw/timer/arm_generic_timer.h"
> #include "hw/dma/xlnx_dpdma.h"
> #include "hw/display/xlnx_dp.h"
>
> @@ -83,6 +84,7 @@ typedef struct XlnxZynqMPState {
> SysbusAHCIState sata;
> SDHCIState sdhci[XLNX_ZYNQMP_NUM_SDHCI];
> XilinxSPIPS spi[XLNX_ZYNQMP_NUM_SPIS];
> + ARMGenTimer arm_gen_timer;
> XlnxDPState dp;
> XlnxDPDMAState dpdma;
thanks
-- PMM
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Re: [Qemu-arm] [PATCH v3 3/3] xlnx-zynqmp: Connect the ARM Generic Timer,
Peter Maydell <=