blob: 4376494fee03bed25237c430335ac05823556807 [file] [log] [blame]
David Hendrickse1822d92010-07-22 22:56:44 +00001/*
2 * This file is part of the superiotool project.
3 *
4 * Copyright (C) 2010 Google Inc.
5 * Written by David Hendricks <dhendrix@google.com> for Nuvoton Technology Corp.
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
Patrick Georgib890a122015-03-26 15:17:45 +010019 * Foundation, Inc.
David Hendrickse1822d92010-07-22 22:56:44 +000020 */
21
22#include "superiotool.h"
23
24#define DEVICE_ID_REG 0x20 /* Super I/O ID (SID) / family */
25#define DEVICE_REV_REG 0x27 /* Super I/O revision ID (SRID) */
26
27static const struct superio_registers reg_table[] = {
28 {0xfc, "WPCE775x / NPCE781x", {
29 {NOLDN, NULL,
30 {0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,
31 0x29,0x2a,0x2b,0x2c,0x2d,0x2e,0x2f,EOT},
Stefan Reinauer5a4ae822011-04-22 23:10:35 +000032 {0xfc,0x11,RSVD,RSVD,RSVD,0x00,0x00,MISC,0x00,
David Hendrickse1822d92010-07-22 22:56:44 +000033 0x04,RSVD,RSVD,RSVD,0x00,RSVD,RSVD,EOT}},
34 {0x03, "CIR Port (CIRP)", /* where supported */
35 {0x30,0x60,0x61,0x70,0x71,0x74,0x75,0xf0,EOT},
36 {0x00,0x03,0xf8,0x04,0x03,0x04,0x04,0x02,EOT}},
37 {0x04, "Mobile System Wake-Up Control Config (MSWC)",
38 {0x30,0x60,0x61,0x70,0x71,0x74,0x75,EOT},
39 {0x00,0x00,0x00,0x00,0x03,0x04,0x04,EOT}},
40 {0x05, "Mouse config (KBC)",
41 {0x30,0x70,0x71,0x74,0x75,EOT},
42 {0x00,0x0c,0x03,0x04,0x04,EOT}},
43 {0x06, "Keyboard config (KBC)",
44 {0x30,0x60,0x61,0x62,0x63,0x70,0x71,0x74,0x75,EOT},
45 {0x00,0x00,0x60,0x00,0x64,0x01,0x03,0x04,0x04,EOT}},
46 {0x0f, "Shared memory (SHM)",
47 {0x30,0x60,0x61,0x70,0x71,0x74,0x75,0xf0,0xf1,0xf2,
48 0xf3,0xf4,0xf5,0xf6,0xf7,0xf8,0xf9,0xfa,0xfb,EOT},
49 {0x00,0x00,0x00,0x00,0x00,0x04,0x04,MISC,0x07,RSVD,
50 RSVD,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,EOT}},
51 {0x11, "Power management I/F Channel 1 (PM1)",
52 {0x30,0x60,0x61,0x62,0x63,0x70,0x71,0x74,0x75,EOT},
53 {0x00,0x00,0x62,0x00,0x66,0x01,0x03,0x04,0x04,EOT}},
54 {0x12, "Power management I/F Channel 2 (PM2)",
55 {0x30,0x60,0x61,0x62,0x63,0x70,0x71,0x74,0x75,EOT},
56 {0x00,0x00,0x68,0x00,0x6c,0x01,0x03,0x04,0x04,EOT}},
57 {0x15, "Enhanced Wake On CIR (EWOC)",
58 {0x30,0x60,0x61,0x62,0x63,0x70,0x71,0x74,0x75,EOT},
59 {0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x04,0x04,EOT}},
60 {0x17, "Power Management I/F Channel 3 (PM3)",
61 {0x30,0x60,0x61,0x62,0x63,0x70,0x71,0x74,0x75,EOT},
62 {0x00,0x00,0x6a,0x00,0x6e,0x01,0x03,0x04,0x04,EOT}},
63 {0x1a, "Serial Port with Fast Infrared Port (FIR)",
64 {0x30,0x60,0x61,0x70,0x71,0x74,0x75,0xf0,EOT},
65 {0x00,0x02,0xf8,0x03,0x03,0x04,0x04,0x02,EOT}},
66 {EOT}}},
Zheng Bao6d816462010-12-31 01:38:45 +000067 {0x1a, "WPCM450", {
68 {EOT}}},
Guenter Roeck975ffc22012-06-29 12:22:51 -070069 {0xb472, "NCT6775F (A)", {
70 {NOLDN, NULL,
71 {0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,
72 0x29,0x2a,0x2b,0x2c,0x2d,0x2e,0x2f,EOT},
73 {0xb4,0x72,0xff,0x78,0x40,0x00,0x00,0x7d,0x00,
74 0x00,0x58,0x77,0xfc,0x04,0x00,MISC,EOT}},
75 {0x00, "FDC",
76 {0x30,0x60,0x61,0x70,0x74,0xf0,0xf1,0xf2,0xf4,
77 0xf5,EOT},
78 {0x03,0x03,0xf0,0x06,0x02,0x8e,0x00,0xff,0x00,
79 0x00,EOT}},
80 {0x01, "Parallel Port",
81 {0x30,0x60,0x61,0x70,0x74,0xf0,EOT},
82 {0x01,0x03,0x78,0x07,0x04,0x3f,EOT}},
83 {0x02, "UART A",
84 {0x30,0x60,0x61,0x70,0xf0,EOT},
85 {0x01,0x03,0xf8,0x04,0x00,EOT}},
86 {0x03, "UART B, IR",
87 {0x30,0x60,0x61,0x70,0xf0,0xf1,EOT},
88 {0x01,0x02,0xf8,0x03,0x00,0x00,EOT}},
89 {0x05, "Keyboard Controller",
90 {0x30,0x60,0x61,0x62,0x63,0x70,0x72,0xf0,EOT},
91 {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x83,EOT}},
92 {0x06, "CIR",
93 {0x30,0x60,0x61,0x70,EOT},
94 {0x00,0x00,0x00,0x00,EOT}},
95 {0x07, "GPIO6, GPIO7, GPIO8, GPIO9",
96 {0x30,0xe0,0xe1,0xe2,0xe3,0xe4,0xe5,0xe6,0xe7,
97 0xe8,0xe9,0xea,0xeb,0xec,0xed,0xee,0xf4,0xf5,
98 0xf6,0xf7,0xf8,EOT},
99 {0x18,0xff,0x00,0x00,0x00,0xef,0x00,0x00,0x00,
100 0xff,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0x00,
101 0x00,0x00,0x00,EOT}},
102 {0x08, "WDT1, GPIO0, GPIO1",
103 {0x30,0xe0,0xe1,0xe2,0xe3,0xe4,0xf0,
104 0xf1,0xf2,0xf3,0xf4,0xf5,0xf6,0xf7,EOT},
105 {0x00,0xff,0x00,0x00,0x00,0x00,0xff,
106 0x00,0x00,0x00,0x00,0x00,0x00,0x00,EOT}},
107 {0x09, "GPIO2, GPIO3, GPIO4, GPIO5",
108 {0x30,0xe0,0xe1,0xe2,0xe3,0xe4,0xe5,0xe6,0xe7,
109 0xe8,0xe9,0xea,0xeb,0xee,0xf0,0xf1,0xf2,0xf4,
110 0xf5,0xf6,0xf7,0xfe,EOT},
111 {0x05,0xff,0x00,0x00,0x00,0xff,0x00,0x00,0x00,
112 0x00,0x00,0x00,0x00,0x00,0xff,0x00,0x00,0xff,
113 0x00,0x00,0x00,0x00,EOT}},
114 {0x0a, "ACPI",
115 {0x30,0xe0,0xe1,0xe2,0xe3,0xe4,0xe5,0xe6,0xe7,
116 0xe8,0xe9,0xea,0xeb,0xed,0xf2,0xf3,0xf4,0xf6,
117 0xf7,0xfe,EOT},
118 {0x00,0x01,0x00,0x00,0x00,0x00,0x02,0x1c,0x00,
119 0x00,0x00,0x00,0x00,0x00,0x7c,0x00,0x00,0x00,
120 0x20,0x00,EOT}},
121 {0x0b, "Hardware Monitor, Front Panel LED",
122 {0x30,0x60,0x61,0x62,0x63,0x70,0xf0,0xf1,0xf2,
123 0xf3,0xf4,0xf5,0xf6,0xf7,0xf8,0xf9,0xfa,0xfb,
124 0xfc,0xfd,0xfe,
125 EOT},
126 {0x00,0x00,0x00,0x00,0x00,0x00,0xc1,0x00,0x00,
127 0x00,0x00,0x10,0x00,0x87,0x47,0x00,0x00,0x00,
128 0x00,0x00,0x00,
129 EOT}},
130 {0x0c, "PECI, SST",
131 {0xe0,0xe1,0xe2,0xe3,0xe4,0xe5,0xe6,0xe7,0xe9,
132 0xee,0xef,0xf1,0xf2,0xf3,0xfa,EOT},
133 {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x0f,
134 0x47,0x5b,0x40,0x50,0x10,0x00,EOT}},
135 {0x0d, "VID, VIDDAC, BUSSEL",
136 {0xe0,0xe1,0xe2,0xe3,0xe4,0xe5,0xe6,0xe7,0xeb,
137 0xec,0xed,0xee,0xef,0xf3,0xf4,0xf5,0xf6,0xf7,
138 0xf8,0xf9,EOT},
139 {0x00,0x00,0x00,0x00,0x07,0x00,0x00,0x00,0x14,
140 0x01,0x00,0x88,0x00,0x00,0x00,0x00,0x07,0x00,
141 0x00,0x00,EOT}},
142 {0x0e, "CIR WAKE-UP",
143 {0x30,0x60,0x61,0x70,EOT},
144 {0x00,0x00,0x00,0x00,EOT}},
145 {0x0f, "GPIO Push-Pull or Open-drain",
146 {0xe0,0xe1,0xe2,0xe3,0xe4,0xe5,0xe6,0xe7,0xe8,
147 0xe9,0xf0,0xf2,0xf3,0xf4,0xf8,0xfe,EOT},
148 {0xff,0xff,0xf7,0xff,0xfb,0xcb,0xff,0xff,0xff,
149 0xff,0x00,0x00,0x00,0x00,0x70,0xff,EOT}},
150 {EOT}}},
Felix Held3ad6ff12015-05-31 20:37:04 +0200151 {0xb473, "NCT6775F (B) / NCT5572D (B) (not all LDNs supported)", {
Guenter Roeck975ffc22012-06-29 12:22:51 -0700152 {NOLDN, NULL,
153 {0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,
154 0x29,0x2a,0x2b,0x2c,0x2d,0x2e,0x2f,EOT},
155 {0xb4,0x73,0xff,0x78,0x40,0x00,0x00,0x7d,0x00,
156 0x00,0x58,0x77,0xfc,0x04,0x00,MISC,EOT}},
157 {0x00, "FDC",
158 {0x30,0x60,0x61,0x70,0x74,0xf0,0xf1,0xf2,0xf4,
159 0xf5,EOT},
160 {0x03,0x03,0xf0,0x06,0x02,0x8e,0x00,0xff,0x00,
161 0x00,EOT}},
162 {0x01, "Parallel Port",
163 {0x30,0x60,0x61,0x70,0x74,0xf0,EOT},
164 {0x01,0x03,0x78,0x07,0x04,0x3f,EOT}},
165 {0x02, "UART A",
166 {0x30,0x60,0x61,0x70,0xf0,EOT},
167 {0x01,0x03,0xf8,0x04,0x00,EOT}},
168 {0x03, "UART B, IR",
169 {0x30,0x60,0x61,0x70,0xf0,0xf1,EOT},
170 {0x01,0x02,0xf8,0x03,0x00,0x00,EOT}},
171 {0x05, "Keyboard Controller",
172 {0x30,0x60,0x61,0x62,0x63,0x70,0x72,0xf0,EOT},
173 {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x83,EOT}},
174 {0x06, "CIR",
175 {0x30,0x60,0x61,0x70,EOT},
176 {0x00,0x00,0x00,0x00,EOT}},
177 {0x07, "GPIO6, GPIO7, GPIO8, GPIO9",
178 {0x30,0xe0,0xe1,0xe2,0xe3,0xe4,0xe5,0xe6,0xe7,
179 0xe8,0xe9,0xea,0xeb,0xec,0xed,0xee,0xf4,0xf5,
180 0xf6,0xf7,0xf8,EOT},
181 {0x18,0xff,0x00,0x00,0x00,0xef,0x00,0x00,0x00,
182 0xff,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0x00,
183 0x00,0x00,0x00,EOT}},
184 {0x08, "WDT1, GPIO0, GPIO1",
185 {0x30,0xe0,0xe1,0xe2,0xe3,0xe4,0xf0,
186 0xf1,0xf2,0xf3,0xf4,0xf5,0xf6,0xf7,EOT},
187 {0x00,0xff,0x00,0x00,0x00,0x00,0xff,
188 0x00,0x00,0x00,0x00,0x00,0x00,0x00,EOT}},
189 {0x09, "GPIO2, GPIO3, GPIO4, GPIO5",
190 {0x30,0xe0,0xe1,0xe2,0xe3,0xe4,0xe5,0xe6,0xe7,
191 0xe8,0xe9,0xea,0xeb,0xee,0xf0,0xf1,0xf2,0xf4,
192 0xf5,0xf6,0xf7,0xfe,EOT},
193 {0x05,0xff,0x00,0x00,0x00,0xff,0x00,0x00,0x00,
194 0x00,0x00,0x00,0x00,0x00,0xff,0x00,0x00,0xff,
195 0x00,0x00,0x00,0x00,EOT}},
196 {0x0a, "ACPI",
197 {0x30,0xe0,0xe1,0xe2,0xe3,0xe4,0xe5,0xe6,0xe7,
198 0xe8,0xe9,0xea,0xeb,0xed,0xf2,0xf3,0xf4,0xf6,
199 0xf7,0xfe,EOT},
200 {0x00,0x01,0x00,0x00,0x00,0x00,0x02,0x1c,0x00,
201 0x00,0x00,0x00,0x00,0x00,0x7c,0x00,0x00,0x00,
202 0x20,0x00,EOT}},
203 {0x0b, "Hardware Monitor, Front Panel LED",
204 {0x30,0x60,0x61,0x62,0x63,0x70,0xf0,0xf1,0xf2,
205 0xf3,0xf4,0xf5,0xf6,0xf7,0xf8,0xf9,0xfa,0xfb,
206 0xfc,0xfd,0xfe,
207 EOT},
208 {0x00,0x00,0x00,0x00,0x00,0x00,0xc1,0x00,0x00,
209 0x00,0x00,0x10,0x00,0x87,0x47,0x00,0x00,0x00,
210 0x00,0x00,0x00,
211 EOT}},
212 {0x0c, "PECI, SST",
213 {0xe0,0xe1,0xe2,0xe3,0xe4,0xe5,0xe6,0xe7,0xe9,
214 0xee,0xef,0xf1,0xf2,0xf3,0xfa,EOT},
215 {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x0f,
216 0x47,0x5b,0x40,0x50,0x10,0x00,EOT}},
217 {0x0d, "VID, VIDDAC, BUSSEL",
218 {0xe0,0xe1,0xe2,0xe3,0xe4,0xe5,0xe6,0xe7,0xeb,
219 0xec,0xed,0xee,0xef,0xf3,0xf4,0xf5,0xf6,0xf7,
220 0xf8,0xf9,EOT},
221 {0x00,0x00,0x00,0x00,0x07,0x00,0x00,0x00,0x14,
222 0x01,0x00,0x88,0x00,0x00,0x00,0x00,0x07,0x00,
223 0x00,0x00,EOT}},
224 {0x0e, "CIR WAKE-UP",
225 {0x30,0x60,0x61,0x70,EOT},
226 {0x00,0x00,0x00,0x00,EOT}},
227 {0x0f, "GPIO Push-Pull or Open-drain",
228 {0xe0,0xe1,0xe2,0xe3,0xe4,0xe5,0xe6,0xe7,0xe8,
229 0xe9,0xf0,0xf2,0xf3,0xf4,0xf8,0xfe,EOT},
230 {0xff,0xff,0xf7,0xff,0xfb,0xcb,0xff,0xff,0xff,
231 0xff,0x00,0x00,0x00,0x00,0x70,0xff,EOT}},
232 {EOT}}},
Stefan Reinauer3187d022011-04-22 23:12:40 +0000233 {0xc332, "NCT6776F (B)", {
234 {NOLDN, NULL,
235 {0x10,0x11,0x13,0x14,0x16,0x17,0x18,0x19,0x1a,
236 0x1b,0x1c,0x1d,0x1e,0x1f,0x20,0x21,0x22,0x23,
237 0x24,0x25,0x26,0x27,0x28,0x2a,0x2b,0x2c,0x2d,
238 0x2e,0x2f,EOT},
239 {0xff,0xff,0x00,0x00,0xff,0xff,0xff,0xff,0xf0,
240 0x78,0x00,0x00,0xff,0xff,0xc3,0x32,0xff,0x00,
241 0x64,0x00,MISC,0x00,0x00,0xc0,0x00,0x81,0x00,
242 0x00,MISC,EOT}},
243 {0x00, "FDC",
244 {0x30,0x60,0x61,0x70,0x74,0xf0,0xf1,0xf2,0xf4,
245 0xf5,EOT},
246 {0x01,0x03,0xf0,0x06,0x02,0x0e,0x00,0xff,0x00,
247 0x00,EOT}},
248 {0x01, "Parallel Port",
249 {0x30,0x60,0x61,0x70,0x74,0xf0,EOT},
250 {0x01,0x03,0x78,0x07,0x04,0x3f,EOT}},
251 {0x02, "UART A",
252 {0x30,0x60,0x61,0x70,0xf0,0xf2,EOT},
253 {0x01,0x03,0xf8,0x04,0x00,0x00,EOT}},
254 {0x03, "UART B, IR",
255 {0x30,0x60,0x61,0x70,0xf0,0xf1,0xf2,EOT},
256 {0x01,0x02,0xf8,0x03,0x00,0x00,0x00,EOT}},
257 {0x05, "Keyboard Controller",
258 {0x30,0x60,0x61,0x62,0x63,0x70,0x72,0xf0,EOT},
259 {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x83,EOT}},
260 {0x06, "CIR",
261 {0x30,0x60,0x61,0x70,0xf0,0xf1,0xf2,0xf3,EOT},
262 {0x00,0x00,0x00,0x00,0x08,0x09,0x32,0x00,EOT}},
263 {0x07, "GPIO6, GPIO7, GPIO8, GPIO9",
264 {0x30,0xe0,0xe1,0xe2,0xe3,0xe4,0xe5,0xe6,0xe7,
265 0xe8,0xe9,0xea,0xeb,0xec,0xed,0xee,0xf4,0xf5,
266 0xf6,0xf7,0xf8,EOT},
267 {0x03,0xff,0x00,0x00,0x00,0xef,0x00,0x00,0x00,
268 0xff,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0x00,
269 0x00,0x00,0x00,EOT}},
270 {0x08, "WDT1, GPIO0, GPIO1, GPIOA",
271 {0x30,0x60,0x61,0xe0,0xe1,0xe2,0xe3,0xe4,0xf0,
272 0xf1,0xf2,0xf3,0xf4,0xf5,0xf6,0xf7,EOT},
273 {0x02,0x00,0x00,0xff,0x00,0x00,0x00,0xef,0xff,
274 0x00,0x00,0x00,0x00,0x00,0x00,0x00,EOT}},
275 {0x09, "GPIO2, GPIO3, GPIO4, GPIO5",
276 {0x30,0xe0,0xe1,0xe2,0xe3,0xe4,0xe5,0xe6,0xe7,
277 0xe8,0xe9,0xea,0xeb,0xee,0xf0,0xf1,0xf2,0xf4,
278 0xf5,0xf6,0xf7,0xfe,EOT},
279 {0x04,0xdf,0x00,0x00,0x00,0xff,0x00,0x00,0x00,
280 0x00,0x00,0x00,0x00,0x00,0xff,0x00,0x00,0xff,
281 0x00,0x00,0x00,0x00,EOT}},
282 {0x0a, "ACPI",
283 {0xe0,0xe1,0xe2,0xe3,0xe4,0xe5,0xe6,0xe7,0xe9,
284 0xee,0xf0,0xf2,0xf3,0xf4,0xf6,0xf7,0xfe,EOT},
285 {0x01,0x00,0x00,0x00,0x00,0x02,0x1c,0x00,0x00,
286 0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x00,EOT}},
287 {0x0b, "Hardware Monitor, Front Panel LED",
288 {0x30,0x60,0x61,0x62,0x63,0x70,0xe0,0xe1,0xe2,
289 0xf0,0xf1,0xf2,0xf5,0xf6,0xf7,0xf8,0xf9,0xfa,
290 EOT},
291 {0x00,0x00,0x00,0x00,0x00,0x00,0x7f,0x7f,0xff,
292 0x00,0x00,0x00,0x10,0x00,0x87,0x47,0x00,0x00,
293 EOT}},
294 {0x0d, "VID",
295 {0xe0,0xe1,0xe2,0xe3,0xe4,0xe5,0xe6,0xe9,0xee,
296 0xef,0xf0,0xf4,0xf5,EOT},
297 {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x88,
298 0x00,0x00,0x00,0x00,EOT}},
299 {0x0e, "CIR WAKE-UP",
300 {0x30,0x60,0x61,0x70,EOT},
301 {0x00,0x00,0x00,0x00,EOT}},
302 {0x0f, "GPIO Push-Pull or Open-drain",
303 {0xe0,0xe1,0xe2,0xe3,0xe4,0xe5,0xe6,0xe7,0xe8,
304 0xe9,0xf0,0xf1,0xf2,EOT},
305 {0xff,0xdf,0xff,0xfe,0xf6,0xff,0xff,0xd3,0xff,
306 0x9f,0x00,0x00,0x00,EOT}},
307 {0x14, "SVID",
308 {0xe0,0xe1,0xe3,0xe4,EOT},
309 {0x00,0x80,0x00,0x00,EOT}},
310 {0x16, "Deep Sleep",
311 {0x30,0xe0,0xe1,0xe2,EOT},
312 {0x20,0x20,0x04,0x05,EOT}},
313 {0x17, "GPIOA",
314 {0xe0,0xe1,0xe2,0xe3,0xe4,0xe5,EOT},
315 {0x01,0x00,0x00,0x00,0x01,0x00,EOT}},
316 {EOT}}},
Felix Held5eabe252014-12-16 14:47:51 +0100317 {0xc333, "NCT6776F/D (C)", {
Stefan Reinauer3187d022011-04-22 23:12:40 +0000318 {NOLDN, NULL,
319 {0x10,0x11,0x13,0x14,0x16,0x17,0x18,0x19,0x1a,
320 0x1b,0x1c,0x1d,0x1e,0x1f,0x20,0x21,0x22,0x23,
321 0x24,0x25,0x26,0x27,0x28,0x2a,0x2b,0x2c,0x2d,
322 0x2e,0x2f,EOT},
323 {0xff,0xff,0x00,0x00,0xff,0xff,0xff,0xff,0xf0,
324 0x78,0x00,0x00,0xff,0xff,0xc3,0x33,0xff,0x00,
325 0x64,0x00,MISC,0x00,0x00,0xc0,0x00,0x81,0x00,
326 0x00,MISC,EOT}},
327 {0x00, "FDC",
328 {0x30,0x60,0x61,0x70,0x74,0xf0,0xf1,0xf2,0xf4,
329 0xf5,EOT},
330 {0x01,0x03,0xf0,0x06,0x02,0x0e,0x00,0xff,0x00,
331 0x00,EOT}},
332 {0x01, "Parallel Port",
333 {0x30,0x60,0x61,0x70,0x74,0xf0,EOT},
334 {0x01,0x03,0x78,0x07,0x04,0x3f,EOT}},
335 {0x02, "UART A",
336 {0x30,0x60,0x61,0x70,0xf0,0xf2,EOT},
337 {0x01,0x03,0xf8,0x04,0x00,0x00,EOT}},
338 {0x03, "UART B, IR",
339 {0x30,0x60,0x61,0x70,0xf0,0xf1,0xf2,EOT},
340 {0x01,0x02,0xf8,0x03,0x00,0x00,0x00,EOT}},
341 {0x05, "Keyboard Controller",
342 {0x30,0x60,0x61,0x62,0x63,0x70,0x72,0xf0,EOT},
343 {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x83,EOT}},
344 {0x06, "CIR",
345 {0x30,0x60,0x61,0x70,0xf0,0xf1,0xf2,0xf3,EOT},
346 {0x00,0x00,0x00,0x00,0x08,0x09,0x32,0x00,EOT}},
347 {0x07, "GPIO6, GPIO7, GPIO8, GPIO9",
348 {0x30,0xe0,0xe1,0xe2,0xe3,0xe4,0xe5,0xe6,0xe7,
349 0xe8,0xe9,0xea,0xeb,0xec,0xed,0xee,0xf4,0xf5,
350 0xf6,0xf7,0xf8,EOT},
351 {0x03,0xff,0x00,0x00,0x00,0xef,0x00,0x00,0x00,
352 0xff,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0x00,
353 0x00,0x00,0x00,EOT}},
354 {0x08, "WDT1, GPIO0, GPIO1, GPIOA",
355 {0x30,0x60,0x61,0xe0,0xe1,0xe2,0xe3,0xe4,0xf0,
356 0xf1,0xf2,0xf3,0xf4,0xf5,0xf6,0xf7,EOT},
Felix Held4a699d12014-12-16 14:43:36 +0100357 {0x02,0x00,0x00,0xff,0x00,0x00,0x00,0x00,0xff,
Stefan Reinauer3187d022011-04-22 23:12:40 +0000358 0x00,0x00,0x00,0x00,0x00,0x00,0x00,EOT}},
359 {0x09, "GPIO2, GPIO3, GPIO4, GPIO5",
360 {0x30,0xe0,0xe1,0xe2,0xe3,0xe4,0xe5,0xe6,0xe7,
361 0xe8,0xe9,0xea,0xeb,0xee,0xf0,0xf1,0xf2,0xf4,
362 0xf5,0xf6,0xf7,0xfe,EOT},
363 {0x04,0xdf,0x00,0x00,0x00,0xff,0x00,0x00,0x00,
364 0x00,0x00,0x00,0x00,0x00,0xff,0x00,0x00,0xff,
365 0x00,0x00,0x00,0x00,EOT}},
366 {0x0a, "ACPI",
367 {0xe0,0xe1,0xe2,0xe3,0xe4,0xe5,0xe6,0xe7,0xe9,
368 0xee,0xf0,0xf2,0xf3,0xf4,0xf6,0xf7,0xfe,EOT},
369 {0x01,0x00,0x00,0x00,0x00,0x02,0x1c,0x00,0x00,
Felix Held4a699d12014-12-16 14:43:36 +0100370 0x00,0x00,0x5c,0x00,0x00,0x00,0xc0,0x00,EOT}},
Stefan Reinauer3187d022011-04-22 23:12:40 +0000371 {0x0b, "Hardware Monitor, Front Panel LED",
372 {0x30,0x60,0x61,0x62,0x63,0x70,0xe0,0xe1,0xe2,
373 0xf0,0xf1,0xf2,0xf5,0xf6,0xf7,0xf8,0xf9,0xfa,
374 EOT},
375 {0x00,0x00,0x00,0x00,0x00,0x00,0x7f,0x7f,0xff,
376 0x00,0x00,0x00,0x10,0x00,0x87,0x47,0x00,0x00,
377 EOT}},
378 {0x0d, "VID",
379 {0xe0,0xe1,0xe2,0xe3,0xe4,0xe5,0xe6,0xe9,0xee,
380 0xef,0xf0,0xf4,0xf5,EOT},
381 {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x88,
382 0x00,0x00,0x00,0x00,EOT}},
383 {0x0e, "CIR WAKE-UP",
384 {0x30,0x60,0x61,0x70,EOT},
385 {0x00,0x00,0x00,0x00,EOT}},
386 {0x0f, "GPIO Push-Pull or Open-drain",
387 {0xe0,0xe1,0xe2,0xe3,0xe4,0xe5,0xe6,0xe7,0xe8,
388 0xe9,0xf0,0xf1,0xf2,EOT},
389 {0xff,0xdf,0xff,0xfe,0xf6,0xff,0xff,0xd3,0xff,
390 0x9f,0x00,0x00,0x00,EOT}},
391 {0x14, "SVID",
392 {0xe0,0xe1,0xe3,0xe4,EOT},
393 {0x00,0x80,0x00,0x00,EOT}},
394 {0x16, "Deep Sleep",
395 {0x30,0xe0,0xe1,0xe2,EOT},
396 {0x20,0x20,0x04,0x05,EOT}},
397 {0x17, "GPIOA",
398 {0xe0,0xe1,0xe2,0xe3,0xe4,0xe5,EOT},
399 {0x01,0x00,0x00,0x00,0x01,0x00,EOT}},
400 {EOT}}},
Guenter Roeck975ffc22012-06-29 12:22:51 -0700401 {0xc562, "NCT6779D", {
402 {NOLDN, NULL,
403 {0x10,0x11,0x13,0x14,0x1a,0x1b,0x1c,0x1d,0x20,
404 0x21,0x22,0x24,0x25,0x26,0x27,0x28,0x2a,0x2b,
405 0x2c,0x2f,EOT},
406 {0xff,0xff,0x00,0x00,0x30,0x70,0x10,0x00,0xc5,
407 0x62,0xff,0x04,0x00,MISC,0x00,0x00,0xc0,0x00,
408 0x01,MISC,EOT}},
409 {0x01, "Parallel Port",
410 {0x30,0x60,0x61,0x70,0x74,0xf0,EOT},
411 {0x01,0x03,0x78,0x07,0x04,0x3f,EOT}},
412 {0x02, "UART A",
413 {0x30,0x60,0x61,0x70,0xf0,0xf2,EOT},
414 {0x01,0x03,0xf8,0x04,0x00,0x00,EOT}},
415 {0x03, "UART B, IR",
416 {0x30,0x60,0x61,0x70,0xf0,0xf1,0xf2,EOT},
417 {0x01,0x02,0xf8,0x03,0x00,0x00,0x00,EOT}},
418 {0x05, "Keyboard Controller",
419 {0x30,0x60,0x61,0x62,0x63,0x70,0x72,0xf0,EOT},
420 {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x83,EOT}},
421 {0x06, "CIR",
422 {0x30,0x60,0x61,0x70,0xf0,0xf1,0xf2,0xf3,EOT},
423 {0x00,0x00,0x00,0x00,0x08,0x09,0x32,0x00,EOT}},
424 {0x07, "GPIO6, GPIO7, GPIO8",
425 {0xe0,0xe1,0xe2,0xe3,0xe4,0xe5,0xe6,0xe7,
426 0xec,0xed,0xf4,0xf5,0xf6,0xf7,0xf8,EOT},
427 {0x0f,0x00,0x00,0x00,0xff,0x00,0x00,0x00,
428 0x00,0x00,0xff,0x00,0x00,0x00,0x00,EOT}},
429 {0x08, "WDT1, GPIO0, GPIO1",
430 {0x30,0x60,0x61,0xe0,0xe1,0xe2,0xe3,0xe4,0xf0,
431 0xf1,0xf2,0xf3,0xf4,0xf5,0xf6,0xf7,EOT},
432 {0x00,0x00,0x00,0xff,0x00,0x00,0x00,0x00,0xff,
433 0x00,0x00,0x00,0x00,0x00,0x00,0x00,EOT}},
434 {0x09, "GPIO1, GPIO2, GPIO3, GPIO4, GPIO5, GPIO6, GPIO7, GPIO8",
435 {0x30,0xe0,0xe1,0xe2,0xe3,0xe4,0xe5,0xe6,0xe7,
436 0xe8,0xe9,0xea,0xeb,0xee,0xf0,0xf1,0xf2,0xf4,
437 0xf5,0xf6,0xf7,0xfe,EOT},
438 {0x00,0xff,0x00,0x00,0x00,0x7f,0x00,0x00,0x00,
439 0x00,0x00,0x00,0x00,0x00,0xff,0x00,0x00,0xff,
440 0x00,0x00,0x00,0x00,EOT}},
441 {0x0a, "ACPI",
442 {0xe0,0xe1,0xe2,0xe3,0xe4,0xe5,0xe6,0xe7,0xe9,
443 0xee,0xf0,0xf2,0xf3,0xf4,0xf6,0xf7,0xfe,EOT},
444 {0x01,0x00,0x00,0x00,0x00,0x02,0x1c,0x00,0x00,
445 0x00,0x10,0x5c,0x00,0x00,0x00,0xc0,0x00,EOT}},
446 {0x0b, "Hardware Monitor, Front Panel LED",
447 {0x30,0x60,0x61,0x62,0x63,0x70,0xe0,0xe1,0xe2,
448 0xe4,0xf0,0xf1,0xf2,0xf5,0xf6,0xf7,0xf8,0xf9,
449 0xfa,EOT},
450 {0x00,0x00,0x00,0x00,0x00,0x00,0x7f,0x7f,0xff,
451 0xff,0x00,0x00,0x00,0x10,0x00,0x87,0x47,0x00,
452 0x00,EOT}},
453 {0x0d, "WDT1",
454 {0xf0,EOT},
455 {0x00,EOT}},
456 {0x0e, "CIR WAKE-UP",
457 {0x30,0x60,0x61,0x70,EOT},
458 {0x00,0x00,0x00,0x00,EOT}},
459 {0x0f, "GPIO Push-Pull or Open-drain",
460 {0xe0,0xe1,0xe2,0xe3,0xe4,0xe5,0xe6,0xe7,0xe9,
461 0xf0,0xf1,0xf2,EOT},
462 {0xff,0xff,0x7f,0xff,0xff,0xff,0x0f,0xff,0xff,
463 0x9d,0x00,0x00,EOT}},
464 {0x14, "Port 80 UART",
465 {0xe0,0xe1,0xe2,0xe3,0xe4,EOT},
466 {0x80,0x00,0x00,0x10,0x00,EOT}},
467 {0x16, "Deep Sleep",
468 {0x30,0xe0,0xe1,0xe2,EOT},
469 {0x20,0x20,0x04,0x05,EOT}},
470 {EOT}}},
David Hendrickse1822d92010-07-22 22:56:44 +0000471 {EOT}
472};
473
474void probe_idregs_nuvoton(uint16_t port)
475{
476 uint8_t sid, srid;
Stefan Reinauer3187d022011-04-22 23:12:40 +0000477 uint16_t chip_id = 0;
478 uint8_t chip_rev = 0;
Guenter Roeck21856ee2012-06-29 12:24:57 -0700479 uint16_t iobase = 0;
480 int i;
Stefan Reinauer3187d022011-04-22 23:12:40 +0000481
482 /* Probe for the 16bit IDs first to avoid collisions */
483 probing_for("Nuvoton", "", port);
484 enter_conf_mode_winbond_fintek_ite_8787(port);
485 chip_id = (regval(port, DEVICE_ID_REG) << 8) |
486 regval(port, DEVICE_ID_REG + 1);
Guenter Roeck21856ee2012-06-29 12:24:57 -0700487 regwrite(port, LDN_SEL, 0x0b);
488 iobase = (regval(port, 0x60) << 8) | (regval(port, 0x61) & ~7);
Stefan Reinauer3187d022011-04-22 23:12:40 +0000489
490 exit_conf_mode_winbond_fintek_ite_8787(port);
491
492 if (!superio_unknown(reg_table, chip_id)) {
493 printf("Found Nuvoton %s (id=0x%02x) at 0x%x\n",
494 get_superio_name(reg_table, chip_id), chip_id, port);
495 chip_found = 1;
Florian Zumbiehld3590612011-11-02 09:46:34 +0100496 enter_conf_mode_winbond_fintek_ite_8787(port);
Stefan Reinauer3187d022011-04-22 23:12:40 +0000497 dump_superio("Nuvoton", reg_table, port, chip_id, LDN_SEL);
Florian Zumbiehld3590612011-11-02 09:46:34 +0100498 exit_conf_mode_winbond_fintek_ite_8787(port);
Guenter Roeck21856ee2012-06-29 12:24:57 -0700499 goto extra;
Stefan Reinauer5ff7c132011-10-31 12:56:45 -0700500 }
Stefan Reinauer3187d022011-04-22 23:12:40 +0000501
502 if (verbose)
503 printf(NOTFOUND "chip_id=0x%04x\n", chip_id);
David Hendrickse1822d92010-07-22 22:56:44 +0000504
505 probing_for("Nuvoton", "(sid=0xfc) ", port);
506
507 sid = regval(port, DEVICE_ID_REG);
508 srid = regval(port, DEVICE_REV_REG);
509
510 if (sid == 0xfc) { /* WPCE775xL family */
511 /*
512 * bits 7-5: Chip ID
513 * bits 4-0: Chip revision
514 */
515 chip_id = srid >> 5;
516 chip_rev = srid & 0x1f;
517 }
518
519 if (superio_unknown(reg_table, sid)) {
520 if (verbose)
521 printf(NOTFOUND
522 "sid=0x%02x, id=0x%02x, rev=0x%02x\n", sid,
523 chip_id, chip_rev);
524 return;
525 }
526
527 printf("Found Nuvoton %s (id=0x%02x, rev=0x%02x) at 0x%x\n",
528 get_superio_name(reg_table, sid), chip_id, chip_rev, port);
529 chip_found = 1;
David Hendrickse1822d92010-07-22 22:56:44 +0000530 dump_superio("Nuvoton", reg_table, port, sid, LDN_SEL);
Guenter Roeck21856ee2012-06-29 12:24:57 -0700531
532extra:
533 if (extra_dump && iobase) {
534 switch (chip_id & 0xfff0) {
535 case 0xb470: /* NCT6775F */
536 for (i = 0; i < 7; i++)
537 dump_data(iobase + 5, i);
538 dump_data(iobase + 5, 0xa);
539 dump_data(iobase + 5, 0xc);
540 dump_data(iobase + 5, 0xd);
541 break;
542 case 0xc330: /* NCT6776F */
543 for (i = 0; i < 8; i++)
544 dump_data(iobase + 5, i);
545 break;
546 case 0xc560: /* NCT6779D */
547 for (i = 0; i < 10; i++)
548 dump_data(iobase + 5, i);
549 break;
550 }
551 }
David Hendrickse1822d92010-07-22 22:56:44 +0000552}
553
554void print_nuvoton_chips(void)
555{
556 print_vendor_chips("Nuvoton", reg_table);
557}