[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-arm] [PATCH 04/16] hw/arm/iotkit: Wire up the S32KTIMER
From: |
Philippe Mathieu-Daudé |
Subject: |
Re: [Qemu-arm] [PATCH 04/16] hw/arm/iotkit: Wire up the S32KTIMER |
Date: |
Fri, 17 Aug 2018 20:49:39 -0300 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 |
On 08/09/2018 10:01 AM, Peter Maydell wrote:
> The IoTKit has a CMSDK timer device that runs on the S32KCLK.
> Create this and wire it up.
>
> Signed-off-by: Peter Maydell <address@hidden>
Reviewed-by: Philippe Mathieu-Daudé <address@hidden>
> ---
> include/hw/arm/iotkit.h | 2 +-
> hw/arm/iotkit.c | 9 +++++----
> 2 files changed, 6 insertions(+), 5 deletions(-)
>
> diff --git a/include/hw/arm/iotkit.h b/include/hw/arm/iotkit.h
> index 776d0497087..0f5c5101708 100644
> --- a/include/hw/arm/iotkit.h
> +++ b/include/hw/arm/iotkit.h
> @@ -83,6 +83,7 @@ typedef struct IoTKit {
> TZMPC mpc;
> CMSDKAPBTIMER timer0;
> CMSDKAPBTIMER timer1;
> + CMSDKAPBTIMER s32ktimer;
> qemu_or_irq ppc_irq_orgate;
> SplitIRQ sec_resp_splitter;
> SplitIRQ ppc_irq_splitter[NUM_PPCS];
> @@ -91,7 +92,6 @@ typedef struct IoTKit {
> qemu_or_irq nmi_orgate;
>
> CMSDKAPBDualTimer dualtimer;
> - UnimplementedDeviceState s32ktimer;
>
> CMSDKAPBWatchdog s32kwatchdog;
> CMSDKAPBWatchdog nswatchdog;
> diff --git a/hw/arm/iotkit.c b/hw/arm/iotkit.c
> index 5cedfa03570..cb0ec456f39 100644
> --- a/hw/arm/iotkit.c
> +++ b/hw/arm/iotkit.c
> @@ -141,6 +141,8 @@ static void iotkit_init(Object *obj)
> TYPE_CMSDK_APB_TIMER);
> sysbus_init_child_obj(obj, "timer1", &s->timer1, sizeof(s->timer1),
> TYPE_CMSDK_APB_TIMER);
> + sysbus_init_child_obj(obj, "s32ktimer", &s->s32ktimer,
> sizeof(s->s32ktimer),
> + TYPE_CMSDK_APB_TIMER);
> sysbus_init_child_obj(obj, "dualtimer", &s->dualtimer,
> sizeof(s->dualtimer),
> TYPE_CMSDK_APB_DUALTIMER);
> sysbus_init_child_obj(obj, "s32kwatchdog", &s->s32kwatchdog,
> @@ -166,8 +168,6 @@ static void iotkit_init(Object *obj)
> TYPE_SPLIT_IRQ, &error_abort, NULL);
> g_free(name);
> }
> - sysbus_init_child_obj(obj, "s32ktimer", &s->s32ktimer,
> sizeof(s->s32ktimer),
> - TYPE_UNIMPLEMENTED_DEVICE);
> }
>
> static void iotkit_exp_irq(void *opaque, int n, int level)
> @@ -476,13 +476,14 @@ static void iotkit_realize(DeviceState *dev, Error
> **errp)
> /* Devices behind APB PPC1:
> * 0x4002f000: S32K timer
> */
> - qdev_prop_set_string(DEVICE(&s->s32ktimer), "name", "S32KTIMER");
> - qdev_prop_set_uint64(DEVICE(&s->s32ktimer), "size", 0x1000);
> + qdev_prop_set_uint32(DEVICE(&s->s32ktimer), "pclk-frq", S32KCLK);
> object_property_set_bool(OBJECT(&s->s32ktimer), true, "realized", &err);
> if (err) {
> error_propagate(errp, err);
> return;
> }
> + sysbus_connect_irq(SYS_BUS_DEVICE(&s->s32ktimer), 0,
> + qdev_get_gpio_in(DEVICE(&s->armv7m), 2));
> mr = sysbus_mmio_get_region(SYS_BUS_DEVICE(&s->s32ktimer), 0);
> object_property_set_link(OBJECT(&s->apb_ppc1), OBJECT(mr), "port[0]",
> &err);
> if (err) {
>
[Qemu-arm] [PATCH 04/16] hw/arm/iotkit: Wire up the S32KTIMER, Peter Maydell, 2018/08/09
- Re: [Qemu-arm] [PATCH 04/16] hw/arm/iotkit: Wire up the S32KTIMER,
Philippe Mathieu-Daudé <=
[Qemu-arm] [PATCH 05/16] hw/misc/iotkit-sysctl: Implement IoTKit system control element, Peter Maydell, 2018/08/09
[Qemu-arm] [PATCH 01/16] hw/watchdog/cmsdk_apb_watchdog: Implement CMSDK APB watchdog module, Peter Maydell, 2018/08/09
[Qemu-arm] [PATCH 15/16] hw/dma/pl080: Remove hw_error() if DMA is enabled, Peter Maydell, 2018/08/09
[Qemu-arm] [PATCH 08/16] hw/misc/iotkit-secctl: Wire up registers for controlling MSCs, Peter Maydell, 2018/08/09