xref: /aosp_15_r20/external/coreboot/util/superiotool/winbond.c (revision b9411a12aaaa7e1e6a6fb7c5e057f44ee179a49c)
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 
3 #include "superiotool.h"
4 
5 #define DEVICE_ID_REG_OLD	0x09
6 
7 #define DEVICE_ID_REG		0x20
8 #define DEVICE_REV_REG		0x21
9 
10 /**
11  * The ID entries must be in 0xYYZ format, where YY is the device ID,
12  * and Z is bits 7..4 of the device revision register. We do not match
13  * bits 3..0 of the device revision here (at least for newer Super I/Os).
14  *
15  * But some of the older versions use both bytes (0x20 and 0x21), where
16  * register 0x21 holds the ID and the full 8 bits of 0x21 hold the revision.
17  *
18  * Some other Super I/Os only use bits 3..0 of 0x09 as ID.
19  */
20 static const struct superio_registers reg_table[] = {
21 	/* ID and rev[3..0] */
22 	{0x527, "W83977CTF", {	/* TODO: Not yet in sensors-detect */
23 		{EOT}}},
24 	{0x52f, "W83977EF/EG", {
25 		{NOLDN, NULL,
26 			{0x02,0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x28,0x2a,
27 			 0x2b,0x2c,0x2d,0x2e,0x2f,EOT},
28 			{RSVD,0x52,MISC,0xff,0xfe,MISC,0x00,MISC,0x00,0x00,
29 			 0x00,0x00,RSVD,RSVD,RSVD,EOT}},
30 		/* Some register defaults depend on the value of PNPCSV. */
31 		{0x0, "Floppy",
32 			{0x30,0x60,0x61,0x70,0x74,0xf0,0xf1,0xf2,0xf4,
33 			 0xf5,EOT},
34 			{0x01,0x03,0xf0,0x06,0x02,0x0e,0x00,0xff,0x00,
35 			 0x00,EOT}},
36 		{0x1, "Parallel port",
37 			{0x30,0x60,0x61,0x70,0x74,0xf0,EOT},
38 			{0x01,0x03,0x78,0x07,0x04,0x3f,EOT}},
39 		{0x2, "COM1",
40 			{0x30,0x60,0x61,0x70,0xf0,EOT},
41 			{0x01,0x03,0xf8,0x04,0x00,EOT}},
42 		{0x3, "COM2",
43 			{0x30,0x60,0x61,0x70,0xf0,0xf1,EOT},
44 			{0x01,0x02,0xf8,0x03,0x00,0x00,EOT}},
45 		{0x5, "Keyboard",
46 			{0x30,0x60,0x61,0x62,0x63,0x70,0x72,0xf0,EOT},
47 			{0x01,0x00,0x60,0x00,0x64,0x01,0x0c,0x83,EOT}},
48 		{0x7, "GPIO 1",
49 			{0x30,0x60,0x61,0x62,0x63,0x64,0x65,0x70,0x72,0xe0,
50 			 0xe1,0xe2,0xe3,0xe4,0xe5,0xe6,0xe7,0xf1,EOT},
51 			{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
52 			 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x00,EOT}},
53 		{0x8, "GPIO 2",
54 			{0x30,0x60,0x61,0x70,0x72,0xe8,0xe9,0xea,0xeb,0xec,
55 			 0xed,0xf0,0xf1,0xf2,0xf3,0xf4,EOT},
56 			{0x00,0x00,0x00,0x00,0x00,0x01,0x01,0x01,0x01,0x01,
57 			 0x01,0x00,RSVD,0x00,0x00,0x00,EOT}},
58 		{0xa, "ACPI",
59 			{0x30,0x70,0xe0,0xe1,0xe2,0xe3,0xe4,0xe5,0xe6,0xe7,
60 			 0xf0,0xf1,0xf3,0xf4,0xf6,0xf7,0xf9,0xfe,0xff,EOT},
61 			{0x00,0x00,0x00,0x00,MISC,MISC,MISC,0x00,0x00,0x00,
62 			 0x00,0x00,0x00,0x00,0x00,0x00,0x00,RSVD,RSVD,EOT}},
63 		{EOT}}},
64 	{0x595, "W83627SF", {	/* TODO: Not yet in sensors-detect */
65 		{EOT}}},
66 	{0x601, "W83697HF/F/HG", { /* No G version? */
67 		{NOLDN, NULL,
68 			{0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x28,0x29,
69 			 0x2a,EOT},
70 			{0x60,NANA,0xff,0x00,0x00,0x00,0x00,0x00,0x00,
71 			 MISC,EOT}},
72 		/* Some register defaults depend on the value of PNPCSV. */
73 		{0x0, "Floppy",
74 			{0x30,0x60,0x61,0x70,0x74,0xf0,0xf1,0xf2,0xf4,
75 			 0xf5,EOT},
76 			{0x01,0x03,0xf0,0x06,0x02,0x0e,0x00,0xff,0x00,
77 			 0x00,EOT}},
78 		{0x1, "Parallel port",
79 			{0x30,0x60,0x61,0x70,0x74,0xf0,EOT},
80 			{0x01,0x03,0x78,0x07,0x04,0x3f,EOT}},
81 		{0x2, "COM1",
82 			{0x30,0x60,0x61,0x70,0xf0,EOT},
83 			{0x01,0x03,0xf8,0x04,0x00,EOT}},
84 		{0x3, "COM2",
85 			{0x30,0x60,0x61,0x70,0xf0,0xf1,EOT},
86 			{0x01,0x02,0xf8,0x03,0x00,0x00,EOT}},
87 		{0x6, "Consumer IR",
88 			{0x30,0x60,0x61,0x70,EOT},
89 			{0x00,0x00,0x00,0x00,EOT}},
90 		{0x7, "Game port, GPIO 1",
91 			{0x30,0x60,0x61,0x62,0x63,0xf0,0xf1,0xf2,EOT},
92 			{0x00,0x02,0x01,0x00,0x00,0xff,0x00,0x00,EOT}},
93 		{0x8, "MIDI port, GPIO 5",
94 			{0x30,0x60,0x61,0x62,0x63,0x70,0xf0,0xf1,0xf2,0xf3,
95 			 0xf4,0xf5,EOT},
96 			{0x00,0x03,0x30,0x00,0x00,0x09,0xff,0x00,0x00,0x00,
97 			 0x00,0x00,EOT}},
98 		{0x9, "GPIO 2, GPIO 3, GPIO 4",
99 			{0x30,0x60,0x61,0xf0,0xf1,0xf2,0xf3,0xf4,0xf5,0xf6,
100 			 0xf7,0xf8,0xf5,EOT},
101 			{0x00,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,
102 			 0x00,0x00,0x00,EOT}},
103 		{0xa, "ACPI",
104 			{0x30,0x70,0xe0,0xe1,0xe2,0xe5,0xe6,0xe7,
105 			 0xf0,0xf1,0xf3,0xf4,0xf6,0xf7,0xf9,EOT},
106 			{0x00,0x00,0x00,0x00,NANA,0x00,0x00,0x00,
107 			 0x00,0x00,0x00,0x00,0x00,0x00,0x00,EOT}},
108 		{0xb, "Hardware monitor",
109 			{0x30,0x60,0x61,0x70,EOT},
110 			{0x00,0x00,0x00,0x00,EOT}},
111 		{EOT}}},
112 	{0x610, "W83L517D/D-F", {
113 		{EOT}}},
114 	{0x708, "W83637HF/HG", {
115 		{EOT}}},
116 	{0x828, "W83627THF/THG", { /* We assume rev is bits 3..0 of 0x21. */
117 		{NOLDN, NULL,
118 			{0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x28,0x29,0x2a,
119 			 0x2b,0x2c,0x2d,0x2e,0x2f,EOT},
120 			{0x82,NANA,0xff,0x00,MISC,0x00,MISC,0x00,0x00,0x00,
121 			 MISC,MISC,MISC,0x00,0x00,EOT}},
122 		/* Some register defaults depend on the value of PNPCSV. */
123 		{0x0, "Floppy",
124 			{0x30,0x60,0x61,0x70,0x74,0xf0,0xf1,0xf2,0xf4,
125 			 0xf5,EOT},
126 			{0x01,0x03,0xf0,0x06,0x02,0x0e,0x00,0xff,0x00,
127 			 0x00,EOT}},
128 		{0x1, "Parallel port",
129 			{0x30,0x60,0x61,0x70,0x74,0xf0,EOT},
130 			{0x01,0x03,0x78,0x07,0x04,0x3f,EOT}},
131 		{0x2, "COM1",
132 			{0x30,0x60,0x61,0x70,0xf0,EOT},
133 			{0x01,0x03,0xf8,0x04,0x00,EOT}},
134 		{0x3, "COM2",
135 			{0x30,0x60,0x61,0x70,0xf0,0xf1,EOT},
136 			{0x01,0x02,0xf8,0x03,0x00,0x00,EOT}},
137 		{0x5, "Keyboard",
138 			{0x30,0x60,0x61,0x62,0x63,0x70,0x72,0xf0,EOT},
139 			{0x01,0x00,0x60,0x00,0x64,0x01,0x0c,0x80,EOT}},
140 		{0x7, "GPIO 1, GPIO 5, game port, MIDI port",
141 			{0x30,0x60,0x61,0x62,0x63,0x70,0xf0,0xf1,0xf2,0xf3,
142 			 0xf4,0xf5,EOT},
143 			{0x00,0x02,0x01,0x03,0x30,0x09,0xff,0x00,0x00,0xff,
144 			 0x00,0x00,EOT}},
145 		{0x8, "GPIO 2",
146 			{0x30,0xf0,0xf1,0xf2,0xf3,0xf4,0xf5,0xf6,0xf7,EOT},
147 			{0x00,0xff,0x00,0x00,0x00,RSVD,0x00,0x00,0x00,EOT}},
148 		{0x9, "GPIO 3, GPIO 4",
149 			{0x30,0xf0,0xf1,0xf2,0xf3,0xf4,0xf5,0xf6,EOT},
150 			{0x00,0xff,0x00,0x00,0x00,0xff,0x00,0x00,EOT}},
151 		{0xa, "ACPI",
152 			/* Note: Datasheet says 0xe2 can't be read/written. */
153 			{0x30,0x70,0xe0,0xe1,0xe2,0xe3,0xe4,0xe5,0xe6,0xe7,
154 			 0xf0,0xf1,0xf3,0xf4,0xf6,0xf7,0xf9,0xfe,0xff,EOT},
155 			{0x00,0x00,0x00,0x00,MISC,MISC,0x00,0x00,0x00,0x00,
156 			 0x00,0x00,0x00,0x00,0x00,0x00,0x00,RSVD,RSVD,EOT}},
157 		{0xb, "Hardware monitor",
158 			{0x30,0x60,0x61,0x70,EOT},
159 			{0x00,0x00,0x00,0x00,EOT}},
160 		{EOT}}},
161 #if 0
162 	{0x85x, "W83687THF", {	/* TODO: sensors-detect: 0x85 */
163 		{EOT}}},
164 #endif
165 	{0xa02, "W83627DHG", {
166 		{NOLDN, NULL,
167 			{0x02,0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,
168 			 0x29,0x2a,0x2b,0x2c,0x2d,0x2e,0x2f,EOT},
169 			{0x00,0xa0,NANA,0xff,0x00,MISC,0x00,MISC,RSVD,0x50,
170 			 0x00,0x00,RSVD,0xe2,0x21,0x00,0x00,EOT}},
171 		{0x0, "Floppy",
172 			{0x30,0x60,0x61,0x70,0x74,0xf0,0xf1,0xf2,0xf4,0xf5,
173 			 EOT},
174 			{0x01,0x03,0xf0,0x06,0x02,0x8e,0x00,0xff,0x00,0x00,
175 			 EOT}},
176 		{0x1, "Parallel port",
177 			{0x30,0x60,0x61,0x70,0x74,0xf0,EOT},
178 			{0x01,0x03,0x78,0x07,0x04,0x3f,EOT}},
179 		{0x2, "COM1",
180 			{0x30,0x60,0x61,0x70,0xf0,EOT},
181 			{0x01,0x03,0xf8,0x04,0x00,EOT}},
182 		{0x3, "COM2",
183 			{0x30,0x60,0x61,0x70,0xf0,0xf1,EOT},
184 			{0x01,0x02,0xf8,0x03,0x00,0x00,EOT}},
185 		{0x5, "Keyboard",
186 			{0x30,0x60,0x61,0x62,0x63,0x70,0x72,0xf0,EOT},
187 			{0x01,0x00,0x60,0x00,0x64,0x01,0x0c,0x83,EOT}},
188 		{0x6, "Serial peripheral interface",
189 			{0x30,0x62,0x63,EOT},
190 			{0x00,0x00,0x00,EOT}},
191 		{0x7, "GPIO 6",
192 			{0x30,0xf4,0xf5,0xf6,0xf7,EOT},
193 			{0x00,0xff,0x00,0x00,0x00,EOT}},
194 		{0x8, "WDTO#, PLED",
195 			{0x30,0xf5,0xf6,0xf7,EOT},
196 			{0x00,0x00,0x00,0x00,EOT}},
197 		{0x9, "GPIO 2, GPIO 3, GPIO 4, GPIO 5",
198 			{0x30,0xe0,0xe1,0xe2,0xe3,0xe4,0xe5,0xe6,0xe7,0xe8,
199 			 0xe9,0xf0,0xf1,0xf2,0xf3,0xf4,0xf5,0xf6,0xf7,0xfe,
200 			 EOT},
201 			{0x00,0xff,0x00,0x00,0xff,0x00,0x00,0x00,0x00,0x00,
202 			 0x00,0xff,0x00,0x00,0x00,0xff,0x00,0x00,0x00,0x00,
203 			 EOT}},
204 		{0xa, "ACPI",
205 			{0x30,0x70,0xe0,0xe1,0xe2,0xe3,0xe4,0xe5,0xe6,0xe7,
206 			 0xe8,0xe9,0xf2,0xf3,0xf4,0xf6,0xf7,0xfe,EOT},
207 			{0x00,0x00,0x01,0x00,0xff,0x08,0x00,RSVD,0x1c,0x00,
208 			 RSVD,RSVD,0x7c,0x00,0x00,0x00,0x00,0x00,EOT}},
209 		{0xb, "Hardware monitor",
210 			{0x30,0x60,0x61,0x70,0xf0,0xf1,0xf2,EOT},
211 			{0x00,0x00,0x00,0x00,0x81,0x00,0x00,EOT}},
212 		{0xc, "PECI, SST",
213 			{0xe0,0xe1,0xe2,0xe3,0xe4,0xe5,0xe8,0xf1,0xfe,0xff,
214 			 EOT},
215 			{0x00,0x48,0x48,0x48,0x48,0x00,0x00,0x48,0x00,0x00,
216 			 EOT}},
217 		{EOT}}},
218 	{0xa23, "W83627UHG = NCT6627UD", {	/* TODO: Not yet in sensors-detect	   */
219 		{NOLDN, NULL,			/* CR2B (485) is only valid for chip rev.E */
220 			{0x02,0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,
221 			 0x29,0x2a,0x2b,0x2c,0x2d,0x2e,0x2f,EOT},
222 			{0x00,0xa2,NANA,0xff,0xF0,MISC,0x00,MISC,RSVD,0x00,
223 			 0x00,0x00,0x00,0x02,0x00,0x00,0x00,EOT}},
224 		{0x0, "Floppy",
225 			{0x30,0x60,0x61,0x70,0x74,0xf0,0xf1,0xf2,0xf4,0xf5,
226 			 EOT},
227 			{0x01,0x03,0xf0,0x06,0x02,0x8e,0x00,0xff,0x00,0x00,
228 			 EOT}},
229 		{0x1, "Parallel port",
230 			{0x30,0x60,0x61,0x70,0x74,0xf0,EOT},
231 			{0x01,0x03,0x78,0x07,0x04,0x3f,EOT}},
232 		{0x2, "UART A",
233 			{0x30,0x60,0x61,0x70,0xf0,EOT},
234 			{0x01,0x03,0xf8,0x04,0x00,EOT}},
235 		{0x3, "UART B",
236 			{0x30,0x60,0x61,0x70,0xf0,0xf1,EOT},
237 			{0x01,0x02,0xf8,0x03,0x00,0x00,EOT}},
238 		{0x5, "Keyboard",
239 			{0x30,0x60,0x61,0x62,0x63,0x70,0x72,0xf0,EOT},
240 			{0x01,0x00,0x60,0x00,0x64,0x01,0x0c,0x83,EOT}},
241 		{0x6, "UART C",
242 			{0x30,0x60,0x61,0x70,0xf0,EOT},
243 			{0x01,0x03,0xE0,0x04,0x00,EOT}},
244 		{0x7, "GPIO 3, GPIO 4",
245 			{0x30,0xe0,0xe1,0xe2,0xe3,0xe4,0xe5,0xe6,0xe7,EOT},
246 			{0x00,0xff,0x00,0x00,0x00,0xff,0x00,0x00,0x00,EOT}},
247 		{0x8, "WDTO#, PLED, GPIO 5,6 & GPIO Base Address",
248 			{0x30,0x60,0x61,
249 			 0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,
250 			 0xF5,0xF6,0xF7,EOT},
251 			{0x02,0x00,0x00,
252 			 0xFF,0x00,0x00,0x00,0xFF,0x1F,0x00,0x00,
253 			 0x00,0x00,0x00,EOT}},
254 		{0x9, "GPIO 1, GPIO 2 and SUSLED",
255 			{0x30,
256 			 0xe0,0xe1,0xe2,0xe3,0xe4,0xe5,0xe6,0xe7,
257 			 0xF3,EOT},
258 			{0x00,
259 			 0xff,0x00,0x00,0x00,0xff,0x00,0x00,0x00,
260 			 0x00,EOT}},
261 		{0xa, "ACPI",
262 			{0x30,0x70,0xe0,0xe1,0xe2,0xe3,0xe4,0xe5,0xe6,0xe7,
263 			 0xe8,0xe9,0xf2,0xf3,0xf4,0xf6,0xf7,0xfe,EOT},
264 			{0x00,0x00,0x01,0x00,0xff,0x08,0x00,0x00,0x1c,0x00,
265 			 RSVD,RSVD,0x3e,0x00,0x00,0x00,0x00,0x00,EOT}},
266 		{0xb, "Hardware monitor",
267 			{0x30,0x60,0x61,0x70,0xf0,0xf1,0xf2,EOT},
268 			{0x00,0x00,0x00,0x00,RSVD,RSVD,0x00,EOT}},
269 		{0xc, "PECI, SST",
270 			{0xe0,0xe1,0xe2,0xe3,0xe4,0xe5,0xe6,0xe7,0xe8,
271 			 0xf1,0xf2,0xf3,0xfe,0xff,EOT},
272 			{0x00,0x48,0x48,0x48,0x48,0x00,RSVD,RSVD,0x00,
273 			 0x48,0x50,0x10,0x23,0x5A,EOT}},
274 		{0xD, "UART D",
275 			{0x30,0x60,0x61,0x70,0xf0,EOT},
276 			{0x00,0x02,0xe0,0x03,0x00,EOT}},
277 		{0xE, "UART E",
278 			{0x30,0x60,0x61,0x70,0xf0,EOT},
279 			{0x00,0x03,0xe8,0x04,0x00,EOT}},
280 		{0xF, "UART F",
281 			{0x30,0x60,0x61,0x70,0xf0,EOT},
282 			{0x00,0x02,0xe8,0x03,0x00,EOT}},
283 		{EOT}}},
284 	{0xa51, "W83667HG", {
285 		{NOLDN, NULL,
286 			{0x02,0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,
287 			 0x29,0x2a,0x2b,0x2c,0x2d,0x2e,0x2f,EOT},
288 			{0x00,0xb3,NANA,0xff,0x00,MISC,0x00,MISC,0xff,0x20,
289 			 0x00,0x00,0x7f,0x0a,0x08,0x00,MISC,EOT}},
290 		{0x0, "Floppy",
291 			{0x30,0x60,0x61,0x70,0x74,0xf0,0xf1,0xf2,0xf4,0xf5,
292 			 EOT},
293 			{0x01,0x03,0xf0,0x06,0x02,0x8e,0x00,0xff,0x00,0x00,
294 			 EOT}},
295 		{0x1, "Parallel port",
296 			{0x30,0x60,0x61,0x70,0x74,0xf0,EOT},
297 			{0x01,0x03,0x78,0x07,0x04,0x3f,EOT}},
298 		{0x2, "COM1",
299 			{0x30,0x60,0x61,0x70,0xf0,EOT},
300 			{0x01,0x03,0xf8,0x04,0x00,EOT}},
301 		{0x3, "COM2",
302 			{0x30,0x60,0x61,0x70,0xf0,0xf1,EOT},
303 			{0x01,0x02,0xf8,0x03,0x00,0x00,EOT}},
304 		{0x5, "Keyboard",
305 			{0x30,0x60,0x61,0x62,0x63,0x70,0x72,0xf0,EOT},
306 			{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x83,EOT}},
307 		{0x6, "Serial peripheral interface",
308 			{0x30,0x62,0x63,EOT},
309 			{0x00,0x00,0x00,EOT}},
310 		{0x7, "GPIO 6, GPIO 7, GPIO 8, GPIO 9",
311 			{0x30,0xe0,0xe1,0xe2,0xe3,0xe4,0xe5,0xe6,0xe7,0xe8,
312 			 0xe9,0xea,0xeb,0xec,0xed,0xee,0xf4,0xf5,0xf6,0xf7,
313 			 0xf8,EOT},
314 			{0x18,0xff,0x00,0x00,0x00,0xef,0x00,0x00,0x00,0xff,
315 			 0x00,0x00,0x00,0x00,0x00,0x00,0xff,0x00,0x00,0x00,
316 			 0x00,EOT}},
317 		{0x8, "WDTO#, GPIO 1",
318 			{0x30,0xf0,0xf1,0xf2,0xf3,0xf4,0xf5,0xf6,0xf7,EOT},
319 			{0x00,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,EOT}},
320 		{0x9, "GPIO 2, GPIO 3, GPIO 4, GPIO 5",
321 			{0x30,0xe0,0xe1,0xe2,0xe3,0xe4,0xe5,0xe6,0xe7,0xe8,
322 			 0xe9,0xea,0xeb,0xf0,0xf1,0xf2,0xf3,0xf4,0xf5,0xf6,
323 			 0xf7,0xfe,EOT},
324 			{0x05,0xff,0x00,0x00,0x00,0xff,0x00,0x00,0x00,0x00,
325 			 0x00,0x00,0x00,0xff,0x00,0x00,0x00,0xff,0x00,0x00,
326 			 0x00,0x00,EOT}},
327 		{0xa, "ACPI",
328 			{0xe0,0xe1,0xe2,0xe3,0xe4,0xe5,0xe6,0xe7,0xe8,0xe9,
329 			 0xf2,0xf3,0xf4,0xf6,0xf7,0xfe,0xff,EOT},
330 			{0x01,0x00,0xff,0x00,0x00,0x02,0x1c,0x00,RSVD,0x00,
331 			 0x7c,0x00,0x00,0x00,0x00,0x00,0x30,EOT}},
332 		{0xb, "Hardware monitor, SB-TSI",
333 			{0x30,0x60,0x61,0x70,0xe0,0xe1,0xe2,0xe3,0xe4,0xf0,
334 			 0xf5,EOT},
335 			{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xC1,
336 			 0x10,EOT}},
337 		{0xc, "PECI",
338 			{0xe0,0xe1,0xe2,0xe3,0xe4,0xe5,0xe6,0xe8,0xe9,0xea,
339 			 0xec,0xee,0xef,0xf1,0xf2,0xf3,0xfe,0xff,EOT},
340 			{0x00,0x48,0x48,0x48,0x48,0x00,0x00,0x00,RSVD,0x00,
341 			 0x00,0x01,0x5a,0x48,0x50,0x10,0x80,0x01,EOT}},
342 		{0xd, "VID",
343 			{0xe0,0xe1,0xe2,0xe3,0xe4,0xe5,0xe6,0xe7,0xe8,0xec,
344 			 0xed,0xee,0xef,0xf3,EOT},
345 			{0x00,0x00,NANA,NANA,0x07,0x00,NANA,0x00,0x14,0x01,
346 			 0x00,0x88,0x00,0x04,EOT}},
347 		{0xf, "GPIO Push-Pull or Open-Drain selection",
348 			{0xe0,0xe1,0xe2,0xe3,0xe4,0xe5,0xe6,0xe7,0xe8,0xe9,
349 			 0xf0,0xf1,0xf2,0xf3,0xf4,0xf5,0xf6,0xf7,0xf8,0xf9,
350 			 0xfa,0xfb,0xfc,0xfd,0xfe,0xff,EOT},
351 			{0xff,0xff,0xfd,0xff,0xf7,0xcb,0x3f,0xff,0xff,0x00,
352 			 NANA,NANA,NANA,NANA,NANA,NANA,NANA,NANA,NANA,NANA,
353 			 NANA,NANA,NANA,NANA,NANA,NANA,EOT}},
354 		{EOT}}},
355 	{0xb07, "W83627DHG-P/-PT", {
356 		{NOLDN, NULL,
357 			{0x02,0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,
358 			 0x29,0x2a,0x2b,0x2c,0x2d,0x2e,0x2f,EOT},
359 			{0x00,0xb0,NANA,0xff,0x00,MISC,0x00,MISC,RSVD,0x50,
360 			 0x00,0x00,RSVD,0xe2,0x21,0x00,0x00,EOT}},
361 		{0x0, "Floppy",
362 			{0x30,0x60,0x61,0x70,0x74,0xf0,0xf1,0xf2,0xf4,0xf5,
363 			 EOT},
364 			{0x01,0x03,0xf0,0x06,0x02,0x8e,0x00,0xff,0x00,0x00,
365 			 EOT}},
366 		{0x1, "Parallel port",
367 			{0x30,0x60,0x61,0x70,0x74,0xf0,EOT},
368 			{0x01,0x03,0x78,0x07,0x04,0x3f,EOT}},
369 		{0x2, "COM1",
370 			{0x30,0x60,0x61,0x70,0xf0,EOT},
371 			{0x01,0x03,0xf8,0x04,0x00,EOT}},
372 		{0x3, "COM2",
373 			{0x30,0x60,0x61,0x70,0xf0,0xf1,EOT},
374 			{0x01,0x02,0xf8,0x03,0x00,0x00,EOT}},
375 		{0x5, "Keyboard",
376 			{0x30,0x60,0x61,0x62,0x63,0x70,0x72,0xf0,EOT},
377 			{0x01,0x00,0x60,0x00,0x64,0x01,0x0c,0x83,EOT}},
378 		{0x6, "Serial peripheral interface",
379 			{0x30,0x62,0x63,EOT},
380 			{0x00,0x00,0x00,EOT}},
381 		{0x7, "GPIO 6",
382 			{0x30,0xf4,0xf5,0xf6,0xf7,0xf8,EOT},
383 			{0x00,0xff,0x00,0x00,0x00,0x00,EOT}},
384 		{0x8, "WDTO#, PLED",
385 			{0x30,0xf5,0xf6,0xf7,EOT},
386 			{0x00,0x00,0x00,0x00,EOT}},
387 		{0x9, "GPIO 2, GPIO 3, GPIO 4, GPIO 5",
388 			{0x30,0xe0,0xe1,0xe2,0xe3,0xe4,0xe5,0xe6,0xe7,0xe8,
389 			 0xe9,0xf0,0xf1,0xf2,0xf3,0xf4,0xf5,0xf6,0xf7,0xf8,
390 			 0xf9,0xfa,0xfe,EOT},
391 			{0x00,0xff,0x00,0x00,0xff,0x00,0x00,0x00,0x00,0x00,
392 			 0x00,0xff,0x00,0x00,0x00,0xff,0x00,0x00,0x00,0x00,
393 			 0x00,0x00,0x00,EOT}},
394 		{0xa, "ACPI",
395 			{0x30,0x70,0xe0,0xe1,0xe2,0xe3,0xe4,0xe5,0xe6,0xe7,
396 			 0xe8,0xe9,0xf2,0xf3,0xf4,0xf6,0xf7,0xfe,EOT},
397 			{0x00,0x00,0x01,0x00,0xff,0x08,0x00,RSVD,0x1c,0x00,
398 			 RSVD,RSVD,0x7c,0x00,0x00,0x00,0x00,0x00,EOT}},
399 		{0xb, "Hardware monitor",
400 			{0x30,0x60,0x61,0x70,0xf0,0xf1,0xf2,EOT},
401 			{0x00,0x00,0x00,0x00,0x81,0x00,0x00,EOT}},
402 		{0xc, "PECI, SST",
403 			{0xe0,0xe1,0xe2,0xe3,0xe4,0xe5,0xe8,0xe9,0xea,0xec,
404 			 0xee,0xef,0xf1,0xf2,0xf3,0xfe,0xff,EOT},
405 			{0x00,0x48,0x48,0x48,0x48,0x00,0x00,RSVD,0x00,0x00,
406 			 0x01,0x5a,0x48,0x50,0x10,0x00,0x00,EOT}},
407 		{EOT}}},
408 	{0xb35, "Nuvoton NCT5571D", {
409 		{NOLDN, NULL,
410 			{0x02,0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,
411 			 0x2a,0x2b,0x2c,0x2d,0x2e,0x2f,EOT},
412 			{RSVD,0xb3,NANA,0xff,0x00,0x40,0x00,MISC,0xff,0x20,0x00,
413 			 0x00,0x7f,0x0a,0x08,0x00,MISC,EOT}},
414 		{0x2, "COM1",
415 			{0x30,0x60,0x61,0x70,0xf0,EOT},
416 			{0x01,0x03,0xf8,0x04,0x00,EOT}},
417 		{0x5, "Keyboard",
418 			{0x30,0x60,0x61,0x62,0x63,0x70,0x72,0xf0,EOT},
419 			{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x83,EOT}},
420 		{0x7, "GPIO 6, GPIO 8, GPIO 9",
421 			{0x30,0xe4,0xe5,0xe6,0xe7,0xe8,0xe9,0xea,0xeb,0xec,0xed,
422 			 0xee,0xf4,0xf5,0xf6,0xf7,0xf8,EOT},
423 			{0x18,0xef,MISC,0x00,0x00,0xff,MISC,0x00,0x00,RSVD,0x00,
424 			 0x00,0xff,MISC,0x00,0x00,0x00,EOT}},
425 		{0x9, "GPIO 2, GPIO 3, GPIO 5",
426 			{0x30,0xe0,0xe1,0xe2,0xe3,0xe4,0xe5,0xe6,0xe7,0xe9,0xea,
427 			 0xeb,0xf4,0xf5,0xf6,0xf7,0xfe,EOT},
428 			{0x05,0xff,MISC,0x00,0x00,0xff,MISC,0x00,0x00,0x00,0x00,
429 			 0x00,0xff,MISC,0x00,0x00,0x00,EOT}},
430 		{0xa, "ACPI",
431 			{0xe0,0xe1,0xe2,0xe3,0xe4,0xe5,0xe6,0xe7,0xe8,0xe9,0xf2,
432 			 0xf3,0xf4,0xf6,0xf7,0xfe,0xff,EOT},
433 			{0x01,0x00,0xff,0x00,0x00,0x02,0x1c,0x00,RSVD,0x00,0x7c,
434 			 0x00,0x00,0x00,0x00,0x00,0x30,EOT}},
435 		{0xb, "Hardware monitor",
436 			{0x30,0x60,0x61,0x70,0xe0,0xe1,0xe2,0xe3,0xf0,0xf5,EOT},
437 			{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc1,0x10,EOT}},
438 		{0xc, "PECI",
439 			{0xe0,0xe1,0xe2,0xe3,0xe4,0xe5,0xe6,0xe8,0xe9,0xea,0xec,
440 			 0xee,0xef,0xf1,0xf2,0xf3,0xfe,0xff,EOT},
441 			{0x00,0x48,0x48,0x48,0x48,0x00,0x00,0x00,RSVD,0x00,0x00,
442 			 0x01,0x5a,0x48,0x50,0x10,0x80,0x01,EOT}},
443 		{0xd, "SUSLED",
444 			{0xec,EOT},
445 			{0x01,EOT}},
446 		{0xf, "GPIO Push-Pull/OD Select",
447 			{0xe0,0xe1,0xe3,0xe4,0xe5,0xe6,0xe7,0xe8,0xe9,0xf0,0xf1,
448 			 0xf2,0xf3,0xf4,0xf5,0xf6,0xf7,0xf8,0xf9,0xfa,0xfb,0xfc,
449 			 0xfd,0xfe,0xff,EOT},
450 			{RSVD,0xfd,RSVD,0xf7,0xcb,RSVD,0xff,0xff,0x00,MISC,MISC,
451 			 MISC,MISC,MISC,MISC,MISC,MISC,MISC,MISC,MISC,MISC,MISC,
452 			 MISC,MISC,MISC,EOT}},
453 		{EOT}}},
454 
455 	/* ID and rev */
456 	{0x9771, "W83977F-A/G-A/AF-A/AG-A", {
457 		{EOT}}},
458 	{0x9777, "W83977AF", {
459 		/*
460 		 * W83977AF as found on the Advantech PCM-5820. We weren't able
461 		 * to find a datasheet (so far) which lists the 0x77 revision,
462 		 * but the hardware is there in the wild, so detect it...
463 		 */
464 		{EOT}}},
465 	{0x9773, "W83977TF", {
466 		{NOLDN, NULL,
467 			{0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x28,0x2a,0x2b,
468 			 0x2c,0x2d,0x2e,0x2f,EOT},
469 			{0x97,0x73,0xff,0xfe,MISC,0x00,MISC,0x00,0x00,0x00,
470 			 0x00,RSVD,RSVD,RSVD,EOT}},
471 		{0x0, "Floppy",
472 			{0x30,0x60,0x61,0x70,0x74,0xf0,0xf1,0xf2,0xf4,0xf5,
473 			 EOT},
474 			{0x01,0x03,0xf0,0x06,0x02,0x0e,0x00,0xff,0x00,0x00,
475 			 EOT}},
476 		{0x1, "Parallel port",
477 			{0x30,0x60,0x61,0x70,0x74,0xf0,EOT},
478 			{0x01,0x03,0x78,0x07,0x04,0x3f,EOT}},
479 		{0x2, "COM1",
480 			{0x30,0x60,0x61,0x70,0xf0,EOT},
481 			{0x01,0x03,0xf8,0x04,0x00,EOT}},
482 		{0x3, "COM2",
483 			{0x30,0x60,0x61,0x70,0xf0,0xf1,EOT},
484 			{0x01,0x02,0xf8,0x03,0x00,0x00,EOT}},
485 		{0x5, "Keyboard / mouse",
486 			{0x30,0x60,0x61,0x62,0x63,0x70,0x72,0xf0,EOT},
487 			{0x01,0x00,0x60,0x00,0x64,0x01,0x0c,0x83,EOT}},
488 		{0x7, "GPIO 1",
489 			{0x30,0x60,0x61,0x62,0x63,0x64,0x65,0x70,0x72,0xe0,
490 			 0xe1,0xe2,0xe3,0xe4,0xe5,0xe6,0xe7,0xf1,EOT},
491 			{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
492 			 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x00,EOT}},
493 		{0x8, "GPIO 2",
494 			{0x30,0x60,0x61,0x70,0x72,0xe8,0xe9,0xea,0xeb,0xec,
495 			 0xed,0xee,0xf0,0xf1,0xf2,0xf3,0xf4,EOT},
496 			{0x00,0x00,0x00,0x00,0x00,0x01,0x01,0x01,0x01,0x01,
497 			 0x01,0x01,0x00,RSVD,0x00,0x00,0x00,EOT}},
498 		{0x9, "GPIO 3",
499 			{0x30,0x60,0x61,0x62,0x63,0x64,0x65,0x70,0x72,0xe0,
500 			 0xe1,0xe2,0xe3,0xe4,0xe5,0xe6,0xe7,0xf1,EOT},
501 			{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
502 			 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x00,EOT}},
503 		{0xa, "ACPI",
504 			{0x30,0x60,0x61,0x62,0x63,0x64,0x65,0x70,0xe0,0xe1,
505 			 0xe2,0xe3,0xe4,0xf0,0xf1,0xf2,0xf3,0xf4,0xf5,0xf6,
506 			 0xf7,0xfe,0xff,EOT},
507 			{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
508 			 NANA,MISC,RSVD,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
509 			 0x00,RSVD,RSVD,EOT}},
510 		{EOT}}},
511 	{0x9774, "W83977ATF", {
512 		{EOT}}},
513 
514 	{0xb07, "W83527HG", {	/* TODO: Not yet in sensors-detect */
515 		{NOLDN, NULL,
516 			{0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,
517 			 0x2a,0x2b,0x2c,0x2d,0x2e,0x2f,EOT},
518 			{0xB0,0x73,0xff,0x00,MISC,0x00,0x00,RSVD,0x50,0x00,
519 			 0x00,RSVD,0xe2,0x21,0x00,0x00,EOT}},
520 		{0x5, "Keyboard",
521 			{0x30,0x60,0x61,0x62,0x63,0x70,0x72,0xf0,EOT},
522 			{0x01,0x00,0x60,0x00,0x64,0x01,0x0c,0x83,EOT}},
523 		{0x8, "WDTO#, PLED",
524 			{0x30,0xf5,0xf6,0xf7,EOT},
525 			{0x00,0x00,0x00,0x00,EOT}},
526 		{0x9, "GPIO 2, GPIO3, GPIO5",
527 			{0x30,0xe0,0xe1,0xe2,0xe3,0xe4,0xe5,0xe6,0xe7,0xe9,
528 			 0xf0,0xf1,0xf2,0xf3,0xf8,0xf9,0xfa,0xfe,EOT},
529 			{0x00,0xff,0x00,0x00,0xff,0x00,0x00,0x00,0x00,0x00,
530 			 0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,EOT}},
531 		{0xa, "ACPI",
532 			{0x30,0x70,0xe0,0xe1,0xe2,0xe3,0xe4,0xe5,0xe6,0xe7,
533 			 0xe8,0xe9,0xf2,0xf3,0xf4,0xf6,0xf7,0xfe,EOT},
534 			{0x00,0x00,0x01,0x00,0xff,0x08,0x00,0x00,0x1c,0x00,
535 			 RSVD,RSVD,0x7c,0x00,0x00,0x00,0x00,0x00,EOT}},
536 		{0xb, "Hardware monitor",
537 			{0x30,0x60,0x61,0x70,0xf0,0xf1,0xf2,EOT},
538 			{0x00,0x00,0x00,0x00,0x81,RSVD,0x00,EOT}},
539 		{0xc, "PECI",
540 			{0xe0,0xe1,0xe2,0xe3,0xe4,0xe5,0xe8,0xe9,0xea,0xec,
541 			 0xfe,0xff,EOT},
542 			{0x00,0x48,0x48,0x48,0x48,0x00,0x00,RSVD,0x00,0x00,
543 			 0x00,0x00,EOT}},
544 		{EOT}}},
545 	/* ID only */
546 	{0x52, "W83627HF/F/HG/G", {
547 		{NOLDN, NULL,
548 			{0x02,0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x28,0x29,
549 			 0x2a,0x2b,0x2c,0x2e,0x2f,EOT},
550 			{0x00,0x52,NANA,0xff,0x00,MISC,0x00,0x00,0x00,0x00,
551 			 0x7c,0xc0,0x00,0x00,0x00,EOT}},
552 		{0x0, "Floppy",
553 			{0x30,0x60,0x61,0x70,0x74,0xf0,0xf1,0xf2,0xf4,
554 			 0xf5,EOT},
555 			{0x01,0x03,0xf0,0x06,0x02,0x0e,0x00,0xff,0x00,
556 			 0x00,EOT}},
557 		{0x1, "Parallel port",
558 			{0x30,0x60,0x61,0x70,0x74,0xf0,EOT},
559 			{0x01,0x03,0x78,0x07,0x04,0x3f,EOT}},
560 		{0x2, "COM1",
561 			{0x30,0x60,0x61,0x70,0xf0,EOT},
562 			{0x01,0x03,0xf8,0x04,0x00,EOT}},
563 		{0x3, "COM2",
564 			{0x30,0x60,0x61,0x70,0xf0,0xf1,EOT},
565 			{0x01,0x02,0xf8,0x03,0x00,0x00,EOT}},
566 		{0x5, "Keyboard",
567 			{0x30,0x60,0x61,0x62,0x63,0x70,0x72,0xf0,EOT},
568 			{0x01,0x00,0x60,0x00,0x64,0x01,0x0c,0x80,EOT}},
569 		{0x6, "Consumer IR",
570 			{0x30,0x60,0x61,0x70,EOT},
571 			{0x00,0x00,0x00,0x00,EOT}},
572 		{0x7, "Game port, MIDI port, GPIO 1",
573 			{0x30,0x60,0x61,0x62,0x63,0x70,0xf0,0xf1,0xf2,EOT},
574 			{0x00,0x02,0x01,0x03,0x30,0x09,0xff,0x00,0x00,EOT}},
575 		{0x8, "GPIO 2, watchdog timer",
576 			{0x30,0xf0,0xf1,0xf2,0xf3,0xf5,0xf6,0xf6,0xf7,EOT},
577 			{0x00,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,EOT}},
578 		{0x9, "GPIO 3",
579 			{0x30,0xf0,0xf1,0xf2,0xf3,EOT},
580 			{0x00,0xff,0x00,0x00,0x00,EOT}},
581 		{0xa, "ACPI",
582 			{0x30,0x70,0xe0,0xe1,0xe2,0xe3,0xe4,0xe5,0xe6,0xe7,
583 			 0xf0,0xf1,0xf3,0xf4,0xf6,0xf7,0xf9,0xfe,0xff,EOT},
584 			{0x00,0x00,0x00,0x00,NANA,NANA,0x00,0x00,0x00,0x00,
585 			 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,EOT}},
586 		{0xb, "Hardware monitor",
587 			{0x30,0x60,0x61,0x70,0xf0,EOT},
588 			{0x00,0x00,0x00,0x00,0x00,EOT}},
589 		{EOT}}},
590 	{0x68, "W83697SF/UF/UG", {
591 		/* ID:  0x68 (for W83697SF/UF/UG)
592 		 * Rev: 0x1X (for W83697SF)
593 		 *      0x0X (for W83697SF) -- sic!
594 		 *      0x1X (for W83697UF/UG)
595 		 */
596 		{NOLDN, NULL,
597 			{0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x28,0x29,0x2a,
598 			 0x2b,0x2c,EOT},
599 			{0x68,NANA,0xef,0xfe,MISC,0x00,0x00,0x00,0x00,MISC,
600 			 0x00,0x30,EOT}},
601 		{0x0, "Floppy",
602 			{0x30,0x60,0x61,0x70,0x74,0xf0,0xf1,0xf2,0xf4,0xf5,
603 			 EOT},
604 			{0x01,0x03,0xf0,0x06,0x02,0x0e,0x00,0xff,0x00,0x00,
605 			 EOT}},
606 		{0x1, "Parallel port",
607 			{0x30,0x60,0x61,0x70,0x74,0xf0,EOT},
608 			{0x01,0x03,0x78,0x07,0x03,0x3f,EOT}},
609 		{0x2, "COM1",
610 			{0x30,0x60,0x61,0x70,0xf0,EOT},
611 			{0x01,0x03,0xf8,0x04,0x00,EOT}},
612 		{0x3, "COM2",
613 			{0x30,0x60,0x61,0x70,0xf0,0xf1,EOT},
614 			{0x01,0x02,0xf8,0x03,0x00,0x00,EOT}},
615 		{0x7, "Game port, GPIO 1",
616 			{0x30,0x60,0x61,0x62,0x63,0xf0,0xf1,0xf2,EOT},
617 			{0x00,0x02,0x01,0x00,0x00,0xff,0x00,0x00,EOT}},
618 		{0x8, "MIDI port, GPIO 5",
619 			{0x30,0x60,0x61,0x62,0x63,0x70,0xf0,0xf1,0xf2,0xf3,
620 			 0xf4,0xf5,EOT},
621 			{0x00,0x03,0x30,0x00,0x00,0x09,0xff,0x00,0x00,0x00,
622 			 0x00,0x00,EOT}},
623 		{0x9, "GPIO 2, GPIO 3, GPIO 4",
624 			{0x30,0x60,0x61,0xf0,0xf1,0xf2,0xf3,0xf4,0xf5,0xf6,
625 			 0xf7,0xf8,EOT},
626 			{0x00,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,
627 			 0x00,0x00,EOT}},
628 		{0xa, "ACPI",
629 			{0x30,0x70,0xf0,0xf1,0xf2,0xf3,0xf4,0xf6,0xf7,0xf9,
630 			 0xfa,EOT},
631 			{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
632 			 0x00,EOT}},
633 		{0xb, "PWM",
634 			{0x30,0x60,0x61,EOT},
635 			{0x00,0x00,0x00,EOT}},
636 		{0xc, "Smart card",
637 			{0x30,0x60,0x61,0x70,0xf0,EOT},
638 			{0x00,0x00,0x00,0x00,0x00,EOT}},
639 		{0xd, "URC, GPIO 6",
640 			{0x30,0x60,0x61,0x62,0x63,0x70,0xf0,0xf1,0xf2,0xf3,
641 			 0xf4,EOT},
642 			{0x00,0x03,0xe8,0x00,0x00,0x00,0x00,0xff,0x00,0x00,
643 			 0x00,EOT}},
644 		{0xe, "URD, GPIO 7",
645 			{0x30,0x60,0x61,0x62,0x63,0x70,0xf0,0xf1,0xf2,0xf3,
646 			 EOT},
647 			{0x00,0x02,0xe8,0x00,0x00,0x00,0x00,0xff,0x00,0x00,
648 			 EOT}},
649 		{0xf, "GPIO 8",
650 			{0x30,0x60,0x61,0xf0,0xf1,0xf2,EOT},
651 			{0x00,0x00,0x00,0xff,0x00,0x00,EOT}},
652 		{EOT}}},
653 	{0x88, "W83627EHF/EF/EHG/EG", {
654 		/*
655 		 * As per datasheet the ID should be 0x886? here.
656 		 * Not mentioned in the datasheet, but sensors-detect says
657 		 * 0x8853 is also possible. Also, the ASUS A8V-E Deluxe
658 		 * (W83627EHF) has an ID of 0x8854 (verified on hardware).
659 		 * So we now assume all 0x88?? IDs to mean W83627EHF/EF/EHG/EG.
660 		 */
661 		{NOLDN, NULL,
662 			{0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,
663 			 0x29,0x2a,0x2b,0x2c,0x2d,0x2e,0x2f,EOT},
664 			{0x88,MISC,0xff,0x00,MISC,0x00,MISC,RSVD,0x50,
665 			 0x04,0x00,RSVD,0x00,0x21,0x00,0x00,EOT}},
666 		{0x0, "Floppy",
667 			{0x30,0x60,0x61,0x70,0x74,0xf0,0xf1,0xf2,0xf4,
668 			 0xf5,EOT},
669 			{0x01,0x03,0xf0,0x06,0x02,0x8e,0x00,0xff,0x00,
670 			 0x00,EOT}},
671 		{0x1, "Parallel port",
672 			{0x30,0x60,0x61,0x70,0x74,0xf0,EOT},
673 			{0x01,0x03,0x78,0x07,0x04,0x3f,EOT}},
674 		{0x2, "COM1",
675 			{0x30,0x60,0x61,0x70,0xf0,EOT},
676 			{0x01,0x03,0xf8,0x04,0x00,EOT}},
677 		{0x3, "COM2",
678 			{0x30,0x60,0x61,0x70,0xf0,0xf1,EOT},
679 			{0x01,0x02,0xf8,0x03,0x00,0x00,EOT}},
680 		{0x5, "Keyboard",
681 			{0x30,0x60,0x61,0x62,0x63,0x70,0x72,0xf0,EOT},
682 			{0x01,0x00,0x60,0x00,0x64,0x01,0x0c,0x83,EOT}},
683 		{0x6, "Serial flash interface",
684 			{0x30,0x62,0x63,EOT},
685 			{0x00,0x00,0x00,EOT}},
686 		{0x7, "GPIO 1, GPIO 6, game port, MIDI port",
687 			{0x30,0x60,0x61,0x62,0x63,0x70,0xf0,0xf1,0xf2,0xf3,
688 			 0xf4,0xf5,0xf6,0xf7,EOT},
689 			{0x00,0x02,0x01,0x03,0x30,0x09,0xff,0x00,0x00,0x00,
690 			 0xff,0x00,0x00,0x00,EOT}},
691 		{0x8, "WDTO#, PLED",
692 			{0x30,0xf5,0xf6,0xf7,EOT},
693 			{0x00,0x00,0x00,0x00,EOT}},
694 		{0x9, "GPIO 2, GPIO 3, GPIO 4, GPIO 5, SUSLED",
695 			{0x30,0xe0,0xe1,0xe2,0xe3,0xe4,0xe5,0xf0,0xf1,0xf2,
696 			 0xf3,0xf4,0xf5,0xf6,0xf7,EOT},
697 			{0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,
698 			 0x00,0xff,0x00,0x00,0x00,EOT}},
699 		{0xa, "ACPI",
700 			{0x30,0x70,0xe0,0xe1,0xe2,0xe3,0xe4,0xe5,0xe6,0xe7,
701 			 0xe8,0xf2,0xf3,0xf4,0xf6,0xf7,EOT},
702 			{0x00,0x00,0x01,0x00,0xff,0x08,0x00,RSVD,0x00,0x00,
703 			 RSVD,0x7c,0x00,0x00,0x00,0x00,EOT}},
704 		{0xb, "Hardware monitor",
705 			{0x30,0x60,0x61,0x70,0xf0,0xf1,EOT},
706 			{0x00,0x00,0x00,0x00,0xc1,0x00,EOT}},
707 		{EOT}}},
708 
709 	/* ID[3..0] */
710 	{0xa, "W83877F", {
711 		{EOT}}},
712 	{0xb, "W83877AF", {
713 		{NOLDN, NULL,
714 			{0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,
715 			 0x0a,0x0b,0x0c,0x0d,0x0e,0x0f,0x10,0x11,0x12,0x13,
716 			 0x14,0x15,0x16,0x17,0x1e,0x20,0x21,0x22,0x23,0x24,
717 			 0x25,0x26,0x27,0x28,0x29,0x2a,0x2b,0x2c,0x2d,EOT},
718 			{0x00,0x00,0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x0a,
719 			 0x1f,0x0c,0x28,0xa3,RSVD,RSVD,0x00,0x00,0x00,0x00,
720 			 0x00,0x00,0x0e,0x00,MISC,MISC,MISC,MISC,MISC,MISC,
721 			 MISC,MISC,MISC,MISC,MISC,MISC,MISC,MISC,MISC,EOT}},
722 		{EOT}}},
723 	{0xc, "W83877TF", {
724 		{EOT}}},
725 	{0xd, "W83877ATF/ATG", {
726 		{EOT}}},
727 	{EOT}
728 };
729 
730 static const struct superio_registers hwm_table[] = {
731 	{0x828, "W83627THF/THG", {
732 		{NOLDN, NULL,
733 			{0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,
734 			 0x0a,0x0b,0x0c,0x0d,0x0e,0x0f,0x10,0x11,0x12,0x13,
735 			 0x14,0x15,0x16,0x17,0x18,0x19,0x1a,0x1b,0x1c,0x1d,
736 			 0x1e,0x1f,
737 			 0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,
738 			 0x2b,0x2c,0x2d,0x2e,0x2f,0x30,0x31,0x32,0x33,0x34,
739 			 0x35,0x36,0x37,0x38,0x39,0x3a,0x3b,0x3c,0x3d,0x3e,
740 			 0x3f,
741 			 0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,
742 			 0x4a,0x4b,0x4c,0x4d,0x4e,0x4f,EOT},
743 			{RSVD,0xff,RSVD,0xff,0x00,0x00,0x00,0x00,0x01,0x01,
744 			 0x01,0x01,0x3c,0x3c,0x0a,0x0a,RSVD,0xff,0x00,0x00,
745 			 0x00,0x01,0x01,0x3c,0x43,RSVD,0xff,0xff,RSVD,RSVD,
746 			 NANA,NANA,
747 			 NANA,NANA,NANA,NANA,NANA,RSVD,RSVD,NANA,NANA,NANA,
748 			 NANA,NANA,NANA,NANA,NANA,NANA,NANA,NANA,NANA,NANA,
749 			 RSVD,RSVD,RSVD,RSVD,NANA,NANA,NANA,NANA,NANA,RSVD,
750 			 RSVD,
751 			 0x03,0x00,0x00,0xfe,0xff,RSVD,RSVD,0x5f,NANA,0x03,
752 			 RSVD,0x44,0x18,0x15,0x80,0x5c,EOT}},
753 		{0x0, "Bank 0",
754 			{0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,
755 			 0x5d,0x5e,0x5f,EOT},
756 			{NANA,NANA,NANA,NANA,NANA,NANA,0x00,0x80,0x90,0x70,
757 			 0x00,RSVD,RSVD,EOT}},
758 		{0x1, "Bank 1",
759 			{0x50,0x51,0x52,0x53,0x54,0x55,0x56,EOT},
760 			{NANA,NANA,0x00,0x4b,0x00,0x50,0x00,EOT}},
761 		{0x2, "Bank 2",
762 			{0x50,0x51,0x52,0x53,0x54,0x55,0x56,EOT},
763 			{NANA,NANA,0x00,0x4b,0x00,0x50,0x00,EOT}},
764 		{0x4, "Bank 4",
765 			{0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x59,0x5a,
766 			 0x5b,EOT},
767 			{0x00,0xff,RSVD,0x00,0x00,0x00,0x00,0x00,0x00,
768 			 0x00,EOT}},
769 		{0x5, "Bank 5",
770 			{0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,EOT},
771 			{NANA,NANA,RSVD,RSVD,NANA,NANA,NANA,NANA,EOT}},
772 		{0x6, "Bank 6",
773 			{0x50,EOT},
774 			{RSVD,EOT}},
775 		{EOT}}},
776 	{0xa02, "W83627DHG", {
777 		{NOLDN, NULL,
778 			{0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,
779 			 0x0a,0x0b,0x0c,0x0d,0x0e,0x0f,0x10,0x11,0x12,0x13,
780 			 0x14,0x15,0x16,0x17,0x18,0x19,0x1a,0x1b,0x1c,0x1d,
781 			 0x1e,0x1f,EOT},
782 			{0x04,0xff,0x04,NANA,0x01,0x00,0x00,0x00,0x01,0x01,
783 			 0x01,0x01,0x3c,0x3c,0x0a,0x0a,0x04,0xff,0x00,0x00,
784 			 0x00,0x01,0x01,0x3c,0x43,RSVD,RSVD,RSVD,RSVD,RSVD,
785 			 RSVD,RSVD,EOT}},
786 		{NOLDN, NULL, /* Value RAM */
787 			{0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,
788 			 0x2a,0x2b,0x2c,0x2d,0x2e,0x2f,0x30,0x31,0x32,0x33,
789 			 0x34,0x35,0x36,0x37,0x38,0x39,0x3a,0x3b,0x3c,0x3d,
790 			 0x3e,0x3f,EOT},
791 			{NANA,NANA,NANA,NANA,NANA,NANA,NANA,NANA,NANA,NANA,
792 			 NANA,MISC,MISC,MISC,MISC,MISC,MISC,MISC,MISC,MISC,
793 			 MISC,MISC,MISC,MISC,MISC,MISC,MISC,MISC,MISC,MISC,
794 			 MISC,MISC,EOT}},
795 		{NOLDN, NULL,
796 			{0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,
797 			 0x4a,0x4b,0x4c,0x4d,0x4e,0x4f,EOT},
798 			{0x03,0x00,0x00,0xff,0xff,RSVD,0x07,0x55,0x2d,0x00,
799 			 0x00,0x44,0x10,0x95,0x80,0xa3,EOT}},
800 		{0x0, "Bank 0",
801 			{0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,
802 			 0x5a,0x5b,0x5c,0x5d,0x5e,0x5f,0x60,0x61,0x62,0x63,
803 			 0x64,0x65,0x66,0x67,0x68,0x69,0x6a,0x6b,0x6c,0x6d,
804 			 0x6e,EOT},
805 			{RSVD,RSVD,RSVD,RSVD,RSVD,RSVD,0x00,0x80,0xc1,0x70,
806 			 RSVD,RSVD,RSVD,0x04,0x04,RSVD,0x04,NANA,0x40,0x00,
807 			 0x01,0x01,0x3c,0xff,0x01,0xff,0x01,0xff,0xff,0xff,
808 			 0xff,EOT}},
809 		{0x1, "Bank 1",
810 			{0x50,0x51,0x52,0x53,0x54,0x55,0x56,EOT},
811 			{NANA,NANA,0x00,0x4b,0x00,0x50,0x00,EOT}},
812 		{0x2, "Bank 2",
813 			{0x50,0x51,0x52,0x53,0x54,0x55,0x56,EOT},
814 			{NANA,NANA,0x00,0x4b,0x00,0x50,0x00,EOT}},
815 		{0x4, "Bank 4",
816 			{0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,
817 			 0x5a,0x5b,0x5c,0x5d,0x5e,0x5f,EOT},
818 			{0x00,0x13,RSVD,0x00,0x00,0x00,0x00,RSVD,RSVD,0x00,
819 			 0x00,0x00,RSVD,RSVD,RSVD,RSVD,EOT}},
820 		{0x5, "Bank 5", /* Value RAM 2 */
821 			{0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,
822 			 0x5a,0x5b,0x5c,EOT},
823 			{NANA,NANA,RSVD,NANA,MISC,MISC,MISC,MISC,RSVD,RSVD,
824 			 RSVD,RSVD,MISC,EOT}},
825 		{0x6, "Bank 6",
826 			{0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,EOT},
827 			{RSVD,RSVD,RSVD,RSVD,RSVD,RSVD,RSVD,RSVD,EOT}},
828 		{EOT}}},
829 	{0x88, "W83627EHF/EF/EHG/EG", {
830 		{NOLDN, NULL,
831 			{0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,
832 			 0x0a,0x0b,0x0c,0x0d,0x0e,0x0f,0x10,0x11,0x12,0x13,
833 			 0x14,0x15,0x16,0x17,0x18,0x19,0x1a,0x1b,0x1c,0x1d,
834 			 0x1e,0x1f,EOT},
835 			{0x04,0xff,0x04,0xff,0x01,0x00,0x00,0x00,0x01,0x01,
836 			 0x01,0x01,0x3c,0x3c,0x0a,0x0a,0x04,0xff,0x00,0x00,
837 			 0x00,0x01,0x01,0x3c,0x43,RSVD,RSVD,RSVD,RSVD,RSVD,
838 			 RSVD,RSVD,EOT}},
839 		{NOLDN, NULL, /* Value RAM */
840 			{0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,
841 			 0x2a,0x2b,0x2c,0x2d,0x2e,0x2f,0x30,0x31,0x32,0x33,
842 			 0x34,0x35,0x36,0x37,0x38,0x39,0x3a,0x3b,0x3c,0x3d,
843 			 0x3e,0x3f,EOT},
844 			{NANA,NANA,NANA,NANA,NANA,NANA,NANA,NANA,NANA,NANA,
845 			 NANA,MISC,MISC,MISC,MISC,MISC,MISC,MISC,MISC,MISC,
846 			 MISC,MISC,MISC,MISC,MISC,MISC,MISC,MISC,MISC,MISC,
847 			 MISC,NANA,EOT}},
848 		{NOLDN, NULL,
849 			{0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,
850 			 0x4a,0x4b,0x4c,0x4d,0x4e,0x4f,EOT},
851 			{0x03,0x00,0x00,0xde,0xff,RSVD,0x07,0x55,0x2d,RSVD,
852 			 0x64,0x44,0x10,0x15,0x80,0x5c,EOT}},
853 		{0x0, "Bank 0",
854 			{0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,
855 			 0x5a,0x5b,0x5c,0x5d,0x5e,0x5f,0x60,0x61,0x62,0x63,
856 			 0x64,0x65,0x66,0x67,0x68,0x69,0x6a,EOT},
857 			{RSVD,RSVD,RSVD,RSVD,RSVD,RSVD,0x00,0x80,0xa1,0x70,
858 			 RSVD,RSVD,RSVD,0x00,RSVD,RSVD,0x04,0xff,0x40,0x00,
859 			 0x01,0x01,0x3c,0xff,0x01,0xff,0x01,EOT}},
860 		{0x1, "Bank 1",
861 			{0x50,0x51,0x52,0x53,0x54,0x55,0x56,EOT},
862 			{NANA,NANA,0x00,0x4b,0x00,0x50,0x00,EOT}},
863 		{0x2, "Bank 2",
864 			{0x50,0x51,0x52,0x53,0x54,0x55,0x56,EOT},
865 			{NANA,NANA,0x00,0x4b,0x00,0x50,0x00,EOT}},
866 		{0x4, "Bank 4",
867 			{0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,
868 			 0x5a,0x5b,0x5c,0x5d,EOT},
869 			{0x00,0x00,RSVD,0x00,0x00,0x00,0x00,RSVD,RSVD,0x00,
870 			 0x00,0x00,RSVD,RSVD,EOT}},
871 		{0x5, "Bank 5", /* Value RAM 2 */
872 			{0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,
873 			 0x5a,0x5b,0x5c,EOT},
874 			{NANA,NANA,RSVD,RSVD,MISC,MISC,MISC,MISC,MISC,MISC,
875 			 RSVD,RSVD,MISC,EOT}},
876 		{0x6, "Bank 6",
877 			{0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,EOT},
878 			{RSVD,RSVD,RSVD,RSVD,RSVD,RSVD,RSVD,RSVD,EOT}},
879 		{EOT}}},
880 	{0xb07, "W83627DHG-P/-PT", {
881 		{NOLDN, NULL,
882 			{0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,
883 			 0x0a,0x0b,0x0c,0x0d,0x0e,0x0f,0x10,0x11,0x12,0x13,
884 			 0x14,0x15,0x16,0x17,0x18,0x19,0x1a,0x1b,0x1c,0x1d,
885 			 0x1e,0x1f,EOT},
886 			{0x04,0xff,0x04,NANA,0x01,0x00,0x00,0x00,0x01,0x01,
887 			 0x01,0x01,0x3c,0x3c,0x0a,0x0a,0x04,0xff,0x00,0x00,
888 			 0x00,0x01,0x01,0x3c,0x43,RSVD,RSVD,RSVD,RSVD,RSVD,
889 			 RSVD,RSVD,EOT}},
890 		{NOLDN, NULL,
891 			{0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,
892 			 0x2a,0x2b,0x2c,0x2d,0x2e,0x2f,0x30,0x31,0x32,0x33,
893 			 0x34,0x35,0x36,0x37,0x38,0x39,0x3a,0x3b,0x3c,0x3d,
894 			 0x3e,0x3f,EOT},
895 			{NANA,NANA,NANA,NANA,NANA,NANA,NANA,NANA,NANA,NANA,
896 			 NANA,NANA,NANA,NANA,NANA,NANA,NANA,NANA,NANA,NANA,
897 			 NANA,NANA,NANA,NANA,NANA,NANA,NANA,NANA,NANA,NANA,
898 			 NANA,NANA,EOT}},
899 		{NOLDN, NULL,
900 			{0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,
901 			 0x4a,0x4b,0x4c,0x4d,0x4e,0x4f,EOT},
902 			{0x03,0x00,0x00,0xff,0xff,0x00,0x3f,0x55,0x2d,0x00,
903 			 0x00,0x44,0x10,0x95,0x80,0xa3,EOT}},
904 		{0x0, "Bank 0",
905 			{0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,
906 			 0x5a,0x5b,0x5c,0x5d,0x5e,0x5f,0x60,0x61,0x62,0x63,
907 			 0x64,0x65,0x66,0x67,0x68,0x69,0x6a,0x6b,0x6c,0x6d,
908 			 0x6e,0x6f,EOT},
909 			{RSVD,RSVD,RSVD,RSVD,RSVD,RSVD,0x00,0x80,0xc1,0x70,
910 			 RSVD,RSVD,RSVD,0x04,0x04,RSVD,0x04,NANA,0x40,0x00,
911 			 0x01,0x01,0x3c,0xff,0x01,0xff,0x01,0xff,0xff,0xff,
912 			 0xff,0x00,EOT}},
913 		{0x0, "Bank 0 [...]",
914 			{0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,
915 			 0x7a,0x7b,0x7c,0x7d,EOT},
916 			{0x00,0x00,0x00,0x00,0x00,0x0e,0x00,0x00,0x00,0x00,
917 			 0x00,0x00,0x00,NANA,EOT}},
918 		{0x1, "Bank 1",
919 			{0x50,0x51,0x52,0x53,0x54,0x55,0x56,     0x58,0x59,
920 			 0x5a,0x5b,0x5c,0x5d,0x5e,     EOT},
921 			{NANA,NANA,0x00,0x4b,0x00,0x50,0x00,     0x00,0x00,
922 			 0x00,0x00,0x00,0x00,0x0e,     EOT}},
923 		{0x2, "Bank 2",
924 			{0x50,0x51,0x52,0x53,0x54,0x55,0x56,     EOT},
925 			{NANA,NANA,0x00,0x4b,0x00,0x50,0x00,     EOT}},
926 		{0x4, "Bank 4",
927 			{0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,
928 			 0x5a,0x5b,0x5c,0x5d,0x5e,0x5f,EOT},
929 			{0x00,0x13,RSVD,0x00,0x00,0x00,0x00,RSVD,RSVD,0x00,
930 			 0x00,0x00,RSVD,RSVD,RSVD,RSVD,EOT}},
931 		{0x5, "Bank 5",
932 			{0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,
933 			 0x5a,0x5b,0x5c,EOT},
934 			{NANA,NANA,RSVD,NANA,NANA,NANA,NANA,NANA,RSVD,RSVD,
935 			 RSVD,RSVD,NANA,EOT}},
936 		{0x6, "Bank 6",
937 			{0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,
938 			 0x5a,0x5b,0x5c,0x5d,0x5e,0x5f,EOT},
939 			{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
940 			 0x0d,0xff,0xff,0xff,0xff,0xff,EOT}},
941 		{EOT}}},
942 	{EOT}
943 };
944 
enter_conf_mode_winbond_88(uint16_t port)945 static void enter_conf_mode_winbond_88(uint16_t port)
946 {
947 	OUTB(0x88, port);
948 }
949 
enter_conf_mode_winbond_89(uint16_t port)950 static void enter_conf_mode_winbond_89(uint16_t port)
951 {
952 	OUTB(0x89, port);
953 }
954 
enter_conf_mode_winbond_86(uint16_t port)955 static void enter_conf_mode_winbond_86(uint16_t port)
956 {
957 	OUTB(0x86, port);
958 	OUTB(0x86, port);
959 }
960 
961 static int chip_found_at_port;
962 
probe_idregs_winbond_helper(const char * init,uint16_t port)963 static void probe_idregs_winbond_helper(const char *init, uint16_t port)
964 {
965 	uint16_t id, hwmport;
966 	uint8_t devid, rev, olddevid;
967 
968 	probing_for("Winbond", init, port);
969 
970 	devid = regval(port, DEVICE_ID_REG);
971 	rev = regval(port, DEVICE_REV_REG);
972 	olddevid = regval(port, DEVICE_ID_REG_OLD) & 0x0f;
973 
974 	if (devid == 0x52 && (rev & 0xf0) != 0xf0)
975 		id = devid;				 /* ID only */
976 	else if (devid == 0x68 || devid == 0x88)
977 		id = devid;				 /* ID only */
978 	else if ((devid == 0x97) && ((rev & 0xf0) == 0x70))
979 		id = (devid << 8) | rev;		 /* ID and rev */
980 	else
981 		id = (devid << 4) | ((rev & 0xf0) >> 4); /* ID and rev[7..4] */
982 
983 	if (olddevid >= 0x0a && olddevid <= 0x0d)
984 		id = olddevid & 0x0f;			 /* ID[3..0] */
985 
986 	if (superio_unknown(reg_table, id)) {
987 		if (verbose)
988 			printf(NOTFOUND "id/oldid=0x%02x/0x%02x, rev=0x%02x\n",
989 			       devid, olddevid, rev);
990 		return;
991 	}
992 
993 	if (olddevid >= 0x0a && olddevid <= 0x0d)
994 		printf("Found Winbond %s (id=0x%02x) at 0x%x\n",
995 		       get_superio_name(reg_table, id), olddevid, port);
996 	else
997 		printf("Found Winbond %s (id=0x%02x, rev=0x%02x) at 0x%x\n",
998 		       get_superio_name(reg_table, id), devid, rev, port);
999 	chip_found = 1;
1000 	chip_found_at_port = 1;
1001 
1002 	dump_superio("Winbond", reg_table, port, id, LDN_SEL);
1003 
1004 	if (extra_dump) {
1005 		regwrite(port, LDN_SEL, 0x0b); /* Select LDN 0xb (HWM). */
1006 
1007 		if ((regval(port, 0x30) & (1 << 0)) != (1 << 0)) {
1008 			printf("Hardware Monitor disabled or does not exist.\n");
1009 			return;
1010 		}
1011 
1012 		/* Get HWM base address (stored in LDN 0xb, index 0x60/0x61). */
1013 		hwmport = regval(port, 0x60) << 8;
1014 		hwmport |= regval(port, 0x61);
1015 
1016 		/* HWM address register = HWM base address + 5. */
1017 		hwmport += 5;
1018 
1019 		printf("Hardware monitor (0x%04x)\n", hwmport);
1020 		dump_superio("Winbond-HWM", hwm_table, hwmport, id,
1021 			     WINBOND_HWM_SEL);
1022 	}
1023 }
1024 
probe_idregs_winbond(uint16_t port)1025 void probe_idregs_winbond(uint16_t port)
1026 {
1027 	chip_found_at_port = 0;
1028 
1029 	enter_conf_mode_winbond_88(port);
1030 	probe_idregs_winbond_helper("(init=0x88) ", port);
1031 	exit_conf_mode_winbond_fintek_ite_8787(port);
1032 	if (chip_found_at_port)
1033 		return;
1034 
1035 	enter_conf_mode_winbond_89(port);
1036 	probe_idregs_winbond_helper("(init=0x89) ", port);
1037 	exit_conf_mode_winbond_fintek_ite_8787(port);
1038 	if (chip_found_at_port)
1039 		return;
1040 
1041 	enter_conf_mode_winbond_86(port);
1042 	probe_idregs_winbond_helper("(init=0x86,0x86) ", port);
1043 	exit_conf_mode_winbond_fintek_ite_8787(port);
1044 	if (chip_found_at_port)
1045 		return;
1046 
1047 	enter_conf_mode_winbond_fintek_ite_8787(port);
1048 	probe_idregs_winbond_helper("(init=0x87,0x87) ", port);
1049 	exit_conf_mode_winbond_fintek_ite_8787(port);
1050 	if (chip_found_at_port)
1051 		return;
1052 }
1053 
print_winbond_chips(void)1054 void print_winbond_chips(void)
1055 {
1056 	print_vendor_chips("Winbond", reg_table);
1057 	print_vendor_chips("Winbond-HWM", hwm_table);
1058 }
1059