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