Merge tag 'pull-loongarch-20241016' of https://gitlab.com/gaosong/qemu into staging
[qemu/armbru.git] / include / hw / timer / cadence_ttc.h
blobe1251383f2ac985f7c6cfdbf03b72c9731bbade1
1 /*
2 * Xilinx Zynq cadence TTC model
4 * Copyright (c) 2011 Xilinx Inc.
5 * Copyright (c) 2012 Peter A.G. Crosthwaite (peter.crosthwaite@petalogix.com)
6 * Copyright (c) 2012 PetaLogix Pty Ltd.
7 * Written By Haibing Ma
8 * M. Habib
10 * This program is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU General Public License
12 * as published by the Free Software Foundation; either version
13 * 2 of the License, or (at your option) any later version.
15 * You should have received a copy of the GNU General Public License along
16 * with this program; if not, see <http://www.gnu.org/licenses/>.
18 #ifndef HW_TIMER_CADENCE_TTC_H
19 #define HW_TIMER_CADENCE_TTC_H
21 #include "hw/sysbus.h"
22 #include "qemu/timer.h"
24 typedef struct {
25 QEMUTimer *timer;
26 int freq;
28 uint32_t reg_clock;
29 uint32_t reg_count;
30 uint32_t reg_value;
31 uint16_t reg_interval;
32 uint16_t reg_match[3];
33 uint32_t reg_intr;
34 uint32_t reg_intr_en;
35 uint32_t reg_event_ctrl;
36 uint32_t reg_event;
38 uint64_t cpu_time;
39 unsigned int cpu_time_valid;
41 qemu_irq irq;
42 } CadenceTimerState;
44 #define TYPE_CADENCE_TTC "cadence_ttc"
45 OBJECT_DECLARE_SIMPLE_TYPE(CadenceTTCState, CADENCE_TTC)
47 struct CadenceTTCState {
48 SysBusDevice parent_obj;
50 MemoryRegion iomem;
51 CadenceTimerState timer[3];
54 #endif