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