xref: /openbmc/qemu/hw/acpi/ich9_tco.c (revision fbae27e857061e1098c21944c81bd025c8946c62)
1*fbae27e8SPhilippe Mathieu-Daudé /*
2*fbae27e8SPhilippe Mathieu-Daudé  * QEMU ICH9 TCO emulation
3*fbae27e8SPhilippe Mathieu-Daudé  *
4*fbae27e8SPhilippe Mathieu-Daudé  * Copyright (c) 2015 Paulo Alcantara <pcacjr@zytor.com>
5*fbae27e8SPhilippe Mathieu-Daudé  *
6*fbae27e8SPhilippe Mathieu-Daudé  * This work is licensed under the terms of the GNU GPL, version 2 or later.
7*fbae27e8SPhilippe Mathieu-Daudé  * See the COPYING file in the top-level directory.
8*fbae27e8SPhilippe Mathieu-Daudé  */
9*fbae27e8SPhilippe Mathieu-Daudé 
10*fbae27e8SPhilippe Mathieu-Daudé #include "qemu/osdep.h"
11*fbae27e8SPhilippe Mathieu-Daudé #include "sysemu/watchdog.h"
12*fbae27e8SPhilippe Mathieu-Daudé #include "hw/i386/ich9.h"
13*fbae27e8SPhilippe Mathieu-Daudé #include "migration/vmstate.h"
14*fbae27e8SPhilippe Mathieu-Daudé 
15*fbae27e8SPhilippe Mathieu-Daudé #include "hw/acpi/ich9_tco.h"
16*fbae27e8SPhilippe Mathieu-Daudé #include "trace.h"
17*fbae27e8SPhilippe Mathieu-Daudé 
18*fbae27e8SPhilippe Mathieu-Daudé enum {
19*fbae27e8SPhilippe Mathieu-Daudé     TCO_RLD_DEFAULT         = 0x0000,
20*fbae27e8SPhilippe Mathieu-Daudé     TCO_DAT_IN_DEFAULT      = 0x00,
21*fbae27e8SPhilippe Mathieu-Daudé     TCO_DAT_OUT_DEFAULT     = 0x00,
22*fbae27e8SPhilippe Mathieu-Daudé     TCO1_STS_DEFAULT        = 0x0000,
23*fbae27e8SPhilippe Mathieu-Daudé     TCO2_STS_DEFAULT        = 0x0000,
24*fbae27e8SPhilippe Mathieu-Daudé     TCO1_CNT_DEFAULT        = 0x0000,
25*fbae27e8SPhilippe Mathieu-Daudé     TCO2_CNT_DEFAULT        = 0x0008,
26*fbae27e8SPhilippe Mathieu-Daudé     TCO_MESSAGE1_DEFAULT    = 0x00,
27*fbae27e8SPhilippe Mathieu-Daudé     TCO_MESSAGE2_DEFAULT    = 0x00,
28*fbae27e8SPhilippe Mathieu-Daudé     TCO_WDCNT_DEFAULT       = 0x00,
29*fbae27e8SPhilippe Mathieu-Daudé     TCO_TMR_DEFAULT         = 0x0004,
30*fbae27e8SPhilippe Mathieu-Daudé     SW_IRQ_GEN_DEFAULT      = 0x03,
31*fbae27e8SPhilippe Mathieu-Daudé };
32*fbae27e8SPhilippe Mathieu-Daudé 
33*fbae27e8SPhilippe Mathieu-Daudé static inline void tco_timer_reload(TCOIORegs *tr)
34*fbae27e8SPhilippe Mathieu-Daudé {
35*fbae27e8SPhilippe Mathieu-Daudé     int ticks = tr->tco.tmr & TCO_TMR_MASK;
36*fbae27e8SPhilippe Mathieu-Daudé     int64_t nsec = (int64_t)ticks * TCO_TICK_NSEC;
37*fbae27e8SPhilippe Mathieu-Daudé 
38*fbae27e8SPhilippe Mathieu-Daudé     trace_tco_timer_reload(ticks, nsec / 1000000);
39*fbae27e8SPhilippe Mathieu-Daudé     tr->expire_time = qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL) + nsec;
40*fbae27e8SPhilippe Mathieu-Daudé     timer_mod(tr->tco_timer, tr->expire_time);
41*fbae27e8SPhilippe Mathieu-Daudé }
42*fbae27e8SPhilippe Mathieu-Daudé 
43*fbae27e8SPhilippe Mathieu-Daudé static inline void tco_timer_stop(TCOIORegs *tr)
44*fbae27e8SPhilippe Mathieu-Daudé {
45*fbae27e8SPhilippe Mathieu-Daudé     tr->expire_time = -1;
46*fbae27e8SPhilippe Mathieu-Daudé     timer_del(tr->tco_timer);
47*fbae27e8SPhilippe Mathieu-Daudé }
48*fbae27e8SPhilippe Mathieu-Daudé 
49*fbae27e8SPhilippe Mathieu-Daudé static void tco_timer_expired(void *opaque)
50*fbae27e8SPhilippe Mathieu-Daudé {
51*fbae27e8SPhilippe Mathieu-Daudé     TCOIORegs *tr = opaque;
52*fbae27e8SPhilippe Mathieu-Daudé     ICH9LPCPMRegs *pm = container_of(tr, ICH9LPCPMRegs, tco_regs);
53*fbae27e8SPhilippe Mathieu-Daudé     ICH9LPCState *lpc = container_of(pm, ICH9LPCState, pm);
54*fbae27e8SPhilippe Mathieu-Daudé     uint32_t gcs = pci_get_long(lpc->chip_config + ICH9_CC_GCS);
55*fbae27e8SPhilippe Mathieu-Daudé 
56*fbae27e8SPhilippe Mathieu-Daudé     trace_tco_timer_expired(tr->timeouts_no,
57*fbae27e8SPhilippe Mathieu-Daudé                             lpc->pin_strap.spkr_hi,
58*fbae27e8SPhilippe Mathieu-Daudé                             !!(gcs & ICH9_CC_GCS_NO_REBOOT));
59*fbae27e8SPhilippe Mathieu-Daudé     tr->tco.rld = 0;
60*fbae27e8SPhilippe Mathieu-Daudé     tr->tco.sts1 |= TCO_TIMEOUT;
61*fbae27e8SPhilippe Mathieu-Daudé     if (++tr->timeouts_no == 2) {
62*fbae27e8SPhilippe Mathieu-Daudé         tr->tco.sts2 |= TCO_SECOND_TO_STS;
63*fbae27e8SPhilippe Mathieu-Daudé         tr->tco.sts2 |= TCO_BOOT_STS;
64*fbae27e8SPhilippe Mathieu-Daudé         tr->timeouts_no = 0;
65*fbae27e8SPhilippe Mathieu-Daudé 
66*fbae27e8SPhilippe Mathieu-Daudé         if (!lpc->pin_strap.spkr_hi && !(gcs & ICH9_CC_GCS_NO_REBOOT)) {
67*fbae27e8SPhilippe Mathieu-Daudé             watchdog_perform_action();
68*fbae27e8SPhilippe Mathieu-Daudé             tco_timer_stop(tr);
69*fbae27e8SPhilippe Mathieu-Daudé             return;
70*fbae27e8SPhilippe Mathieu-Daudé         }
71*fbae27e8SPhilippe Mathieu-Daudé     }
72*fbae27e8SPhilippe Mathieu-Daudé 
73*fbae27e8SPhilippe Mathieu-Daudé     if (pm->smi_en & ICH9_PMIO_SMI_EN_TCO_EN) {
74*fbae27e8SPhilippe Mathieu-Daudé         ich9_generate_smi();
75*fbae27e8SPhilippe Mathieu-Daudé     }
76*fbae27e8SPhilippe Mathieu-Daudé     tr->tco.rld = tr->tco.tmr;
77*fbae27e8SPhilippe Mathieu-Daudé     tco_timer_reload(tr);
78*fbae27e8SPhilippe Mathieu-Daudé }
79*fbae27e8SPhilippe Mathieu-Daudé 
80*fbae27e8SPhilippe Mathieu-Daudé /* NOTE: values of 0 or 1 will be ignored by ICH */
81*fbae27e8SPhilippe Mathieu-Daudé static inline int can_start_tco_timer(TCOIORegs *tr)
82*fbae27e8SPhilippe Mathieu-Daudé {
83*fbae27e8SPhilippe Mathieu-Daudé     return !(tr->tco.cnt1 & TCO_TMR_HLT) && tr->tco.tmr > 1;
84*fbae27e8SPhilippe Mathieu-Daudé }
85*fbae27e8SPhilippe Mathieu-Daudé 
86*fbae27e8SPhilippe Mathieu-Daudé static uint32_t tco_ioport_readw(TCOIORegs *tr, uint32_t addr)
87*fbae27e8SPhilippe Mathieu-Daudé {
88*fbae27e8SPhilippe Mathieu-Daudé     uint16_t rld;
89*fbae27e8SPhilippe Mathieu-Daudé     uint32_t ret = 0;
90*fbae27e8SPhilippe Mathieu-Daudé 
91*fbae27e8SPhilippe Mathieu-Daudé     switch (addr) {
92*fbae27e8SPhilippe Mathieu-Daudé     case TCO_RLD:
93*fbae27e8SPhilippe Mathieu-Daudé         if (tr->expire_time != -1) {
94*fbae27e8SPhilippe Mathieu-Daudé             int64_t now = qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL);
95*fbae27e8SPhilippe Mathieu-Daudé             int64_t elapsed = (tr->expire_time - now) / TCO_TICK_NSEC;
96*fbae27e8SPhilippe Mathieu-Daudé             rld = (uint16_t)elapsed | (tr->tco.rld & ~TCO_RLD_MASK);
97*fbae27e8SPhilippe Mathieu-Daudé         } else {
98*fbae27e8SPhilippe Mathieu-Daudé             rld = tr->tco.rld;
99*fbae27e8SPhilippe Mathieu-Daudé         }
100*fbae27e8SPhilippe Mathieu-Daudé         ret = rld;
101*fbae27e8SPhilippe Mathieu-Daudé         break;
102*fbae27e8SPhilippe Mathieu-Daudé     case TCO_DAT_IN:
103*fbae27e8SPhilippe Mathieu-Daudé         ret = tr->tco.din;
104*fbae27e8SPhilippe Mathieu-Daudé         break;
105*fbae27e8SPhilippe Mathieu-Daudé     case TCO_DAT_OUT:
106*fbae27e8SPhilippe Mathieu-Daudé         ret = tr->tco.dout;
107*fbae27e8SPhilippe Mathieu-Daudé         break;
108*fbae27e8SPhilippe Mathieu-Daudé     case TCO1_STS:
109*fbae27e8SPhilippe Mathieu-Daudé         ret = tr->tco.sts1;
110*fbae27e8SPhilippe Mathieu-Daudé         break;
111*fbae27e8SPhilippe Mathieu-Daudé     case TCO2_STS:
112*fbae27e8SPhilippe Mathieu-Daudé         ret = tr->tco.sts2;
113*fbae27e8SPhilippe Mathieu-Daudé         break;
114*fbae27e8SPhilippe Mathieu-Daudé     case TCO1_CNT:
115*fbae27e8SPhilippe Mathieu-Daudé         ret = tr->tco.cnt1;
116*fbae27e8SPhilippe Mathieu-Daudé         break;
117*fbae27e8SPhilippe Mathieu-Daudé     case TCO2_CNT:
118*fbae27e8SPhilippe Mathieu-Daudé         ret = tr->tco.cnt2;
119*fbae27e8SPhilippe Mathieu-Daudé         break;
120*fbae27e8SPhilippe Mathieu-Daudé     case TCO_MESSAGE1:
121*fbae27e8SPhilippe Mathieu-Daudé         ret = tr->tco.msg1;
122*fbae27e8SPhilippe Mathieu-Daudé         break;
123*fbae27e8SPhilippe Mathieu-Daudé     case TCO_MESSAGE2:
124*fbae27e8SPhilippe Mathieu-Daudé         ret = tr->tco.msg2;
125*fbae27e8SPhilippe Mathieu-Daudé         break;
126*fbae27e8SPhilippe Mathieu-Daudé     case TCO_WDCNT:
127*fbae27e8SPhilippe Mathieu-Daudé         ret = tr->tco.wdcnt;
128*fbae27e8SPhilippe Mathieu-Daudé         break;
129*fbae27e8SPhilippe Mathieu-Daudé     case TCO_TMR:
130*fbae27e8SPhilippe Mathieu-Daudé         ret = tr->tco.tmr;
131*fbae27e8SPhilippe Mathieu-Daudé         break;
132*fbae27e8SPhilippe Mathieu-Daudé     case SW_IRQ_GEN:
133*fbae27e8SPhilippe Mathieu-Daudé         ret = tr->sw_irq_gen;
134*fbae27e8SPhilippe Mathieu-Daudé         break;
135*fbae27e8SPhilippe Mathieu-Daudé     }
136*fbae27e8SPhilippe Mathieu-Daudé     trace_tco_io_read(addr, ret);
137*fbae27e8SPhilippe Mathieu-Daudé     return ret;
138*fbae27e8SPhilippe Mathieu-Daudé }
139*fbae27e8SPhilippe Mathieu-Daudé 
140*fbae27e8SPhilippe Mathieu-Daudé static void tco_ioport_writew(TCOIORegs *tr, uint32_t addr, uint32_t val)
141*fbae27e8SPhilippe Mathieu-Daudé {
142*fbae27e8SPhilippe Mathieu-Daudé     trace_tco_io_write(addr, val);
143*fbae27e8SPhilippe Mathieu-Daudé     switch (addr) {
144*fbae27e8SPhilippe Mathieu-Daudé     case TCO_RLD:
145*fbae27e8SPhilippe Mathieu-Daudé         tr->timeouts_no = 0;
146*fbae27e8SPhilippe Mathieu-Daudé         if (can_start_tco_timer(tr)) {
147*fbae27e8SPhilippe Mathieu-Daudé             tr->tco.rld = tr->tco.tmr;
148*fbae27e8SPhilippe Mathieu-Daudé             tco_timer_reload(tr);
149*fbae27e8SPhilippe Mathieu-Daudé         } else {
150*fbae27e8SPhilippe Mathieu-Daudé             tr->tco.rld = val;
151*fbae27e8SPhilippe Mathieu-Daudé         }
152*fbae27e8SPhilippe Mathieu-Daudé         break;
153*fbae27e8SPhilippe Mathieu-Daudé     case TCO_DAT_IN:
154*fbae27e8SPhilippe Mathieu-Daudé         tr->tco.din = val;
155*fbae27e8SPhilippe Mathieu-Daudé         tr->tco.sts1 |= SW_TCO_SMI;
156*fbae27e8SPhilippe Mathieu-Daudé         ich9_generate_smi();
157*fbae27e8SPhilippe Mathieu-Daudé         break;
158*fbae27e8SPhilippe Mathieu-Daudé     case TCO_DAT_OUT:
159*fbae27e8SPhilippe Mathieu-Daudé         tr->tco.dout = val;
160*fbae27e8SPhilippe Mathieu-Daudé         tr->tco.sts1 |= TCO_INT_STS;
161*fbae27e8SPhilippe Mathieu-Daudé         /* TODO: cause an interrupt, as selected by the TCO_INT_SEL bits */
162*fbae27e8SPhilippe Mathieu-Daudé         break;
163*fbae27e8SPhilippe Mathieu-Daudé     case TCO1_STS:
164*fbae27e8SPhilippe Mathieu-Daudé         tr->tco.sts1 = val & TCO1_STS_MASK;
165*fbae27e8SPhilippe Mathieu-Daudé         break;
166*fbae27e8SPhilippe Mathieu-Daudé     case TCO2_STS:
167*fbae27e8SPhilippe Mathieu-Daudé         tr->tco.sts2 = val & TCO2_STS_MASK;
168*fbae27e8SPhilippe Mathieu-Daudé         break;
169*fbae27e8SPhilippe Mathieu-Daudé     case TCO1_CNT:
170*fbae27e8SPhilippe Mathieu-Daudé         val &= TCO1_CNT_MASK;
171*fbae27e8SPhilippe Mathieu-Daudé         /*
172*fbae27e8SPhilippe Mathieu-Daudé          * once TCO_LOCK bit is set, it can not be cleared by software. a reset
173*fbae27e8SPhilippe Mathieu-Daudé          * is required to change this bit from 1 to 0 -- it defaults to 0.
174*fbae27e8SPhilippe Mathieu-Daudé          */
175*fbae27e8SPhilippe Mathieu-Daudé         tr->tco.cnt1 = val | (tr->tco.cnt1 & TCO_LOCK);
176*fbae27e8SPhilippe Mathieu-Daudé         if (can_start_tco_timer(tr)) {
177*fbae27e8SPhilippe Mathieu-Daudé             tr->tco.rld = tr->tco.tmr;
178*fbae27e8SPhilippe Mathieu-Daudé             tco_timer_reload(tr);
179*fbae27e8SPhilippe Mathieu-Daudé         } else {
180*fbae27e8SPhilippe Mathieu-Daudé             tco_timer_stop(tr);
181*fbae27e8SPhilippe Mathieu-Daudé         }
182*fbae27e8SPhilippe Mathieu-Daudé         break;
183*fbae27e8SPhilippe Mathieu-Daudé     case TCO2_CNT:
184*fbae27e8SPhilippe Mathieu-Daudé         tr->tco.cnt2 = val;
185*fbae27e8SPhilippe Mathieu-Daudé         break;
186*fbae27e8SPhilippe Mathieu-Daudé     case TCO_MESSAGE1:
187*fbae27e8SPhilippe Mathieu-Daudé         tr->tco.msg1 = val;
188*fbae27e8SPhilippe Mathieu-Daudé         break;
189*fbae27e8SPhilippe Mathieu-Daudé     case TCO_MESSAGE2:
190*fbae27e8SPhilippe Mathieu-Daudé         tr->tco.msg2 = val;
191*fbae27e8SPhilippe Mathieu-Daudé         break;
192*fbae27e8SPhilippe Mathieu-Daudé     case TCO_WDCNT:
193*fbae27e8SPhilippe Mathieu-Daudé         tr->tco.wdcnt = val;
194*fbae27e8SPhilippe Mathieu-Daudé         break;
195*fbae27e8SPhilippe Mathieu-Daudé     case TCO_TMR:
196*fbae27e8SPhilippe Mathieu-Daudé         tr->tco.tmr = val;
197*fbae27e8SPhilippe Mathieu-Daudé         break;
198*fbae27e8SPhilippe Mathieu-Daudé     case SW_IRQ_GEN:
199*fbae27e8SPhilippe Mathieu-Daudé         tr->sw_irq_gen = val;
200*fbae27e8SPhilippe Mathieu-Daudé         break;
201*fbae27e8SPhilippe Mathieu-Daudé     }
202*fbae27e8SPhilippe Mathieu-Daudé }
203*fbae27e8SPhilippe Mathieu-Daudé 
204*fbae27e8SPhilippe Mathieu-Daudé static uint64_t tco_io_readw(void *opaque, hwaddr addr, unsigned width)
205*fbae27e8SPhilippe Mathieu-Daudé {
206*fbae27e8SPhilippe Mathieu-Daudé     TCOIORegs *tr = opaque;
207*fbae27e8SPhilippe Mathieu-Daudé     return tco_ioport_readw(tr, addr);
208*fbae27e8SPhilippe Mathieu-Daudé }
209*fbae27e8SPhilippe Mathieu-Daudé 
210*fbae27e8SPhilippe Mathieu-Daudé static void tco_io_writew(void *opaque, hwaddr addr, uint64_t val,
211*fbae27e8SPhilippe Mathieu-Daudé                           unsigned width)
212*fbae27e8SPhilippe Mathieu-Daudé {
213*fbae27e8SPhilippe Mathieu-Daudé     TCOIORegs *tr = opaque;
214*fbae27e8SPhilippe Mathieu-Daudé     tco_ioport_writew(tr, addr, val);
215*fbae27e8SPhilippe Mathieu-Daudé }
216*fbae27e8SPhilippe Mathieu-Daudé 
217*fbae27e8SPhilippe Mathieu-Daudé static const MemoryRegionOps tco_io_ops = {
218*fbae27e8SPhilippe Mathieu-Daudé     .read = tco_io_readw,
219*fbae27e8SPhilippe Mathieu-Daudé     .write = tco_io_writew,
220*fbae27e8SPhilippe Mathieu-Daudé     .valid.min_access_size = 1,
221*fbae27e8SPhilippe Mathieu-Daudé     .valid.max_access_size = 4,
222*fbae27e8SPhilippe Mathieu-Daudé     .impl.min_access_size = 1,
223*fbae27e8SPhilippe Mathieu-Daudé     .impl.max_access_size = 2,
224*fbae27e8SPhilippe Mathieu-Daudé     .endianness = DEVICE_LITTLE_ENDIAN,
225*fbae27e8SPhilippe Mathieu-Daudé };
226*fbae27e8SPhilippe Mathieu-Daudé 
227*fbae27e8SPhilippe Mathieu-Daudé void acpi_pm_tco_init(TCOIORegs *tr, MemoryRegion *parent)
228*fbae27e8SPhilippe Mathieu-Daudé {
229*fbae27e8SPhilippe Mathieu-Daudé     *tr = (TCOIORegs) {
230*fbae27e8SPhilippe Mathieu-Daudé         .tco = {
231*fbae27e8SPhilippe Mathieu-Daudé             .rld      = TCO_RLD_DEFAULT,
232*fbae27e8SPhilippe Mathieu-Daudé             .din      = TCO_DAT_IN_DEFAULT,
233*fbae27e8SPhilippe Mathieu-Daudé             .dout     = TCO_DAT_OUT_DEFAULT,
234*fbae27e8SPhilippe Mathieu-Daudé             .sts1     = TCO1_STS_DEFAULT,
235*fbae27e8SPhilippe Mathieu-Daudé             .sts2     = TCO2_STS_DEFAULT,
236*fbae27e8SPhilippe Mathieu-Daudé             .cnt1     = TCO1_CNT_DEFAULT,
237*fbae27e8SPhilippe Mathieu-Daudé             .cnt2     = TCO2_CNT_DEFAULT,
238*fbae27e8SPhilippe Mathieu-Daudé             .msg1     = TCO_MESSAGE1_DEFAULT,
239*fbae27e8SPhilippe Mathieu-Daudé             .msg2     = TCO_MESSAGE2_DEFAULT,
240*fbae27e8SPhilippe Mathieu-Daudé             .wdcnt    = TCO_WDCNT_DEFAULT,
241*fbae27e8SPhilippe Mathieu-Daudé             .tmr      = TCO_TMR_DEFAULT,
242*fbae27e8SPhilippe Mathieu-Daudé         },
243*fbae27e8SPhilippe Mathieu-Daudé         .sw_irq_gen    = SW_IRQ_GEN_DEFAULT,
244*fbae27e8SPhilippe Mathieu-Daudé         .tco_timer     = timer_new_ns(QEMU_CLOCK_VIRTUAL, tco_timer_expired, tr),
245*fbae27e8SPhilippe Mathieu-Daudé         .expire_time   = -1,
246*fbae27e8SPhilippe Mathieu-Daudé         .timeouts_no   = 0,
247*fbae27e8SPhilippe Mathieu-Daudé     };
248*fbae27e8SPhilippe Mathieu-Daudé     memory_region_init_io(&tr->io, memory_region_owner(parent),
249*fbae27e8SPhilippe Mathieu-Daudé                           &tco_io_ops, tr, "sm-tco", ICH9_PMIO_TCO_LEN);
250*fbae27e8SPhilippe Mathieu-Daudé     memory_region_add_subregion(parent, ICH9_PMIO_TCO_RLD, &tr->io);
251*fbae27e8SPhilippe Mathieu-Daudé }
252*fbae27e8SPhilippe Mathieu-Daudé 
253*fbae27e8SPhilippe Mathieu-Daudé const VMStateDescription vmstate_tco_io_sts = {
254*fbae27e8SPhilippe Mathieu-Daudé     .name = "tco io device status",
255*fbae27e8SPhilippe Mathieu-Daudé     .version_id = 1,
256*fbae27e8SPhilippe Mathieu-Daudé     .minimum_version_id = 1,
257*fbae27e8SPhilippe Mathieu-Daudé     .fields      = (VMStateField[]) {
258*fbae27e8SPhilippe Mathieu-Daudé         VMSTATE_UINT16(tco.rld, TCOIORegs),
259*fbae27e8SPhilippe Mathieu-Daudé         VMSTATE_UINT8(tco.din, TCOIORegs),
260*fbae27e8SPhilippe Mathieu-Daudé         VMSTATE_UINT8(tco.dout, TCOIORegs),
261*fbae27e8SPhilippe Mathieu-Daudé         VMSTATE_UINT16(tco.sts1, TCOIORegs),
262*fbae27e8SPhilippe Mathieu-Daudé         VMSTATE_UINT16(tco.sts2, TCOIORegs),
263*fbae27e8SPhilippe Mathieu-Daudé         VMSTATE_UINT16(tco.cnt1, TCOIORegs),
264*fbae27e8SPhilippe Mathieu-Daudé         VMSTATE_UINT16(tco.cnt2, TCOIORegs),
265*fbae27e8SPhilippe Mathieu-Daudé         VMSTATE_UINT8(tco.msg1, TCOIORegs),
266*fbae27e8SPhilippe Mathieu-Daudé         VMSTATE_UINT8(tco.msg2, TCOIORegs),
267*fbae27e8SPhilippe Mathieu-Daudé         VMSTATE_UINT8(tco.wdcnt, TCOIORegs),
268*fbae27e8SPhilippe Mathieu-Daudé         VMSTATE_UINT16(tco.tmr, TCOIORegs),
269*fbae27e8SPhilippe Mathieu-Daudé         VMSTATE_UINT8(sw_irq_gen, TCOIORegs),
270*fbae27e8SPhilippe Mathieu-Daudé         VMSTATE_TIMER_PTR(tco_timer, TCOIORegs),
271*fbae27e8SPhilippe Mathieu-Daudé         VMSTATE_INT64(expire_time, TCOIORegs),
272*fbae27e8SPhilippe Mathieu-Daudé         VMSTATE_UINT8(timeouts_no, TCOIORegs),
273*fbae27e8SPhilippe Mathieu-Daudé         VMSTATE_END_OF_LIST()
274*fbae27e8SPhilippe Mathieu-Daudé     }
275*fbae27e8SPhilippe Mathieu-Daudé };
276