[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 04/22] hw/arm/iotkit: Wire up the dualtimer
From: |
Philippe Mathieu-Daudé |
Subject: |
Re: [Qemu-devel] [PATCH 04/22] hw/arm/iotkit: Wire up the dualtimer |
Date: |
Tue, 21 Aug 2018 03:41:15 -0300 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 |
On 08/20/2018 11:10 AM, Peter Maydell wrote:
> Now we have a model of the CMSDK dual timer, we can wire it
> up in the IoTKit.
>
> Signed-off-by: Peter Maydell <address@hidden>
Reviewed-by: Philippe Mathieu-Daudé <address@hidden>
> ---
> include/hw/arm/iotkit.h | 3 ++-
> hw/arm/iotkit.c | 8 +++++---
> 2 files changed, 7 insertions(+), 4 deletions(-)
>
> diff --git a/include/hw/arm/iotkit.h b/include/hw/arm/iotkit.h
> index 2cddde55dd1..3e6d806e352 100644
> --- a/include/hw/arm/iotkit.h
> +++ b/include/hw/arm/iotkit.h
> @@ -56,6 +56,7 @@
> #include "hw/misc/tz-ppc.h"
> #include "hw/misc/tz-mpc.h"
> #include "hw/timer/cmsdk-apb-timer.h"
> +#include "hw/timer/cmsdk-apb-dualtimer.h"
> #include "hw/misc/unimp.h"
> #include "hw/or-irq.h"
> #include "hw/core/split-irq.h"
> @@ -87,7 +88,7 @@ typedef struct IoTKit {
> SplitIRQ mpc_irq_splitter[IOTS_NUM_EXP_MPC + IOTS_NUM_MPC];
> qemu_or_irq mpc_irq_orgate;
>
> - UnimplementedDeviceState dualtimer;
> + CMSDKAPBDualTimer dualtimer;
> UnimplementedDeviceState s32ktimer;
>
> MemoryRegion container;
> diff --git a/hw/arm/iotkit.c b/hw/arm/iotkit.c
> index 8cadc8b1608..130d013909e 100644
> --- a/hw/arm/iotkit.c
> +++ b/hw/arm/iotkit.c
> @@ -139,7 +139,7 @@ static void iotkit_init(Object *obj)
> sysbus_init_child_obj(obj, "timer1", &s->timer1, sizeof(s->timer1),
> TYPE_CMSDK_APB_TIMER);
> sysbus_init_child_obj(obj, "dualtimer", &s->dualtimer,
> sizeof(s->dualtimer),
> - TYPE_UNIMPLEMENTED_DEVICE);
> + TYPE_CMSDK_APB_DUALTIMER);
> object_initialize_child(obj, "ppc-irq-orgate", &s->ppc_irq_orgate,
> sizeof(s->ppc_irq_orgate), TYPE_OR_IRQ,
> &error_abort, NULL);
> @@ -390,13 +390,15 @@ static void iotkit_realize(DeviceState *dev, Error
> **errp)
> return;
> }
>
> - qdev_prop_set_string(DEVICE(&s->dualtimer), "name", "Dual timer");
> - qdev_prop_set_uint64(DEVICE(&s->dualtimer), "size", 0x1000);
> +
> + qdev_prop_set_uint32(DEVICE(&s->dualtimer), "pclk-frq", s->mainclk_frq);
> object_property_set_bool(OBJECT(&s->dualtimer), true, "realized", &err);
> if (err) {
> error_propagate(errp, err);
> return;
> }
> + sysbus_connect_irq(SYS_BUS_DEVICE(&s->dualtimer), 0,
> + qdev_get_gpio_in(DEVICE(&s->armv7m), 5));
> mr = sysbus_mmio_get_region(SYS_BUS_DEVICE(&s->dualtimer), 0);
> object_property_set_link(OBJECT(&s->apb_ppc0), OBJECT(mr), "port[2]",
> &err);
> if (err) {
>
- [Qemu-devel] [PATCH 00/22] MPS devices: FPGAIO, timer, watchdogs, MSC, DMA, SPI, Peter Maydell, 2018/08/20
- [Qemu-devel] [PATCH 05/22] hw/arm/mps2: Wire up dual-timer in mps2-an385 and mps2-an511, Peter Maydell, 2018/08/20
- [Qemu-devel] [PATCH 02/22] hw/misc/mps2-fpgaio: Implement PSCNTR and COUNTER, Peter Maydell, 2018/08/20
- [Qemu-devel] [PATCH 04/22] hw/arm/iotkit: Wire up the dualtimer, Peter Maydell, 2018/08/20
- [Qemu-devel] [PATCH 06/22] hw/arm/iotkit: Wire up the watchdogs, Peter Maydell, 2018/08/20
- [Qemu-devel] [PATCH 01/22] hw/misc/mps2-fpgaio: Implement 1Hz and 100Hz counters, Peter Maydell, 2018/08/20
- [Qemu-devel] [PATCH 07/22] hw/arm/iotkit: Wire up the S32KTIMER, Peter Maydell, 2018/08/20
- [Qemu-devel] [PATCH 03/22] hw/timer/cmsdk-apb-dualtimer: Implement CMSDK dual timer module, Peter Maydell, 2018/08/20
- [Qemu-devel] [PATCH 09/22] hw/misc/iotkit-sysinfo: Implement IoTKit system information block, Peter Maydell, 2018/08/20