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