blob: fd0d00f0d8966a179f519daeab74c41a2cf86e44 [file] [log] [blame]
Stefan Reinauer23190272008-08-20 13:41:24 +00001/*
2 * inteltool - dump all registers on an Intel CPU + chipset based system.
3 *
Stefan Reinauer14e22772010-04-27 06:56:47 +00004 * Copyright (C) 2008-2010 by coresystems GmbH
5 * written by Stefan Reinauer <stepan@coresystems.de>
6 *
Stefan Reinauer23190272008-08-20 13:41:24 +00007 * 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; version 2 of the License.
10 *
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.
Stefan Reinauer23190272008-08-20 13:41:24 +000015 */
16
17#include <stdio.h>
Stefan Reinauer23190272008-08-20 13:41:24 +000018#include "inteltool.h"
19
Nico Huber5ed986b2013-03-29 19:00:37 +010020static const io_register_t pch_pm_registers[] = {
21 { 0x00, 2, "PM1_STS" }, // PM1 Status; ACPI pointer: PM1a_EVT_BLK
22 { 0x02, 2, "PM1_EN" }, // PM1 Enables; ACPI pointer: PM1a_EVT_BLK+2
23 { 0x04, 4, "PM1_CNT" }, // PM1 Control; ACPI pointer: PM1a_CNT_BLK
24 { 0x08, 4, "PM1_TMR" }, // PM1 Timer; ACPI pointer: PMTMR_BLK
25 { 0x0c, 4, "RESERVED" },
26 { 0x10, 4, "RESERVED" },
27 { 0x14, 4, "RESERVED" },
28 { 0x18, 4, "RESERVED" },
29 { 0x1c, 4, "RESERVED" },
30 { 0x20, 8, "GPE0_STS" }, // General Purpose Event 0 Status; ACPI pointer: GPE0_BLK
31 { 0x28, 8, "GPE0_EN" }, // General Purpose Event 0 Enables; ACPI pointer: GPE0_BLK+8
32 { 0x30, 4, "SMI_EN" },
33 { 0x34, 4, "SMI_STS" },
34 { 0x38, 2, "ALT_GP_SMI_EN" },
35 { 0x3a, 2, "ALT_GP_SMI_STS" },
36 { 0x3c, 1, "UPRWC" }, // USB Per-Port registers write control
37 { 0x3d, 1, "RESERVED" },
38 { 0x3e, 2, "RESERVED" },
39 { 0x40, 2, "RESERVED" },
40 { 0x42, 1, "GPE_CNTL" },
41 { 0x43, 1, "RESERVED" },
42 { 0x44, 2, "DEVACT_STS" }, // Device Activity Status
43 { 0x46, 2, "RESERVED" },
44 { 0x48, 4, "RESERVED" },
45 { 0x4c, 4, "RESERVED" },
46 { 0x50, 1, "PM2_CNT" },
47 { 0x51, 1, "RESERVED" },
48 { 0x52, 2, "RESERVED" },
49 { 0x54, 4, "RESERVED" },
50 { 0x58, 4, "RESERVED" },
51 { 0x5c, 4, "RESERVED" },
52 /* The TCO registers start here. */
53 { 0x60, 2, "TCO_RLD" },
54 { 0x62, 1, "TCO_DAT_IN" },
55 { 0x63, 1, "TCO_DAT_OUT" },
56 { 0x64, 2, "TCO1_STS" },
57 { 0x66, 2, "TCO2_STS" },
58 { 0x68, 2, "TCO1_CNT" },
59 { 0x6a, 2, "TCO2_CNT" },
60 { 0x6c, 2, "TCO_MESSAGE" },
61 { 0x6e, 1, "TCO_WDCNT" },
62 { 0x6f, 1, "RESERVED" },
63 { 0x70, 1, "SW_IRQ_GEN" },
64 { 0x71, 1, "RESERVED" },
65 { 0x72, 2, "TCO_TMR" },
66 { 0x74, 4, "RESERVED" },
67 { 0x78, 4, "RESERVED" },
68 { 0x7c, 4, "RESERVED" },
69};
70
Warren Turkal3cf287d2010-09-03 09:36:37 +000071static const io_register_t ich10_pm_registers[] = {
72 { 0x00, 2, "PM1_STS" }, // PM1 Status; ACPI pointer: PM1a_EVT_BLK
73 { 0x02, 2, "PM1_EN" }, // PM1 Enables; ACPI pointer: PM1a_EVT_BLK+2
74 { 0x04, 4, "PM1_CNT" }, // PM1 Control; ACPI pointer: PM1a_CNT_BLK
75 { 0x08, 4, "PM1_TMR" }, // PM1 Timer; ACPI pointer: PMTMR_BLK
76 { 0x0c, 4, "RESERVED" },
77 { 0x10, 4, "PROC_CNT" }, // Processor Control; ACPI pointer: P_BLK
78#if DANGEROUS_REGISTERS
79 /* These registers return 0 on read, but reading them may cause
80 * the system to enter Cx states, which might hang the system.
81 */
82 { 0x14, 1, "LV2 (Mobile)" },
83 { 0x15, 1, "LV3 (Mobile)" },
84 { 0x16, 1, "LV4 (Mobile)" },
85#endif
86 { 0x17, 2, "RESERVED" },
87 { 0x19, 1, "RESERVED" },
88 { 0x1a, 2, "RESERVED" },
89 { 0x1c, 4, "RESERVED" },
90 { 0x20, 8, "GPE0_STS" }, // General Purpose Event 0 Status; ACPI pointer: GPE0_BLK
Nico Huberaa5eae62012-09-24 10:58:41 +020091 { 0x28, 8, "GPE0_EN" }, // General Purpose Event 0 Enables; ACPI pointer: GPE0_BLK+8
Warren Turkal3cf287d2010-09-03 09:36:37 +000092 { 0x30, 4, "SMI_EN" },
93 { 0x34, 4, "SMI_STS" },
94 { 0x38, 2, "ALT_GP_SMI_EN" },
95 { 0x3a, 2, "ALT_GP_SMI_STS" },
96 { 0x3c, 1, "UPRWC" }, // USB Per-Port registers write control;
97 { 0x3d, 2, "RESERVED" },
98 { 0x3f, 1, "RESERVED" },
99 { 0x40, 2, "RESERVED" },
100 { 0x42, 1, "GPE_CNTL" },
101 { 0x43, 1, "RESERVED" },
102 { 0x44, 2, "DEVACT_STS" }, // Device Activity Status
103 { 0x46, 2, "RESERVED" },
104 { 0x48, 4, "RESERVED" },
105 { 0x4c, 4, "RESERVED" },
106 { 0x50, 1, "PM2_CNT (Mobile)" }, // PM2 Control (Mobile only); ACPI pointer: PM2a_CNT_BLK
107 { 0x51, 1, "RESERVED" },
108 { 0x52, 2, "RESERVED" },
109 { 0x54, 4, "C3_RES (Mobile)" },
110 { 0x58, 4, "RESERVED" },
111 { 0x5c, 4, "RESERVED" },
112 /* Here start the TCO registers */
113 { 0x60, 2, "TCO_RLD" },
114 { 0x62, 1, "TCO_DAT_IN" },
115 { 0x63, 1, "TCO_DAT_OUT" },
116 { 0x64, 2, "TCO1_STS" },
117 { 0x66, 2, "TCO2_STS" },
118 { 0x68, 2, "TCO1_CNT" },
119 { 0x6a, 2, "TCO2_CNT" },
120 { 0x6c, 2, "TCO_MESSAGE" },
121 { 0x6e, 1, "TCO_WDCNT" },
122 { 0x6f, 1, "RESERVED" },
123 { 0x70, 1, "SW_IRQ_GEN" },
124 { 0x71, 1, "RESERVED" },
125 { 0x72, 2, "TCO_TMR" },
126 { 0x74, 4, "RESERVED" },
127 { 0x78, 4, "RESERVED" },
128 { 0x7c, 4, "RESERVED" },
129};
130
Anton Kochkovda0b4562010-05-30 12:33:12 +0000131static const io_register_t ich9_pm_registers[] = {
132 { 0x00, 2, "PM1_STS" }, // PM1 Status; ACPI pointer: PM1a_EVT_BLK
133 { 0x02, 2, "PM1_EN" }, // PM1 Enables; ACPI pointer: PM1a_EVT_BLK+2
134 { 0x04, 4, "PM1_CNT" }, // PM1 Control; ACPI pointer: PM1a_CNT_BLK
135 { 0x08, 4, "PM1_TMR" }, // PM1 Timer; ACPI pointer: PMTMR_BLK
Stefan Reinauer1162f252008-12-04 15:18:20 +0000136 { 0x0c, 4, "RESERVED" },
Anton Kochkovda0b4562010-05-30 12:33:12 +0000137 { 0x10, 4, "PROC_CNT" }, // Processor Control; ACPI pointer: P_BLK
Stefan Reinauer1162f252008-12-04 15:18:20 +0000138#if DANGEROUS_REGISTERS
139 /* These registers return 0 on read, but reading them may cause
Anton Kochkovda0b4562010-05-30 12:33:12 +0000140 * the system to enter Cx states, which might hang the system.
Stefan Reinauer1162f252008-12-04 15:18:20 +0000141 */
Anton Kochkovda0b4562010-05-30 12:33:12 +0000142 { 0x14, 1, "LV2 (Mobile)" },
143 { 0x15, 1, "LV3 (Mobile)" },
144 { 0x16, 1, "LV4 (Mobile)" },
145 { 0x17, 1, "LV5 (Mobile)" },
146 { 0x18, 1, "LV6 (Mobile)" },
Stefan Reinauer1162f252008-12-04 15:18:20 +0000147#endif
Anton Kochkovda0b4562010-05-30 12:33:12 +0000148 { 0x19, 1, "RESERVED" },
149 { 0x1a, 2, "RESERVED" },
Stefan Reinauer1162f252008-12-04 15:18:20 +0000150 { 0x1c, 4, "RESERVED" },
Anton Kochkovda0b4562010-05-30 12:33:12 +0000151 { 0x20, 8, "GPE0_STS" }, // General Purpose Event 0 Status; ACPI pointer: GPE0_BLK
Nico Huberaa5eae62012-09-24 10:58:41 +0200152 { 0x28, 8, "GPE0_EN" }, // General Purpose Event 0 Enables; ACPI pointer: GPE0_BLK+8
Stefan Reinauer1162f252008-12-04 15:18:20 +0000153 { 0x30, 4, "SMI_EN" },
154 { 0x34, 4, "SMI_STS" },
155 { 0x38, 2, "ALT_GP_SMI_EN" },
156 { 0x3a, 2, "ALT_GP_SMI_STS" },
Anton Kochkovda0b4562010-05-30 12:33:12 +0000157 { 0x3c, 1, "UPRWC" }, // USB Per-Port registers write control;
158 { 0x3d, 2, "RESERVED" },
159 { 0x3f, 1, "RESERVED" },
Stefan Reinauer1162f252008-12-04 15:18:20 +0000160 { 0x40, 2, "RESERVED" },
161 { 0x42, 1, "GPE_CNTL" },
162 { 0x43, 1, "RESERVED" },
Anton Kochkovda0b4562010-05-30 12:33:12 +0000163 { 0x44, 2, "DEVACT_STS" }, // Device Activity Status
Stefan Reinauer1162f252008-12-04 15:18:20 +0000164 { 0x46, 2, "RESERVED" },
165 { 0x48, 4, "RESERVED" },
166 { 0x4c, 4, "RESERVED" },
Anton Kochkovda0b4562010-05-30 12:33:12 +0000167 { 0x50, 1, "PM2_CNT (Mobile)" }, // PM2 Control (Mobile only); ACPI pointer: PM2a_CNT_BLK
Stefan Reinauer1162f252008-12-04 15:18:20 +0000168 { 0x51, 1, "RESERVED" },
169 { 0x52, 2, "RESERVED" },
Anton Kochkovda0b4562010-05-30 12:33:12 +0000170 { 0x54, 4, "C3_RES (Mobile)" },
171 { 0x58, 4, "C5_RES (Mobile)" },
Stefan Reinauer1162f252008-12-04 15:18:20 +0000172 { 0x5c, 4, "RESERVED" },
173 /* Here start the TCO registers */
174 { 0x60, 2, "TCO_RLD" },
175 { 0x62, 1, "TCO_DAT_IN" },
176 { 0x63, 1, "TCO_DAT_OUT" },
177 { 0x64, 2, "TCO1_STS" },
178 { 0x66, 2, "TCO2_STS" },
179 { 0x68, 2, "TCO1_CNT" },
180 { 0x6a, 2, "TCO2_CNT" },
181 { 0x6c, 2, "TCO_MESSAGE" },
182 { 0x6e, 1, "TCO_WDCNT" },
183 { 0x6f, 1, "RESERVED" },
184 { 0x70, 1, "SW_IRQ_GEN" },
185 { 0x71, 1, "RESERVED" },
186 { 0x72, 2, "TCO_TMR" },
187 { 0x74, 4, "RESERVED" },
188 { 0x78, 4, "RESERVED" },
189 { 0x7c, 4, "RESERVED" },
190};
191
192static const io_register_t ich8_pm_registers[] = {
193 { 0x00, 2, "PM1_STS" },
194 { 0x02, 2, "PM1_EN" },
195 { 0x04, 4, "PM1_CNT" },
196 { 0x08, 4, "PM1_TMR" },
197 { 0x0c, 4, "RESERVED" },
198 { 0x10, 4, "PROC_CNT" },
199#if DANGEROUS_REGISTERS
200 /* These registers return 0 on read, but reading them may cause
201 * the system to enter Cx states, which might hang the system.
202 */
203 { 0x14, 1, "LV2 (Mobile)" },
204 { 0x15, 1, "LV3 (Mobile)" },
205 { 0x16, 1, "LV4 (Mobile)" },
206 { 0x17, 1, "LV5 (Mobile)" },
207 { 0x18, 1, "LV6 (Mobile)" },
208#endif
209 { 0x19, 1, "RESERVED" },
210 { 0x1a, 2, "RESERVED" },
211 { 0x1c, 4, "RESERVED" },
212 { 0x20, 1, "PM2_CNT (Mobile)" },
213 { 0x21, 1, "RESERVED" },
214 { 0x22, 2, "RESERVED" },
215 { 0x24, 4, "RESERVED" },
216 { 0x28, 4, "GPE0_STS" },
217 { 0x2C, 4, "GPE0_EN" },
218 { 0x30, 4, "SMI_EN" },
219 { 0x34, 4, "SMI_STS" },
220 { 0x38, 2, "ALT_GP_SMI_EN" },
221 { 0x3a, 2, "ALT_GP_SMI_STS" },
222 { 0x3c, 4, "RESERVED" },
223 { 0x40, 2, "RESERVED" },
224 { 0x42, 1, "GPE_CNTL" },
225 { 0x43, 1, "RESERVED" },
226 { 0x44, 2, "DEVACT_STS" },
227 { 0x46, 2, "RESERVED" },
228 { 0x48, 4, "RESERVED" },
229 { 0x4c, 4, "RESERVED" },
230 { 0x50, 1, "SS_CNT (Mobile)" },
231 { 0x51, 1, "RESERVED" },
232 { 0x52, 2, "RESERVED" },
233 { 0x54, 4, "C3_RES (Mobile)" },
234 { 0x58, 4, "C5_RES (Mobile)" },
235 { 0x5c, 4, "RESERVED" },
236 /* Here start the TCO registers */
237 { 0x60, 2, "TCO_RLD" },
238 { 0x62, 1, "TCO_DAT_IN" },
239 { 0x63, 1, "TCO_DAT_OUT" },
240 { 0x64, 2, "TCO1_STS" },
241 { 0x66, 2, "TCO2_STS" },
242 { 0x68, 2, "TCO1_CNT" },
243 { 0x6a, 2, "TCO2_CNT" },
244 { 0x6c, 2, "TCO_MESSAGE" },
245 { 0x6e, 1, "TCO_WDCNT" },
246 { 0x6f, 1, "RESERVED" },
247 { 0x70, 1, "SW_IRQ_GEN" },
248 { 0x71, 1, "RESERVED" },
249 { 0x72, 2, "TCO_TMR" },
250 { 0x74, 4, "RESERVED" },
251 { 0x78, 4, "RESERVED" },
252 { 0x7c, 4, "RESERVED" },
253};
254
Anton Kochkovda0b4562010-05-30 12:33:12 +0000255static const io_register_t ich7_pm_registers[] = {
256 { 0x00, 2, "PM1_STS" },
257 { 0x02, 2, "PM1_EN" },
258 { 0x04, 4, "PM1_CNT" },
259 { 0x08, 4, "PM1_TMR" },
260 { 0x0c, 4, "RESERVED" },
261 { 0x10, 4, "PROC_CNT" },
262#if DANGEROUS_REGISTERS
263 /* These registers return 0 on read, but reading them may cause
264 * the system to enter C2/C3/C4 state, which might hang the system.
265 */
266 { 0x14, 1, "LV2 (Mobile/Ultra Mobile)" },
267 { 0x15, 1, "LV3 (Mobile/Ultra Mobile)" },
268 { 0x16, 1, "LV4 (Mobile/Ultra Mobile)" },
269#endif
270 { 0x17, 1, "RESERVED" },
271 { 0x18, 4, "RESERVED" },
272 { 0x1c, 4, "RESERVED" },
273 { 0x20, 1, "PM2_CNT (Mobile/Ultra Mobile)" },
274 { 0x21, 1, "RESERVED" },
275 { 0x22, 2, "RESERVED" },
276 { 0x24, 4, "RESERVED" },
277 { 0x28, 4, "GPE0_STS" },
278 { 0x2C, 4, "GPE0_EN" },
279 { 0x30, 4, "SMI_EN" },
280 { 0x34, 4, "SMI_STS" },
281 { 0x38, 2, "ALT_GP_SMI_EN" },
282 { 0x3a, 2, "ALT_GP_SMI_STS" },
283 { 0x3c, 4, "RESERVED" },
284 { 0x40, 2, "RESERVED" },
285 { 0x42, 1, "GPE_CNTL" },
286 { 0x43, 1, "RESERVED" },
287 { 0x44, 2, "DEVACT_STS" },
288 { 0x46, 2, "RESERVED" },
289 { 0x48, 4, "RESERVED" },
290 { 0x4c, 4, "RESERVED" },
291 { 0x50, 1, "SS_CNT (Mobile/Ultra Mobile)" },
292 { 0x51, 1, "RESERVED" },
293 { 0x52, 2, "RESERVED" },
294 { 0x54, 4, "C3_RES (Mobile/Ultra Mobile)" },
295 { 0x58, 4, "RESERVED" },
296 { 0x5c, 4, "RESERVED" },
297 /* Here start the TCO registers */
298 { 0x60, 2, "TCO_RLD" },
299 { 0x62, 1, "TCO_DAT_IN" },
300 { 0x63, 1, "TCO_DAT_OUT" },
301 { 0x64, 2, "TCO1_STS" },
302 { 0x66, 2, "TCO2_STS" },
303 { 0x68, 2, "TCO1_CNT" },
304 { 0x6a, 2, "TCO2_CNT" },
305 { 0x6c, 2, "TCO_MESSAGE" },
306 { 0x6e, 1, "TCO_WDCNT" },
307 { 0x6f, 1, "RESERVED" },
308 { 0x70, 1, "SW_IRQ_GEN" },
309 { 0x71, 1, "RESERVED" },
310 { 0x72, 2, "TCO_TMR" },
311 { 0x74, 4, "RESERVED" },
312 { 0x78, 4, "RESERVED" },
313 { 0x7c, 4, "RESERVED" },
314};
315
Stefan Reinauer14e22772010-04-27 06:56:47 +0000316/*
Pat Erleyca3548e2010-04-21 06:23:19 +0000317 * INTEL I/O Controller Hub 6 Family
318 * http://www.intel.com/assets/pdf/datasheet/301473.pdf
319 */
320static const io_register_t ich6_pm_registers[] = {
321 /* 10.8.3 */
322 { 0x00, 2, "PM1_STS" },
323 { 0x02, 2, "PM1_EN" },
324 { 0x04, 4, "PM1_CNT" },
325 { 0x08, 4, "PM1_TMR" },
326 { 0x10, 4, "PROC_CNT" },
327#if DANGEROUS_REGISTERS
328 /* These registers return 0 on read, but reading them may cause
329 * the system to enter C2/C3/C4 state, which might hang the system.
330 */
331 { 0x14, 1, "LV2" },
332 { 0x15, 1, "LV3 (Mobile Only)" },
333 { 0x16, 1, "LV4 (Mobile Only)" },
334#endif
335 { 0x20, 1, "PM2_CNT (Mobile Only)" },
336 { 0x28, 4, "GPE0_STS" },
337 { 0x2c, 4, "GPE0_EN" },
338 { 0x30, 4, "SMI_EN" },
339 { 0x34, 4, "SMI_STS" },
340 { 0x38, 2, "ALT_GP_SMI_EN" },
341 { 0x3a, 2, "ALT_GP_SMI_STS" },
342 { 0x44, 2, "DEVACT_STS" },
343 { 0x50, 1, "SS_CNT (Mobile Only)" },
344 { 0x54, 4, "C3_RES (Mobile Only)" },
345};
346
Idwer Vollering312fc962010-12-17 22:34:58 +0000347static const io_register_t ich5_pm_registers[] = {
348 { 0x00, 2, "PM1_STS" },
349 { 0x02, 2, "PM1_EN" },
350 { 0x04, 4, "PM1_CNT" },
351 { 0x08, 4, "PM1_TMR" },
352 { 0x0c, 4, "RESERVED" },
353 { 0x10, 4, "PROC_CNT" },
354 { 0x14, 3, "RESERVED" },
355 { 0x17, 9, "RESERVED" },
356 { 0x20, 1, "RESERVED" },
357 { 0x28, 4, "GPE0_STS" },
358 { 0x2c, 4, "GPE0_EN" },
359 { 0x30, 4, "SMI_EN" },
360 { 0x34, 4, "SMI_STS" },
361 { 0x38, 2, "ALT_GP_SMI_EN" },
362 { 0x3a, 2, "ALT_GP_SMI_STS" },
363 { 0x3c, 4, "RESERVED" },
364 { 0x40, 1, "MON_SMI" },
365 { 0x42, 2, "RESERVED" },
366 { 0x44, 1, "DEVACT_STS" },
367 { 0x48, 1, "DEVTRAP_EN" },
368 { 0x50, 1, "RESERVED" },
369 { 0x51, 15, "RESERVED" },
370 { 0x60, 16, "RESERVED" },
371};
372
Stefan Reinauer04844812010-02-22 11:26:06 +0000373static const io_register_t ich4_pm_registers[] = {
374 { 0x00, 2, "PM1_STS" },
375 { 0x02, 2, "PM1_EN" },
376 { 0x04, 4, "PM1_CNT" },
377 { 0x08, 4, "PM1_TMR" },
378 { 0x0c, 4, "RESERVED" },
379 { 0x10, 4, "PROC_CNT" },
380#if DANGEROUS_REGISTERS
381 /* These registers return 0 on read, but reading them may cause
382 * the system to enter C2/C3/C4 state, which might hang the system.
383 */
384 { 0x14, 1, "LV2 (Mobile)" },
385 { 0x15, 1, "LV3 (Mobile)" },
386 { 0x16, 1, "LV4 (Mobile)" },
387#endif
388 { 0x17, 1, "RESERVED" },
389 { 0x18, 4, "RESERVED" },
390 { 0x1c, 4, "RESERVED" },
391 { 0x20, 1, "PM2_CNT (Mobile)" },
392 { 0x21, 1, "RESERVED" },
393 { 0x22, 2, "RESERVED" },
394 { 0x24, 4, "RESERVED" },
395 { 0x28, 4, "GPE0_STS" },
396 { 0x2C, 4, "GPE0_EN" },
397 { 0x30, 4, "SMI_EN" },
398 { 0x34, 4, "SMI_STS" },
399 { 0x38, 2, "ALT_GP_SMI_EN" },
400 { 0x3a, 2, "ALT_GP_SMI_STS" },
401 { 0x3c, 4, "RESERVED" },
402 { 0x40, 2, "MON_SMI" },
403 { 0x42, 2, "RESERVED" },
404 { 0x44, 2, "DEVACT_STS" },
405 { 0x46, 2, "RESERVED" },
406 { 0x48, 4, "DEVTRAP_EN" },
407 { 0x4c, 2, "BUS_ADDR_TRACK" },
408 { 0x4e, 2, "BUS_CYC_TRACK" },
409 { 0x50, 1, "SS_CNT (Mobile/Ultra Mobile)" },
410 { 0x51, 1, "RESERVED" },
411 { 0x52, 2, "RESERVED" },
412 { 0x54, 4, "RESERVED" },
413 { 0x58, 4, "RESERVED" },
414 { 0x5c, 4, "RESERVED" },
415 /* Here start the TCO registers */
416 { 0x60, 1, "TCO_RLD" },
417 { 0x61, 1, "TCO_TMR" },
418 { 0x62, 1, "TCO_DAT_IN" },
419 { 0x63, 1, "TCO_DAT_OUT" },
420 { 0x64, 2, "TCO1_STS" },
421 { 0x66, 2, "TCO2_STS" },
422 { 0x68, 2, "TCO1_CNT" },
423 { 0x6a, 2, "TCO2_CNT" },
424 { 0x6c, 2, "TCO_MESSAGE" },
425 { 0x6e, 1, "TCO_WDSTATUS" },
426 { 0x6f, 1, "RESERVED" },
427 { 0x70, 1, "SW_IRQ_GEN" },
428 { 0x71, 1, "RESERVED" },
429 { 0x72, 2, "RESERVED" },
430 { 0x74, 4, "RESERVED" },
431 { 0x78, 4, "RESERVED" },
432 { 0x7c, 4, "RESERVED" },
433};
434
Joseph Smithe10757e2010-06-16 22:21:19 +0000435static const io_register_t ich2_pm_registers[] = {
436 { 0x00, 2, "PM1_STS" },
437 { 0x02, 2, "PM1_EN" },
438 { 0x04, 4, "PM1_CNT" },
439 { 0x08, 4, "PM1_TMR" },
440 { 0x0c, 4, "RESERVED" },
441 { 0x10, 4, "PROC_CNT" },
442#if DANGEROUS_REGISTERS
443 /* This register returns 0 on read, but reading it may cause
444 * the system to enter C2 state, which might hang the system.
445 */
446 { 0x14, 1, "LV2" },
447 { 0x15, 1, "RESERVED" },
448 { 0x16, 2, "RESERVED" },
449#endif
450 { 0x18, 4, "RESERVED" },
451 { 0x1c, 4, "RESERVED" },
452 { 0x20, 4, "RESERVED" },
453 { 0x24, 4, "RESERVED" },
454 { 0x28, 2, "GPE0_STS" },
455 { 0x2a, 2, "GPE0_EN" },
456 { 0x2c, 2, "GPE1_STS" },
457 { 0x2e, 2, "GPE1_EN" },
458 { 0x30, 2, "SMI_EN" },
459 { 0x32, 2, "RESERVED" },
460 { 0x34, 2, "SMI_STS" },
461 { 0x36, 2, "RESERVED" },
462 { 0x38, 4, "RESERVED" },
463 { 0x3c, 4, "RESERVED" },
464 { 0x40, 2, "MON_SMI_STS" },
465 { 0x42, 2, "RESERVED" },
466 { 0x44, 2, "DEV_TRP_STS" },
467 { 0x46, 2, "RESERVED" },
468 { 0x48, 2, "TRP_EN" },
469 { 0x4A, 2, "RESERVED" },
470 { 0x4c, 2, "BUS_ADDR_TRACK" },
471 { 0x4e, 1, "BUS_CYC_TRACK" },
472 { 0x4f, 1, "RESERVED" },
473 { 0x50, 4, "RESERVED" },
474 { 0x54, 4, "RESERVED" },
475 { 0x58, 4, "RESERVED" },
476 { 0x5c, 4, "RESERVED" },
477 /* Here start the TCO registers */
478 { 0x60, 1, "TCO_RLD" },
479 { 0x61, 1, "TCO_TMR" },
480 { 0x62, 1, "TCO_DAT_IN" },
481 { 0x63, 1, "TCO_DAT_OUT" },
482 { 0x64, 2, "TCO1_STS" },
483 { 0x66, 2, "TCO2_STS" },
484 { 0x68, 2, "TCO1_CNT" },
485 { 0x6a, 2, "TCO2_CNT" },
486 { 0x6c, 1, "TCO_MESSAGE1" },
487 { 0x6d, 1, "TCO_MESSAGE2" },
488 { 0x6e, 1, "TCO_WDSTATUS" },
489 { 0x6f, 1, "RESERVED" },
490 { 0x70, 1, "SW_IRQ_GEN" },
491 { 0x71, 1, "RESERVED" },
492 { 0x72, 2, "RESERVED" },
493 { 0x74, 4, "RESERVED" },
494 { 0x78, 4, "RESERVED" },
495 { 0x7c, 4, "RESERVED" },
496};
497
Stefan Reinauerb2aedb12009-08-29 15:45:43 +0000498static const io_register_t ich0_pm_registers[] = {
499 { 0x00, 2, "PM1_STS" },
500 { 0x02, 2, "PM1_EN" },
501 { 0x04, 4, "PM1_CNT" },
502 { 0x08, 4, "PM1_TMR" },
503 { 0x0c, 4, "RESERVED" },
504 { 0x10, 4, "PROC_CNT" },
505#if DANGEROUS_REGISTERS
506 /* This register returns 0 on read, but reading it may cause
507 * the system to enter C2 state, which might hang the system.
508 */
509 { 0x14, 1, "LV2" },
510 { 0x15, 1, "RESERVED" },
511 { 0x16, 2, "RESERVED" },
512#endif
513 { 0x18, 4, "RESERVED" },
514 { 0x1c, 4, "RESERVED" },
515 { 0x20, 4, "RESERVED" },
516 { 0x24, 4, "RESERVED" },
517 { 0x28, 4, "GPE0_STS" },
518 { 0x2C, 4, "GPE0_EN" },
519 { 0x30, 2, "SMI_EN" },
520 { 0x32, 2, "RESERVED" },
521 { 0x34, 2, "SMI_STS" },
522 { 0x36, 2, "RESERVED" },
523 { 0x38, 4, "RESERVED" },
524 { 0x3c, 4, "RESERVED" },
525 { 0x40, 2, "IOMON_STS_EN" },
526 { 0x42, 2, "RESERVED" },
527 { 0x44, 2, "DEVACT_STS" },
528 { 0x46, 2, "RESERVED" },
529 { 0x48, 4, "RESERVED" },
530 { 0x4c, 2, "BUS_ADDR_TRACK" },
531 { 0x4e, 1, "BUS_CYC_TRACK" },
532 { 0x4f, 1, "RESERVED" },
533 { 0x50, 4, "RESERVED" },
534 { 0x54, 4, "RESERVED" },
535 { 0x58, 4, "RESERVED" },
536 { 0x5c, 4, "RESERVED" },
537 /* Here start the TCO registers */
538 { 0x60, 1, "TCO_RLD" },
539 { 0x61, 1, "TCO_TMR" },
540 { 0x62, 1, "TCO_DAT_IN" },
541 { 0x63, 1, "TCO_DAT_OUT" },
542 { 0x64, 2, "TCO1_STS" },
543 { 0x66, 2, "TCO2_STS" },
544 { 0x68, 2, "TCO1_CNT" },
545 { 0x6a, 2, "TCO2_CNT" },
546 { 0x6c, 1, "TCO_MESSAGE1" },
547 { 0x6d, 1, "TCO_MESSAGE2" },
548 { 0x6e, 1, "TCO_WDSTATUS" },
549 { 0x6f, 1, "RESERVED" },
550 { 0x70, 4, "RESERVED" },
551 { 0x74, 4, "RESERVED" },
552 { 0x78, 4, "RESERVED" },
553 { 0x7c, 4, "RESERVED" },
554};
555
Maciej Pijanka90d17402009-09-30 17:05:46 +0000556static const io_register_t i82371xx_pm_registers[] = {
557 { 0x00, 2, "PMSTS" },
558 { 0x02, 2, "PMEN" },
559 { 0x04, 2, "PMCNTRL" },
560 { 0x06, 2, "RESERVED" },
561 { 0x08, 1, "PMTMR" },
562 { 0x09, 1, "RESERVED" },
563 { 0x0A, 1, "RESERVED" },
564 { 0x0B, 1, "RESERVED" },
565 { 0x0C, 2, "GPSTS" },
566 { 0x0E, 2, "GPEN" },
567 { 0x10, 4, "PCNTRL" },
568#if DANGEROUS_REGISTERS
569 /*
570 * This register returns 0 on read, but reading it may cause
571 * the system to enter C2 state, which might hang the system.
572 */
573 { 0x14, 1, "PLVL2" },
574 { 0x15, 1, "PLVL3" },
575 { 0x16, 2, "RESERVED" },
576#endif
577 { 0x18, 2, "GLBSTS" },
578 { 0x1A, 2, "RESERVED" },
579 { 0x1c, 4, "DEVSTS" },
580 { 0x20, 2, "GLBEN" },
581 { 0x22, 1, "RESERVED" },
582 { 0x23, 1, "RESERVED" },
583 { 0x24, 1, "RESERVED" },
584 { 0x25, 1, "RESERVED" },
585 { 0x26, 1, "RESERVED" },
586 { 0x27, 1, "RESERVED" },
587 { 0x28, 4, "GLBCTL" },
588 { 0x2C, 4, "DEVCTL" },
589 /* The registers 0x30-0x33 and 0x34-0x37 allow byte-wise reads only. */
590 { 0x30, 1, "GPIREG 0" },
591 { 0x31, 1, "GPIREG 1" },
592 { 0x32, 1, "GPIREG 2" },
593 { 0x33, 1, "GPIREG 3" },
594 { 0x34, 1, "GPOREG 0" },
595 { 0x35, 1, "GPOREG 1" },
596 { 0x36, 1, "GPOREG 2" },
597 { 0x37, 1, "GPOREG 3" },
598};
599
Sven Schnelle54a5aed2011-10-30 13:30:36 +0100600static const io_register_t i63xx_pm_registers[] = {
601 { 0x00, 2, "PM1_STS" },
602 { 0x02, 2, "PM1_EN" },
603 { 0x04, 4, "PM1_CNT" },
604 { 0x08, 4, "PM1_TMR" },
605 { 0x0c, 4, "RESERVED" },
606 { 0x10, 4, "PROC_CNT" },
607#if DANGEROUS_REGISTERS
608 /* This register returns 0 on read, but reading it may cause
609 * the system to enter C2 state, which might hang the system.
610 */
611 { 0x14, 1, "LV2" },
612 { 0x15, 1, "RESERVED" },
613 { 0x16, 2, "RESERVED" },
614#endif
615 { 0x18, 4, "RESERVED" },
616 { 0x1c, 4, "RESERVED" },
617 { 0x20, 4, "RESERVED" },
618 { 0x24, 4, "RESERVED" },
619 { 0x28, 4, "GPE0_STS" },
620 { 0x2C, 4, "GPE0_EN" },
621 { 0x30, 4, "SMI_EN" },
622 { 0x34, 4, "SMI_STS" },
623 { 0x38, 2, "ALT_GP_SMI_EN" },
624 { 0x3a, 2, "ALT_GP_SMI_STS" },
625 { 0x3c, 4, "RESERVED" },
626 { 0x40, 4, "RESERVED" },
627 { 0x44, 2, "DEVACT_STS" },
628 { 0x46, 2, "RESERVED" },
629 { 0x48, 4, "RESERVED" },
630 { 0x4c, 4, "RESERVED" },
631 { 0x50, 4, "RESERVED" },
632 { 0x54, 4, "C3_RES" },
633 { 0x58, 4, "RESERVED" },
634 { 0x5c, 4, "RESERVED" },
635 { 0x60, 1, "RESERVED" },
636 { 0x64, 4, "RESERVED" },
637 { 0x68, 4, "RESERVED" },
638 { 0x6c, 4, "RESERVED" },
639 { 0x70, 4, "RESERVED" },
640 { 0x74, 4, "RESERVED" },
641 { 0x78, 4, "RESERVED" },
642 { 0x7c, 4, "RESERVED" },
643};
644
Tobias Diedrich3645e612010-11-27 14:44:19 +0000645int print_pmbase(struct pci_dev *sb, struct pci_access *pacc)
Stefan Reinauer23190272008-08-20 13:41:24 +0000646{
Stefan Reinauer1162f252008-12-04 15:18:20 +0000647 int i, size;
Stefan Reinauer23190272008-08-20 13:41:24 +0000648 uint16_t pmbase;
Stefan Reinauer1162f252008-12-04 15:18:20 +0000649 const io_register_t *pm_registers;
Tobias Diedrich3645e612010-11-27 14:44:19 +0000650 struct pci_dev *acpi;
Stefan Reinauer23190272008-08-20 13:41:24 +0000651
652 printf("\n============= PMBASE ============\n\n");
653
654 switch (sb->device_id) {
Stefan Taunerb75a39a2014-11-01 17:12:37 +0100655 case PCI_DEVICE_ID_INTEL_3400:
656 case PCI_DEVICE_ID_INTEL_3420:
657 case PCI_DEVICE_ID_INTEL_3450:
658 case PCI_DEVICE_ID_INTEL_3400_DESKTOP:
659 case PCI_DEVICE_ID_INTEL_3400_MOBILE:
660 case PCI_DEVICE_ID_INTEL_3400_MOBILE_SFF:
661 case PCI_DEVICE_ID_INTEL_B55_A:
662 case PCI_DEVICE_ID_INTEL_B55_B:
663 case PCI_DEVICE_ID_INTEL_H55:
664 case PCI_DEVICE_ID_INTEL_H57:
665 case PCI_DEVICE_ID_INTEL_HM55:
666 case PCI_DEVICE_ID_INTEL_HM57:
667 case PCI_DEVICE_ID_INTEL_P55:
668 case PCI_DEVICE_ID_INTEL_PM55:
669 case PCI_DEVICE_ID_INTEL_Q57:
670 case PCI_DEVICE_ID_INTEL_QM57:
671 case PCI_DEVICE_ID_INTEL_QS57:
Nico Huber5ed986b2013-03-29 19:00:37 +0100672 case PCI_DEVICE_ID_INTEL_Z68:
673 case PCI_DEVICE_ID_INTEL_P67:
674 case PCI_DEVICE_ID_INTEL_UM67:
675 case PCI_DEVICE_ID_INTEL_HM65:
676 case PCI_DEVICE_ID_INTEL_H67:
677 case PCI_DEVICE_ID_INTEL_HM67:
678 case PCI_DEVICE_ID_INTEL_Q65:
679 case PCI_DEVICE_ID_INTEL_QS67:
680 case PCI_DEVICE_ID_INTEL_Q67:
681 case PCI_DEVICE_ID_INTEL_QM67:
682 case PCI_DEVICE_ID_INTEL_B65:
683 case PCI_DEVICE_ID_INTEL_C202:
684 case PCI_DEVICE_ID_INTEL_C204:
685 case PCI_DEVICE_ID_INTEL_C206:
686 case PCI_DEVICE_ID_INTEL_H61:
687 case PCI_DEVICE_ID_INTEL_Z77:
688 case PCI_DEVICE_ID_INTEL_Z75:
689 case PCI_DEVICE_ID_INTEL_Q77:
690 case PCI_DEVICE_ID_INTEL_Q75:
691 case PCI_DEVICE_ID_INTEL_B75:
692 case PCI_DEVICE_ID_INTEL_H77:
693 case PCI_DEVICE_ID_INTEL_C216:
694 case PCI_DEVICE_ID_INTEL_QM77:
695 case PCI_DEVICE_ID_INTEL_QS77:
696 case PCI_DEVICE_ID_INTEL_HM77:
697 case PCI_DEVICE_ID_INTEL_UM77:
698 case PCI_DEVICE_ID_INTEL_HM76:
699 case PCI_DEVICE_ID_INTEL_HM75:
700 case PCI_DEVICE_ID_INTEL_HM70:
Dennis Wassenbergae6685f2014-10-30 10:30:40 +0100701 case PCI_DEVICE_ID_INTEL_LYNXPOINT_LP_FULL:
702 case PCI_DEVICE_ID_INTEL_LYNXPOINT_LP_PREM:
703 case PCI_DEVICE_ID_INTEL_LYNXPOINT_LP_BASE:
Matt DeVillier5b667df2015-05-14 21:58:33 -0500704 case PCI_DEVICE_ID_INTEL_WILDCATPOINT_LP:
Martin Roth51dde6f2014-12-07 22:11:54 -0700705 case PCI_DEVICE_ID_INTEL_BAYTRAIL_LPC:
Nico Huber5ed986b2013-03-29 19:00:37 +0100706 pmbase = pci_read_word(sb, 0x40) & 0xff80;
707 pm_registers = pch_pm_registers;
708 size = ARRAY_SIZE(pch_pm_registers);
709 break;
Warren Turkal3cf287d2010-09-03 09:36:37 +0000710 case PCI_DEVICE_ID_INTEL_ICH10R:
711 pmbase = pci_read_word(sb, 0x40) & 0xff80;
712 pm_registers = ich10_pm_registers;
713 size = ARRAY_SIZE(ich10_pm_registers);
714 break;
Stefan Reinauer23190272008-08-20 13:41:24 +0000715 case PCI_DEVICE_ID_INTEL_ICH7:
716 case PCI_DEVICE_ID_INTEL_ICH7M:
717 case PCI_DEVICE_ID_INTEL_ICH7DH:
718 case PCI_DEVICE_ID_INTEL_ICH7MDH:
Corey Osgoodf366ce02010-08-17 08:33:44 +0000719 case PCI_DEVICE_ID_INTEL_NM10:
Stefan Reinauer23190272008-08-20 13:41:24 +0000720 pmbase = pci_read_word(sb, 0x40) & 0xfffc;
Stefan Reinauer1162f252008-12-04 15:18:20 +0000721 pm_registers = ich7_pm_registers;
722 size = ARRAY_SIZE(ich7_pm_registers);
723 break;
Anton Kochkovda0b4562010-05-30 12:33:12 +0000724 case PCI_DEVICE_ID_INTEL_ICH9DH:
725 case PCI_DEVICE_ID_INTEL_ICH9DO:
726 case PCI_DEVICE_ID_INTEL_ICH9R:
727 case PCI_DEVICE_ID_INTEL_ICH9:
728 case PCI_DEVICE_ID_INTEL_ICH9M:
729 case PCI_DEVICE_ID_INTEL_ICH9ME:
730 pmbase = pci_read_word(sb, 0x40) & 0xfffc;
731 pm_registers = ich9_pm_registers;
732 size = ARRAY_SIZE(ich9_pm_registers);
733 break;
Corey Osgoodf366ce02010-08-17 08:33:44 +0000734 case PCI_DEVICE_ID_INTEL_ICH8:
Stefan Reinauer1162f252008-12-04 15:18:20 +0000735 case PCI_DEVICE_ID_INTEL_ICH8M:
Lubomir Rintel2a13bad2015-03-01 10:14:15 +0100736 case PCI_DEVICE_ID_INTEL_ICH8ME:
Stefan Reinauer1162f252008-12-04 15:18:20 +0000737 pmbase = pci_read_word(sb, 0x40) & 0xfffc;
738 pm_registers = ich8_pm_registers;
739 size = ARRAY_SIZE(ich8_pm_registers);
Stefan Reinauer23190272008-08-20 13:41:24 +0000740 break;
Pat Erleyca3548e2010-04-21 06:23:19 +0000741 case PCI_DEVICE_ID_INTEL_ICH6:
742 pmbase = pci_read_word(sb, 0x40) & 0xfffc;
743 pm_registers = ich6_pm_registers;
744 size = ARRAY_SIZE(ich6_pm_registers);
745 break;
Idwer Vollering312fc962010-12-17 22:34:58 +0000746 case PCI_DEVICE_ID_INTEL_ICH5:
747 pmbase = pci_read_word(sb, 0x40) & 0xfffc;
748 pm_registers = ich5_pm_registers;
749 size = ARRAY_SIZE(ich5_pm_registers);
750 break;
Stefan Reinauer04844812010-02-22 11:26:06 +0000751 case PCI_DEVICE_ID_INTEL_ICH4:
752 pmbase = pci_read_word(sb, 0x40) & 0xfffc;
753 pm_registers = ich4_pm_registers;
754 size = ARRAY_SIZE(ich4_pm_registers);
755 break;
Joseph Smithe10757e2010-06-16 22:21:19 +0000756 case PCI_DEVICE_ID_INTEL_ICH2:
757 pmbase = pci_read_word(sb, 0x40) & 0xfffc;
758 pm_registers = ich2_pm_registers;
759 size = ARRAY_SIZE(ich2_pm_registers);
760 break;
Stefan Reinauerb2aedb12009-08-29 15:45:43 +0000761 case PCI_DEVICE_ID_INTEL_ICH0:
762 pmbase = pci_read_word(sb, 0x40) & 0xfffc;
763 pm_registers = ich0_pm_registers;
764 size = ARRAY_SIZE(ich0_pm_registers);
765 break;
Maciej Pijanka90d17402009-09-30 17:05:46 +0000766 case PCI_DEVICE_ID_INTEL_82371XX:
Tobias Diedrich3645e612010-11-27 14:44:19 +0000767 acpi = pci_get_dev(pacc, sb->domain, sb->bus, sb->dev, 3);
768 if (!acpi) {
769 printf("Southbridge function 3 not found.\n");
770 return 1;
771 }
772 pmbase = pci_read_word(acpi, 0x40) & 0xfffc;
Maciej Pijanka90d17402009-09-30 17:05:46 +0000773 pm_registers = i82371xx_pm_registers;
774 size = ARRAY_SIZE(i82371xx_pm_registers);
775 break;
Sven Schnelle54a5aed2011-10-30 13:30:36 +0100776
777 case PCI_DEVICE_ID_INTEL_I63XX:
778 pmbase = pci_read_word(sb, 0x40) & 0xfffc;
779 pm_registers = i63xx_pm_registers;
780 size = ARRAY_SIZE(i63xx_pm_registers);
781 break;
782
Stefan Reinauer23190272008-08-20 13:41:24 +0000783 case 0x1234: // Dummy for non-existent functionality
784 printf("This southbridge does not have PMBASE.\n");
785 return 1;
786 default:
787 printf("Error: Dumping PMBASE on this southbridge is not (yet) supported.\n");
788 return 1;
789 }
790
791 printf("PMBASE = 0x%04x (IO)\n\n", pmbase);
792
Stefan Reinauer1162f252008-12-04 15:18:20 +0000793 for (i = 0; i < size; i++) {
794 switch (pm_registers[i].size) {
Nico Huberaa5eae62012-09-24 10:58:41 +0200795 case 8:
796 printf("pmbase+0x%04x: 0x%08x (%s)\n"
797 " 0x%08x\n",
798 pm_registers[i].addr,
799 inl(pmbase+pm_registers[i].addr),
800 pm_registers[i].name,
801 inl(pmbase+pm_registers[i].addr+4));
802 break;
Stefan Reinauer1162f252008-12-04 15:18:20 +0000803 case 4:
804 printf("pmbase+0x%04x: 0x%08x (%s)\n",
805 pm_registers[i].addr,
806 inl(pmbase+pm_registers[i].addr),
807 pm_registers[i].name);
808 break;
809 case 2:
810 printf("pmbase+0x%04x: 0x%04x (%s)\n",
811 pm_registers[i].addr,
812 inw(pmbase+pm_registers[i].addr),
813 pm_registers[i].name);
814 break;
815 case 1:
816 printf("pmbase+0x%04x: 0x%02x (%s)\n",
817 pm_registers[i].addr,
818 inb(pmbase+pm_registers[i].addr),
819 pm_registers[i].name);
820 break;
821 }
Stefan Reinauer23190272008-08-20 13:41:24 +0000822 }
823
824 return 0;
825}