1228431Sfabient/*-
2228802Sfabient * Copyright (c) 2011 Fabien Thomas <fabient@FreeBSD.org>
3228431Sfabient * All rights reserved.
4228431Sfabient *
5228431Sfabient * Redistribution and use in source and binary forms, with or without
6228431Sfabient * modification, are permitted provided that the following conditions
7228431Sfabient * are met:
8228431Sfabient * 1. Redistributions of source code must retain the above copyright
9228431Sfabient *    notice, this list of conditions and the following disclaimer.
10228431Sfabient * 2. Redistributions in binary form must reproduce the above copyright
11228431Sfabient *    notice, this list of conditions and the following disclaimer in the
12228431Sfabient *    documentation and/or other materials provided with the distribution.
13228431Sfabient *
14228431Sfabient * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15228431Sfabient * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16228431Sfabient * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17228431Sfabient * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18228431Sfabient * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19228431Sfabient * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20228431Sfabient * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21228431Sfabient * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22228431Sfabient * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23228431Sfabient * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24228431Sfabient * SUCH DAMAGE.
25228431Sfabient *
26228431Sfabient * $FreeBSD$
27228431Sfabient */
28228431Sfabient
29228431Sfabient#ifndef _VIAWD_H_
30228431Sfabient#define _VIAWD_H_
31228431Sfabient
32228431Sfabientstruct viawd_device {
33228431Sfabient	uint16_t		device;
34228431Sfabient	char			*desc;
35228431Sfabient};
36228431Sfabient
37228431Sfabientstruct viawd_softc {
38228431Sfabient	device_t		dev;
39228431Sfabient	device_t		sb_dev;
40228431Sfabient
41228431Sfabient	int			wd_rid;
42228431Sfabient	struct resource		*wd_res;
43228431Sfabient
44228431Sfabient	eventhandler_tag	ev_tag;
45228431Sfabient	unsigned int		timeout;
46228431Sfabient};
47228431Sfabient
48228431Sfabient#define VENDORID_VIA		0x1106
49228431Sfabient#define DEVICEID_VT8251		0x3287
50228431Sfabient#define DEVICEID_CX700		0x8324
51228431Sfabient#define DEVICEID_VX800		0x8353
52228431Sfabient#define DEVICEID_VX855		0x8409
53228431Sfabient#define DEVICEID_VX900		0x8410
54228431Sfabient
55228431Sfabient#define VIAWD_CONFIG_BASE	0xE8
56228431Sfabient
57228431Sfabient#define VIAWD_MEM_LEN		8
58228431Sfabient
59228431Sfabient#define VIAWD_MEM_CTRL		0x00
60228431Sfabient#define VIAWD_MEM_CTRL_TRIGGER	0x000000080
61228431Sfabient#define VIAWD_MEM_CTRL_DISABLE	0x000000008
62228431Sfabient#define VIAWD_MEM_CTRL_POWEROFF	0x000000004
63228431Sfabient#define VIAWD_MEM_CTRL_FIRED	0x000000002
64228431Sfabient#define VIAWD_MEM_CTRL_ENABLE	0x000000001
65228431Sfabient
66228431Sfabient#define VIAWD_MEM_COUNT		0x04
67228431Sfabient
68228431Sfabient#define VIAWD_MEM_COUNT_MIN	1
69228431Sfabient#define VIAWD_MEM_COUNT_MAX	1023
70228431Sfabient
71228431Sfabient#define VIAWD_TIMEOUT_SHUTDOWN	(5 * 60)
72228431Sfabient
73228431Sfabient#endif
74