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