Merge tag 'v9.0.0-rc3'
[qemu/ar7.git] / include / hw / timer / sse-timer.h
blob265ad32400dcd3e20df6d89e6b6b32febd4b1bc5
1 /*
2 * Arm SSE Subsystem System Timer
4 * Copyright (c) 2020 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.
13 * This is a model of the "System timer" which is documented in
14 * the Arm SSE-123 Example Subsystem Technical Reference Manual:
15 * https://developer.arm.com/documentation/101370/latest/
17 * QEMU interface:
18 * + QOM property "counter": link property to be set to the
19 * TYPE_SSE_COUNTER timestamp counter device this timer runs off
20 * + sysbus MMIO region 0: the register bank
21 * + sysbus IRQ 0: timer interrupt
24 #ifndef SSE_TIMER_H
25 #define SSE_TIMER_H
27 #include "hw/sysbus.h"
28 #include "qemu/timer.h"
29 #include "qom/object.h"
30 #include "hw/timer/sse-counter.h"
32 #define TYPE_SSE_TIMER "sse-timer"
33 OBJECT_DECLARE_SIMPLE_TYPE(SSETimer, SSE_TIMER)
35 struct SSETimer {
36 /*< private >*/
37 SysBusDevice parent_obj;
39 /*< public >*/
40 MemoryRegion iomem;
41 qemu_irq irq;
42 SSECounter *counter;
43 QEMUTimer timer;
44 Notifier counter_notifier;
46 uint32_t cntfrq;
47 uint32_t cntp_ctl;
48 uint64_t cntp_cval;
49 uint64_t cntp_aival;
50 uint32_t cntp_aival_ctl;
51 uint32_t cntp_aival_reload;
54 #endif