hw/usb: Extract VT82C686 UHCI PCI function into a new unit
[qemu/ar7.git] / include / hw / timer / renesas_cmt.h
blob1c0b65c1d5a702c4c18b48a5f37dd6c20f1db56b
1 /*
2 * Renesas Compare-match timer Object
4 * Copyright (c) 2019 Yoshinori Sato
6 * SPDX-License-Identifier: GPL-2.0-or-later
7 */
9 #ifndef HW_TIMER_RENESAS_CMT_H
10 #define HW_TIMER_RENESAS_CMT_H
12 #include "qemu/timer.h"
13 #include "hw/sysbus.h"
14 #include "qom/object.h"
16 #define TYPE_RENESAS_CMT "renesas-cmt"
17 typedef struct RCMTState RCMTState;
18 DECLARE_INSTANCE_CHECKER(RCMTState, RCMT,
19 TYPE_RENESAS_CMT)
21 enum {
22 CMT_CH = 2,
23 CMT_NR_IRQ = 1 * CMT_CH
26 struct RCMTState {
27 /*< private >*/
28 SysBusDevice parent_obj;
29 /*< public >*/
31 uint64_t input_freq;
32 MemoryRegion memory;
34 uint16_t cmstr;
35 uint16_t cmcr[CMT_CH];
36 uint16_t cmcnt[CMT_CH];
37 uint16_t cmcor[CMT_CH];
38 int64_t tick[CMT_CH];
39 qemu_irq cmi[CMT_CH];
40 QEMUTimer timer[CMT_CH];
43 #endif