Merge tag 'pull-loongarch-20241016' of https://gitlab.com/gaosong/qemu into staging
[qemu/armbru.git] / include / hw / timer / cmsdk-apb-timer.h
blob2dd615d1be9b11384b60c68f7f8edf84467724d5
1 /*
2 * ARM CMSDK APB timer emulation
4 * Copyright (c) 2017 Linaro Limited
5 * Written by Peter Maydell
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 or
9 * (at your option) any later version.
12 #ifndef CMSDK_APB_TIMER_H
13 #define CMSDK_APB_TIMER_H
15 #include "hw/sysbus.h"
16 #include "hw/ptimer.h"
17 #include "hw/clock.h"
18 #include "qom/object.h"
20 #define TYPE_CMSDK_APB_TIMER "cmsdk-apb-timer"
21 OBJECT_DECLARE_SIMPLE_TYPE(CMSDKAPBTimer, CMSDK_APB_TIMER)
24 * QEMU interface:
25 * + Clock input "pclk": clock for the timer
26 * + sysbus MMIO region 0: the register bank
27 * + sysbus IRQ 0: timer interrupt TIMERINT
29 struct CMSDKAPBTimer {
30 /*< private >*/
31 SysBusDevice parent_obj;
33 /*< public >*/
34 MemoryRegion iomem;
35 qemu_irq timerint;
36 struct ptimer_state *timer;
37 Clock *pclk;
39 uint32_t ctrl;
40 uint32_t value;
41 uint32_t reload;
42 uint32_t intstatus;
45 #endif