Merge tag 'pull-loongarch-20241016' of https://gitlab.com/gaosong/qemu into staging
[qemu/armbru.git] / include / hw / timer / bcm2835_systmr.h
bloba8f605beeb67d0216e57404159506403b2d282ea
1 /*
2 * BCM2835 SYS timer emulation
4 * Copyright (c) 2019 Philippe Mathieu-Daudé <f4bug@amsat.org>
6 * SPDX-License-Identifier: GPL-2.0-or-later
7 */
9 #ifndef BCM2835_SYSTMR_H
10 #define BCM2835_SYSTMR_H
12 #include "hw/sysbus.h"
13 #include "hw/irq.h"
14 #include "qemu/timer.h"
15 #include "qom/object.h"
17 #define TYPE_BCM2835_SYSTIMER "bcm2835-sys-timer"
18 OBJECT_DECLARE_SIMPLE_TYPE(BCM2835SystemTimerState, BCM2835_SYSTIMER)
20 #define BCM2835_SYSTIMER_COUNT 4
22 typedef struct {
23 unsigned id;
24 QEMUTimer timer;
25 qemu_irq irq;
26 BCM2835SystemTimerState *state;
27 } BCM2835SystemTimerCompare;
29 struct BCM2835SystemTimerState {
30 /*< private >*/
31 SysBusDevice parent_obj;
33 /*< public >*/
34 MemoryRegion iomem;
35 struct {
36 uint32_t ctrl_status;
37 uint32_t compare[BCM2835_SYSTIMER_COUNT];
38 } reg;
39 BCM2835SystemTimerCompare tmr[BCM2835_SYSTIMER_COUNT];
42 #endif