Merge tag 'pull-loongarch-20241016' of https://gitlab.com/gaosong/qemu into staging
[qemu/armbru.git] / include / hw / timer / stellaris-gptm.h
blobfde1fc6f0c776abb4f5ad264c8324156f2afd62a
1 /*
2 * Luminary Micro Stellaris General Purpose Timer Module
4 * Copyright (c) 2006 CodeSourcery.
5 * Written by Paul Brook
7 * This code is licensed under the GPL.
8 */
10 #ifndef HW_TIMER_STELLARIS_GPTM_H
11 #define HW_TIMER_STELLARIS_GPTM_H
13 #include "qom/object.h"
14 #include "hw/sysbus.h"
15 #include "hw/irq.h"
16 #include "hw/clock.h"
18 #define TYPE_STELLARIS_GPTM "stellaris-gptm"
19 OBJECT_DECLARE_SIMPLE_TYPE(gptm_state, STELLARIS_GPTM)
22 * QEMU interface:
23 * + sysbus MMIO region 0: register bank
24 * + sysbus IRQ 0: timer interrupt
25 * + unnamed GPIO output 0: trigger output for the ADC
26 * + Clock input "clk": the 32-bit countdown timer runs at this speed
28 struct gptm_state {
29 SysBusDevice parent_obj;
31 MemoryRegion iomem;
32 uint32_t config;
33 uint32_t mode[2];
34 uint32_t control;
35 uint32_t state;
36 uint32_t mask;
37 uint32_t load[2];
38 uint32_t match[2];
39 uint32_t prescale[2];
40 uint32_t match_prescale[2];
41 uint32_t rtc;
42 int64_t tick[2];
43 struct gptm_state *opaque[2];
44 QEMUTimer *timer[2];
45 /* The timers have an alternate output used to trigger the ADC. */
46 qemu_irq trigger;
47 qemu_irq irq;
48 Clock *clk;
51 #endif