zbao | 7d94cf9 | 2012-07-02 14:19:14 +0800 | [diff] [blame] | 1 | /* $NoKeywords:$ */ |
| 2 | /** |
| 3 | * @file |
| 4 | * |
| 5 | * Gnb fuse table |
| 6 | * |
| 7 | * |
| 8 | * |
| 9 | * @xrefitem bom "File Content Label" "Release Content" |
| 10 | * @e project: AGESA |
| 11 | * @e sub-project: GNB |
| 12 | * @e \$Revision: 63425 $ @e \$Date: 2011-12-22 11:24:10 -0600 (Thu, 22 Dec 2011) $ |
| 13 | * |
| 14 | */ |
| 15 | /* |
| 16 | ***************************************************************************** |
| 17 | * |
Siyuan Wang | 641f00c | 2013-06-08 11:50:55 +0800 | [diff] [blame] | 18 | * Copyright (c) 2008 - 2012, Advanced Micro Devices, Inc. |
| 19 | * All rights reserved. |
| 20 | * |
| 21 | * Redistribution and use in source and binary forms, with or without |
| 22 | * modification, are permitted provided that the following conditions are met: |
| 23 | * * Redistributions of source code must retain the above copyright |
| 24 | * notice, this list of conditions and the following disclaimer. |
| 25 | * * Redistributions in binary form must reproduce the above copyright |
| 26 | * notice, this list of conditions and the following disclaimer in the |
| 27 | * documentation and/or other materials provided with the distribution. |
| 28 | * * Neither the name of Advanced Micro Devices, Inc. nor the names of |
| 29 | * its contributors may be used to endorse or promote products derived |
| 30 | * from this software without specific prior written permission. |
| 31 | * |
| 32 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND |
| 33 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
| 34 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
| 35 | * DISCLAIMED. IN NO EVENT SHALL ADVANCED MICRO DEVICES, INC. BE LIABLE FOR ANY |
| 36 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
| 37 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
| 38 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND |
| 39 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 40 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
| 41 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
zbao | 7d94cf9 | 2012-07-02 14:19:14 +0800 | [diff] [blame] | 42 | * *************************************************************************** |
| 43 | * |
| 44 | */ |
| 45 | |
| 46 | /*---------------------------------------------------------------------------------------- |
| 47 | * M O D U L E S U S E D |
| 48 | *---------------------------------------------------------------------------------------- |
| 49 | */ |
| 50 | |
| 51 | #include "AGESA.h" |
| 52 | #include "Ids.h" |
| 53 | #include "amdlib.h" |
| 54 | #include "heapManager.h" |
| 55 | #include "Gnb.h" |
| 56 | #include "GnbGfxFamServices.h" |
| 57 | #include "GnbCommonLib.h" |
| 58 | #include "GnbFuseTable.h" |
| 59 | #include "GnbFuseTableTN.h" |
| 60 | #include "GnbRegistersTN.h" |
| 61 | #include "GnbRegisterAccTN.h" |
| 62 | #include "OptionGnb.h" |
| 63 | #include "Filecode.h" |
| 64 | #define FILECODE PROC_GNB_MODULES_GNBINITTN_GNBFUSETABLETN_FILECODE |
| 65 | /*---------------------------------------------------------------------------------------- |
| 66 | * D E F I N I T I O N S A N D M A C R O S |
| 67 | *---------------------------------------------------------------------------------------- |
| 68 | */ |
| 69 | |
| 70 | extern GNB_BUILD_OPTIONS GnbBuildOptions; |
| 71 | |
| 72 | /*---------------------------------------------------------------------------------------- |
| 73 | * T Y P E D E F S A N D S T R U C T U R E S |
| 74 | *---------------------------------------------------------------------------------------- |
| 75 | */ |
| 76 | |
| 77 | |
| 78 | |
| 79 | /*---------------------------------------------------------------------------------------- |
| 80 | * P R O T O T Y P E S O F L O C A L F U N C T I O N S |
| 81 | *---------------------------------------------------------------------------------------- |
| 82 | */ |
| 83 | |
| 84 | VOID |
| 85 | GnbFuseTableDebugDumpTN ( |
| 86 | IN PP_FUSE_ARRAY *PpFuseArray, |
| 87 | IN AMD_CONFIG_PARAMS *StdHeader |
| 88 | ); |
| 89 | |
| 90 | |
| 91 | |
| 92 | PP_FUSE_ARRAY ex907 = { |
| 93 | 0, // PP table revision |
| 94 | {1, 0, 0, 0, 0, 0}, // Valid DPM states |
| 95 | {0x40, 0, 0, 0, 0, 0}, // Sclk DPM DID |
| 96 | {0, 0, 0, 0, 0, 0}, // Sclk DPM VID |
| 97 | {0, 0, 0, 0, 0}, // Sclk DPM Cac |
| 98 | {1, 0, 0, 0, 0, 0}, // State policy flags |
| 99 | {2, 0, 0, 0, 0, 0}, // State policy label |
| 100 | {0x40, 0, 0, 0}, // VCLK DID |
| 101 | {0x40, 0, 0, 0}, // DCLK DID |
| 102 | 8, // Thermal SCLK |
| 103 | {0, 0, 0, 0, 0, 0}, // Vclk/Dclk selector |
| 104 | {0, 0, 0, 0}, // Valid Lclk DPM states |
| 105 | {0x40, 0x40, 0x40, 0}, // Lclk DPM DID |
| 106 | {0x40, 0x40, 0x40, 0}, // Lclk DPM VID |
| 107 | {0, 0, 0, 0}, // Displclk DID |
| 108 | 3, // Pcie Gen 2 VID |
| 109 | 0x10, // Main PLL id for 3200 VCO |
| 110 | 0, // WRCK SMU clock Divisor |
| 111 | {0x24, 0x24, 0x24, 0x24}, // SCLK VID |
| 112 | 0, // GPU boost cap |
| 113 | {0, 0, 0, 0, 0, 0}, // Sclk DPM TDP limit |
| 114 | 0, // TDP limit PG |
| 115 | 0, // Boost margin |
| 116 | 0, // Throttle margin |
| 117 | TRUE, // Support VCE in PP table |
| 118 | {0x3, 0xC, 0x30, 0xC0}, // VCE Flags |
| 119 | {0, 1, 0, 1}, // MCLK for VCE |
| 120 | {0, 0, 0, 0}, // SCLK selector for VCE |
| 121 | {0x40, 0x40, 0x40, 0x40} // Eclk DID |
| 122 | }; |
| 123 | |
| 124 | |
| 125 | FUSE_REGISTER_ENTRY_TN D0F0xBC_xE0104158_TABLE [] = { |
| 126 | { |
| 127 | D0F0xBC_xE0104158_EClkDid0_OFFSET, |
| 128 | D0F0xBC_xE0104158_EClkDid0_WIDTH, |
| 129 | (UINT16) offsetof (PP_FUSE_ARRAY, EclkDid[0]) |
| 130 | }, |
| 131 | { |
| 132 | D0F0xBC_xE0104158_EClkDid1_OFFSET, |
| 133 | D0F0xBC_xE0104158_EClkDid1_WIDTH, |
| 134 | (UINT16) offsetof (PP_FUSE_ARRAY, EclkDid[1]) |
| 135 | }, |
| 136 | { |
| 137 | D0F0xBC_xE0104158_EClkDid2_OFFSET, |
| 138 | D0F0xBC_xE0104158_EClkDid2_WIDTH, |
| 139 | (UINT16) offsetof (PP_FUSE_ARRAY, EclkDid[2]) |
| 140 | } |
| 141 | }; |
| 142 | |
| 143 | FUSE_REGISTER_ENTRY_TN D0F0xBC_xE010415B_TABLE [] = { |
| 144 | { |
| 145 | D0F0xBC_xE010415B_EClkDid3_OFFSET, |
| 146 | D0F0xBC_xE010415B_EClkDid3_WIDTH, |
| 147 | (UINT16) offsetof (PP_FUSE_ARRAY, EclkDid[3]) |
| 148 | } |
| 149 | }; |
| 150 | |
| 151 | FUSE_REGISTER_ENTRY_TN D0F0xBC_xE0104184_TABLE [] = { |
| 152 | { |
| 153 | D0F0xBC_xE0104184_VCEFlag0_OFFSET, |
| 154 | D0F0xBC_xE0104184_VCEFlag0_WIDTH, |
| 155 | (UINT16) offsetof (PP_FUSE_ARRAY, VceFlags[0]) |
| 156 | }, |
| 157 | { |
| 158 | D0F0xBC_xE0104184_VCEFlag1_OFFSET, |
| 159 | D0F0xBC_xE0104184_VCEFlag1_WIDTH, |
| 160 | (UINT16) offsetof (PP_FUSE_ARRAY, VceFlags[1]) |
| 161 | } |
| 162 | }; |
| 163 | |
| 164 | FUSE_REGISTER_ENTRY_TN D0F0xBC_xE0104187_TABLE [] = { |
| 165 | { |
| 166 | D0F0xBC_xE0104187_VCEFlag2_OFFSET, |
| 167 | D0F0xBC_xE0104187_VCEFlag2_WIDTH, |
| 168 | (UINT16) offsetof (PP_FUSE_ARRAY, VceFlags[2]) |
| 169 | } |
| 170 | }; |
| 171 | |
| 172 | FUSE_REGISTER_ENTRY_TN D0F0xBC_xE0104188_TABLE [] = { |
| 173 | { |
| 174 | D0F0xBC_xE0104188_VCEFlag3_OFFSET, |
| 175 | D0F0xBC_xE0104188_VCEFlag3_WIDTH, |
| 176 | (UINT16) offsetof (PP_FUSE_ARRAY, VceFlags[3]) |
| 177 | }, |
| 178 | { |
| 179 | D0F0xBC_xE0104188_ReqSclkSel0_OFFSET, |
| 180 | D0F0xBC_xE0104188_ReqSclkSel0_WIDTH, |
| 181 | (UINT16) offsetof (PP_FUSE_ARRAY, VceReqSclkSel[0]) |
| 182 | }, |
| 183 | { |
| 184 | D0F0xBC_xE0104188_ReqSclkSel1_OFFSET, |
| 185 | D0F0xBC_xE0104188_ReqSclkSel1_WIDTH, |
| 186 | (UINT16) offsetof (PP_FUSE_ARRAY, VceReqSclkSel[1]) |
| 187 | }, |
| 188 | { |
| 189 | D0F0xBC_xE0104188_ReqSclkSel2_OFFSET, |
| 190 | D0F0xBC_xE0104188_ReqSclkSel2_WIDTH, |
| 191 | (UINT16) offsetof (PP_FUSE_ARRAY, VceReqSclkSel[2]) |
| 192 | }, |
| 193 | { |
| 194 | D0F0xBC_xE0104188_ReqSclkSel3_OFFSET, |
| 195 | D0F0xBC_xE0104188_ReqSclkSel3_WIDTH, |
| 196 | (UINT16) offsetof (PP_FUSE_ARRAY, VceReqSclkSel[3]) |
| 197 | }, |
| 198 | { |
| 199 | D0F0xBC_xE0104188_VCEMclk_OFFSET + 0, |
| 200 | 1, |
| 201 | (UINT16) offsetof (PP_FUSE_ARRAY, VceMclk[0]) |
| 202 | }, |
| 203 | { |
| 204 | D0F0xBC_xE0104188_VCEMclk_OFFSET + 1, |
| 205 | 1, |
| 206 | (UINT16) offsetof (PP_FUSE_ARRAY, VceMclk[1]) |
| 207 | }, |
| 208 | { |
| 209 | D0F0xBC_xE0104188_VCEMclk_OFFSET + 2, |
| 210 | 1, |
| 211 | (UINT16) offsetof (PP_FUSE_ARRAY, VceMclk[2]) |
| 212 | }, |
| 213 | { |
| 214 | D0F0xBC_xE0104188_VCEMclk_OFFSET + 3, |
| 215 | 1, |
| 216 | (UINT16) offsetof (PP_FUSE_ARRAY, VceMclk[3]) |
| 217 | }, |
| 218 | }; |
| 219 | |
| 220 | FUSE_REGISTER_ENTRY_TN D0F0xBC_xE0106020_TABLE [] = { |
| 221 | { |
| 222 | D0F0xBC_xE0106020_PowerplayDClkVClkSel0_OFFSET, |
| 223 | D0F0xBC_xE0106020_PowerplayDClkVClkSel0_WIDTH, |
| 224 | (UINT16) offsetof (PP_FUSE_ARRAY, VclkDclkSel[0]) |
| 225 | }, |
| 226 | { |
| 227 | D0F0xBC_xE0106020_PowerplayDClkVClkSel1_OFFSET, |
| 228 | D0F0xBC_xE0106020_PowerplayDClkVClkSel1_WIDTH, |
| 229 | (UINT16) offsetof (PP_FUSE_ARRAY, VclkDclkSel[1]) |
| 230 | }, |
| 231 | { |
| 232 | D0F0xBC_xE0106020_PowerplayDClkVClkSel2_OFFSET, |
| 233 | D0F0xBC_xE0106020_PowerplayDClkVClkSel2_WIDTH, |
| 234 | (UINT16) offsetof (PP_FUSE_ARRAY, VclkDclkSel[2]) |
| 235 | } |
| 236 | }; |
| 237 | |
| 238 | FUSE_REGISTER_ENTRY_TN D0F0xBC_xE0106023_TABLE [] = { |
| 239 | { |
| 240 | D0F0xBC_xE0106023_PowerplayDClkVClkSel3_OFFSET, |
| 241 | D0F0xBC_xE0106023_PowerplayDClkVClkSel3_WIDTH, |
| 242 | (UINT16) offsetof (PP_FUSE_ARRAY, VclkDclkSel[3]) |
| 243 | } |
| 244 | }; |
| 245 | |
| 246 | FUSE_REGISTER_ENTRY_TN D0F0xBC_xE0106024_TABLE [] = { |
| 247 | { |
| 248 | D0F0xBC_xE0106024_PowerplayDClkVClkSel4_OFFSET, |
| 249 | D0F0xBC_xE0106024_PowerplayDClkVClkSel4_WIDTH, |
| 250 | (UINT16) offsetof (PP_FUSE_ARRAY, VclkDclkSel[4]) |
| 251 | }, |
| 252 | { |
| 253 | D0F0xBC_xE0106024_PowerplayDClkVClkSel5_OFFSET, |
| 254 | D0F0xBC_xE0106024_PowerplayDClkVClkSel5_WIDTH, |
| 255 | (UINT16) offsetof (PP_FUSE_ARRAY, VclkDclkSel[5]) |
| 256 | } |
| 257 | }; |
| 258 | |
| 259 | FUSE_REGISTER_ENTRY_TN D0F0xBC_xE010705C_TABLE [] = { |
| 260 | { |
| 261 | D0F0xBC_xE010705C_PowerplayTableRev_OFFSET, |
| 262 | D0F0xBC_xE010705C_PowerplayTableRev_WIDTH, |
| 263 | (UINT16) offsetof (PP_FUSE_ARRAY, PPlayTableRev) |
| 264 | }, |
| 265 | { |
| 266 | D0F0xBC_xE010705C_SClkThermDid_OFFSET, |
| 267 | D0F0xBC_xE010705C_SClkThermDid_WIDTH, |
| 268 | (UINT16) offsetof (PP_FUSE_ARRAY, SclkThermDid) |
| 269 | }, |
| 270 | { |
| 271 | D0F0xBC_xE010705C_PcieGen2Vid_OFFSET, |
| 272 | D0F0xBC_xE010705C_PcieGen2Vid_WIDTH, |
| 273 | (UINT16) offsetof (PP_FUSE_ARRAY, PcieGen2Vid) |
| 274 | } |
| 275 | }; |
| 276 | FUSE_REGISTER_ENTRY_TN D0F0xBC_xE010705F_TABLE [] = { |
| 277 | { |
| 278 | D0F0xBC_xE010705F_SClkDpmVid0_OFFSET, |
| 279 | D0F0xBC_xE010705F_SClkDpmVid0_WIDTH, |
| 280 | (UINT16) offsetof (PP_FUSE_ARRAY, SclkDpmVid[0]) |
| 281 | }, |
| 282 | { |
| 283 | D0F0xBC_xE010705F_SClkDpmVid0_OFFSET, |
| 284 | D0F0xBC_xE010705F_SClkDpmVid0_WIDTH, |
| 285 | (UINT16) offsetof (PP_FUSE_ARRAY, LclkDpmVid[0]) |
| 286 | } |
| 287 | }; |
| 288 | |
| 289 | FUSE_REGISTER_ENTRY_TN D0F0xBC_xE0107060_TABLE [] = { |
| 290 | { |
| 291 | D0F0xBC_xE0107060_SClkDpmVid1_OFFSET, |
| 292 | D0F0xBC_xE0107060_SClkDpmVid1_WIDTH, |
| 293 | (UINT16) offsetof (PP_FUSE_ARRAY, SclkDpmVid[1]) |
| 294 | }, |
| 295 | { |
| 296 | D0F0xBC_xE0107060_SClkDpmVid1_OFFSET, |
| 297 | D0F0xBC_xE0107060_SClkDpmVid1_WIDTH, |
| 298 | (UINT16) offsetof (PP_FUSE_ARRAY, LclkDpmVid[1]) |
| 299 | }, |
| 300 | { |
| 301 | D0F0xBC_xE0107060_SClkDpmVid2_OFFSET, |
| 302 | D0F0xBC_xE0107060_SClkDpmVid2_WIDTH, |
| 303 | (UINT16) offsetof (PP_FUSE_ARRAY, SclkDpmVid[2]) |
| 304 | }, |
| 305 | { |
| 306 | D0F0xBC_xE0107060_SClkDpmVid2_OFFSET, |
| 307 | D0F0xBC_xE0107060_SClkDpmVid2_WIDTH, |
| 308 | (UINT16) offsetof (PP_FUSE_ARRAY, LclkDpmVid[2]) |
| 309 | }, |
| 310 | { |
| 311 | D0F0xBC_xE0107060_SClkDpmVid3_OFFSET, |
| 312 | D0F0xBC_xE0107060_SClkDpmVid3_WIDTH, |
| 313 | (UINT16) offsetof (PP_FUSE_ARRAY, SclkDpmVid[3]) |
| 314 | }, |
| 315 | { |
| 316 | D0F0xBC_xE0107060_SClkDpmVid4_OFFSET, |
| 317 | D0F0xBC_xE0107060_SClkDpmVid4_WIDTH, |
| 318 | (UINT16) offsetof (PP_FUSE_ARRAY, SclkDpmVid[4]) |
| 319 | }, |
| 320 | { |
| 321 | D0F0xBC_xE0107060_SClkDpmDid0_OFFSET, |
| 322 | D0F0xBC_xE0107060_SClkDpmDid0_WIDTH, |
| 323 | (UINT16) offsetof (PP_FUSE_ARRAY, SclkDpmDid[0]) |
| 324 | }, |
| 325 | { |
| 326 | D0F0xBC_xE0107060_SClkDpmDid1_OFFSET, |
| 327 | D0F0xBC_xE0107060_SClkDpmDid1_WIDTH, |
| 328 | (UINT16) offsetof (PP_FUSE_ARRAY, SclkDpmDid[1]) |
| 329 | }, |
| 330 | { |
| 331 | D0F0xBC_xE0107060_SClkDpmDid2_OFFSET, |
| 332 | D0F0xBC_xE0107060_SClkDpmDid2_WIDTH, |
| 333 | (UINT16) offsetof (PP_FUSE_ARRAY, SclkDpmDid[2]) |
| 334 | } |
| 335 | }; |
| 336 | |
| 337 | FUSE_REGISTER_ENTRY_TN D0F0xBC_xE0107063_TABLE [] = { |
| 338 | { |
| 339 | D0F0xBC_xE0107063_SClkDpmDid3_OFFSET, |
| 340 | D0F0xBC_xE0107063_SClkDpmDid3_WIDTH, |
| 341 | (UINT16) offsetof (PP_FUSE_ARRAY, SclkDpmDid[3]) |
| 342 | } |
| 343 | }; |
| 344 | |
| 345 | FUSE_REGISTER_ENTRY_TN D0F0xBC_xE0107064_TABLE [] = { |
| 346 | { |
| 347 | D0F0xBC_xE0107064_SClkDpmDid4_OFFSET, |
| 348 | D0F0xBC_xE0107064_SClkDpmDid4_WIDTH, |
| 349 | (UINT16) offsetof (PP_FUSE_ARRAY, SclkDpmDid[4]) |
| 350 | } |
| 351 | }; |
| 352 | |
| 353 | FUSE_REGISTER_ENTRY_TN D0F0xBC_xE0107067_TABLE [] = { |
| 354 | { |
| 355 | D0F0xBC_xE0107067_DispClkDid0_OFFSET, |
| 356 | D0F0xBC_xE0107067_DispClkDid0_WIDTH, |
| 357 | (UINT16) offsetof (PP_FUSE_ARRAY, DisplclkDid[0]) |
| 358 | } |
| 359 | }; |
| 360 | |
| 361 | FUSE_REGISTER_ENTRY_TN D0F0xBC_xE0107068_TABLE [] = { |
| 362 | { |
| 363 | D0F0xBC_xE0107068_DispClkDid1_OFFSET, |
| 364 | D0F0xBC_xE0107068_DispClkDid1_WIDTH, |
| 365 | (UINT16) offsetof (PP_FUSE_ARRAY, DisplclkDid[1]) |
| 366 | }, |
| 367 | { |
| 368 | D0F0xBC_xE0107068_DispClkDid2_OFFSET, |
| 369 | D0F0xBC_xE0107068_DispClkDid2_WIDTH, |
| 370 | (UINT16) offsetof (PP_FUSE_ARRAY, DisplclkDid[2]) |
| 371 | }, |
| 372 | { |
| 373 | D0F0xBC_xE0107068_DispClkDid3_OFFSET, |
| 374 | D0F0xBC_xE0107068_DispClkDid3_WIDTH, |
| 375 | (UINT16) offsetof (PP_FUSE_ARRAY, DisplclkDid[3]) |
| 376 | }, |
| 377 | { |
| 378 | D0F0xBC_xE0107068_LClkDpmDid0_OFFSET, |
| 379 | D0F0xBC_xE0107068_LClkDpmDid0_WIDTH, |
| 380 | (UINT16) offsetof (PP_FUSE_ARRAY, LclkDpmDid[0]) |
| 381 | } |
| 382 | }; |
| 383 | |
| 384 | FUSE_REGISTER_ENTRY_TN D0F0xBC_xE010706B_TABLE [] = { |
| 385 | { |
| 386 | D0F0xBC_xE010706B_LClkDpmDid1_OFFSET, |
| 387 | D0F0xBC_xE010706B_LClkDpmDid1_WIDTH, |
| 388 | (UINT16) offsetof (PP_FUSE_ARRAY, LclkDpmDid[1]) |
| 389 | } |
| 390 | }; |
| 391 | |
| 392 | FUSE_REGISTER_ENTRY_TN D0F0xBC_xE010706C_TABLE [] = { |
| 393 | { |
| 394 | D0F0xBC_xE010706C_LClkDpmDid2_OFFSET, |
| 395 | D0F0xBC_xE010706C_LClkDpmDid2_WIDTH, |
| 396 | (UINT16) offsetof (PP_FUSE_ARRAY, LclkDpmDid[2]) |
| 397 | }, |
| 398 | { |
| 399 | D0F0xBC_xE010706C_LClkDpmDid3_OFFSET, |
| 400 | D0F0xBC_xE010706C_LClkDpmDid3_WIDTH, |
| 401 | (UINT16) offsetof (PP_FUSE_ARRAY, LclkDpmDid[3]) |
| 402 | }, |
| 403 | { |
| 404 | D0F0xBC_xE010706C_LClkDpmValid_OFFSET + 0, |
| 405 | 1, |
| 406 | (UINT16) offsetof (PP_FUSE_ARRAY, LclkDpmValid[0]) |
| 407 | }, |
| 408 | { |
| 409 | D0F0xBC_xE010706C_LClkDpmValid_OFFSET + 1, |
| 410 | 1, |
| 411 | (UINT16) offsetof (PP_FUSE_ARRAY, LclkDpmValid[1]) |
| 412 | }, |
| 413 | { |
| 414 | D0F0xBC_xE010706C_LClkDpmValid_OFFSET + 2, |
| 415 | 1, |
| 416 | (UINT16) offsetof (PP_FUSE_ARRAY, LclkDpmValid[2]) |
| 417 | }, |
| 418 | { |
| 419 | D0F0xBC_xE010706C_LClkDpmValid_OFFSET + 3, |
| 420 | 1, |
| 421 | (UINT16) offsetof (PP_FUSE_ARRAY, LclkDpmValid[3]) |
| 422 | }, |
| 423 | { |
| 424 | D0F0xBC_xE010706C_DClkDid0_OFFSET, |
| 425 | D0F0xBC_xE010706C_DClkDid0_WIDTH, |
| 426 | (UINT16) offsetof (PP_FUSE_ARRAY, DclkDid[0]) |
| 427 | } |
| 428 | }; |
| 429 | |
| 430 | FUSE_REGISTER_ENTRY_TN D0F0xBC_xE010706F_TABLE [] = { |
| 431 | { |
| 432 | D0F0xBC_xE010706F_DClkDid1_OFFSET, |
| 433 | D0F0xBC_xE010706F_DClkDid1_WIDTH, |
| 434 | (UINT16) offsetof (PP_FUSE_ARRAY, DclkDid[1]) |
| 435 | } |
| 436 | }; |
| 437 | |
| 438 | FUSE_REGISTER_ENTRY_TN D0F0xBC_xE0107070_TABLE [] = { |
| 439 | { |
| 440 | D0F0xBC_xE0107070_DClkDid2_OFFSET, |
| 441 | D0F0xBC_xE0107070_DClkDid2_WIDTH, |
| 442 | (UINT16) offsetof (PP_FUSE_ARRAY, DclkDid[2]) |
| 443 | }, |
| 444 | { |
| 445 | D0F0xBC_xE0107070_DClkDid3_OFFSET, |
| 446 | D0F0xBC_xE0107070_DClkDid3_WIDTH, |
| 447 | (UINT16) offsetof (PP_FUSE_ARRAY, DclkDid[3]) |
| 448 | }, |
| 449 | { |
| 450 | D0F0xBC_xE0107070_VClkDid0_OFFSET, |
| 451 | D0F0xBC_xE0107070_VClkDid0_WIDTH, |
| 452 | (UINT16) offsetof (PP_FUSE_ARRAY, VclkDid[0]) |
| 453 | } |
| 454 | }; |
| 455 | |
| 456 | FUSE_REGISTER_ENTRY_TN D0F0xBC_xE0107073_TABLE [] = { |
| 457 | { |
| 458 | D0F0xBC_xE0107073_VClkDid1_OFFSET, |
| 459 | D0F0xBC_xE0107073_VClkDid1_WIDTH, |
| 460 | (UINT16) offsetof (PP_FUSE_ARRAY, VclkDid[1]) |
| 461 | }, |
| 462 | }; |
| 463 | |
| 464 | FUSE_REGISTER_ENTRY_TN D0F0xBC_xE0107074_TABLE [] = { |
| 465 | { |
| 466 | D0F0xBC_xE0107074_VClkDid2_OFFSET, |
| 467 | D0F0xBC_xE0107074_VClkDid2_WIDTH, |
| 468 | (UINT16) offsetof (PP_FUSE_ARRAY, VclkDid[2]) |
| 469 | }, |
| 470 | { |
| 471 | D0F0xBC_xE0107074_VClkDid3_OFFSET, |
| 472 | D0F0xBC_xE0107074_VClkDid3_WIDTH, |
| 473 | (UINT16) offsetof (PP_FUSE_ARRAY, VclkDid[3]) |
| 474 | }, |
| 475 | { |
| 476 | D0F0xBC_xE0107074_PowerplaySclkDpmValid0_OFFSET, |
| 477 | D0F0xBC_xE0107074_PowerplaySclkDpmValid0_WIDTH, |
| 478 | (UINT16) offsetof (PP_FUSE_ARRAY, SclkDpmValid[0]) |
| 479 | }, |
| 480 | { |
| 481 | D0F0xBC_xE0107074_PowerplaySclkDpmValid1_OFFSET, |
| 482 | D0F0xBC_xE0107074_PowerplaySclkDpmValid1_WIDTH, |
| 483 | (UINT16) offsetof (PP_FUSE_ARRAY, SclkDpmValid[1]) |
| 484 | }, |
| 485 | { |
| 486 | D0F0xBC_xE0107074_PowerplaySclkDpmValid2_OFFSET, |
| 487 | D0F0xBC_xE0107074_PowerplaySclkDpmValid2_WIDTH, |
| 488 | (UINT16) offsetof (PP_FUSE_ARRAY, SclkDpmValid[2]) |
| 489 | } |
| 490 | }; |
| 491 | |
| 492 | FUSE_REGISTER_ENTRY_TN D0F0xBC_xE0107077_TABLE [] = { |
| 493 | { |
| 494 | D0F0xBC_xE0107077_PowerplaySclkDpmValid3_OFFSET, |
| 495 | D0F0xBC_xE0107077_PowerplaySclkDpmValid3_WIDTH, |
| 496 | (UINT16) offsetof (PP_FUSE_ARRAY, SclkDpmValid[3]) |
| 497 | } |
| 498 | }; |
| 499 | |
| 500 | FUSE_REGISTER_ENTRY_TN D0F0xBC_xE0107078_TABLE [] = { |
| 501 | { |
| 502 | D0F0xBC_xE0107078_PowerplaySclkDpmValid4_OFFSET, |
| 503 | D0F0xBC_xE0107078_PowerplaySclkDpmValid4_WIDTH, |
| 504 | (UINT16) offsetof (PP_FUSE_ARRAY, SclkDpmValid[4]) |
| 505 | }, |
| 506 | { |
| 507 | D0F0xBC_xE0107078_PowerplaySclkDpmValid5_OFFSET, |
| 508 | D0F0xBC_xE0107078_PowerplaySclkDpmValid5_WIDTH, |
| 509 | (UINT16) offsetof (PP_FUSE_ARRAY, SclkDpmValid[5]) |
| 510 | }, |
| 511 | { |
| 512 | D0F0xBC_xE0107078_PowerplayPolicyLabel0_OFFSET, |
| 513 | D0F0xBC_xE0107078_PowerplayPolicyLabel0_WIDTH, |
| 514 | (UINT16) offsetof (PP_FUSE_ARRAY, PolicyLabel[0]) |
| 515 | }, |
| 516 | { |
| 517 | D0F0xBC_xE0107078_PowerplayPolicyLabel1_OFFSET, |
| 518 | D0F0xBC_xE0107078_PowerplayPolicyLabel1_WIDTH, |
| 519 | (UINT16) offsetof (PP_FUSE_ARRAY, PolicyLabel[1]) |
| 520 | }, |
| 521 | { |
| 522 | D0F0xBC_xE0107078_PowerplayPolicyLabel2_OFFSET, |
| 523 | D0F0xBC_xE0107078_PowerplayPolicyLabel2_WIDTH, |
| 524 | (UINT16) offsetof (PP_FUSE_ARRAY, PolicyLabel[2]) |
| 525 | }, |
| 526 | { |
| 527 | D0F0xBC_xE0107078_PowerplayPolicyLabel3_OFFSET, |
| 528 | D0F0xBC_xE0107078_PowerplayPolicyLabel3_WIDTH, |
| 529 | (UINT16) offsetof (PP_FUSE_ARRAY, PolicyLabel[3]) |
| 530 | }, |
| 531 | { |
| 532 | D0F0xBC_xE0107078_PowerplayPolicyLabel4_OFFSET, |
| 533 | D0F0xBC_xE0107078_PowerplayPolicyLabel4_WIDTH, |
| 534 | (UINT16) offsetof (PP_FUSE_ARRAY, PolicyLabel[4]) |
| 535 | }, |
| 536 | { |
| 537 | D0F0xBC_xE0107078_PowerplayPolicyLabel5_OFFSET, |
| 538 | D0F0xBC_xE0107078_PowerplayPolicyLabel5_WIDTH, |
| 539 | (UINT16) offsetof (PP_FUSE_ARRAY, PolicyLabel[5]) |
| 540 | } |
| 541 | }; |
| 542 | |
| 543 | FUSE_REGISTER_ENTRY_TN D0F0xBC_xE010707B_TABLE [] = { |
| 544 | { |
| 545 | D0F0xBC_xE010707B_PowerplayStateFlag0_OFFSET, |
| 546 | D0F0xBC_xE010707B_PowerplayStateFlag0_WIDTH, |
| 547 | (UINT16) offsetof (PP_FUSE_ARRAY, PolicyFlags[0]) |
| 548 | } |
| 549 | }; |
| 550 | |
| 551 | FUSE_REGISTER_ENTRY_TN D0F0xBC_xE010707C_TABLE [] = { |
| 552 | { |
| 553 | D0F0xBC_xE010707C_PowerplayStateFlag1_OFFSET, |
| 554 | D0F0xBC_xE010707C_PowerplayStateFlag1_WIDTH, |
| 555 | (UINT16) offsetof (PP_FUSE_ARRAY, PolicyFlags[1]) |
| 556 | }, |
| 557 | { |
| 558 | D0F0xBC_xE010707C_PowerplayStateFlag2_OFFSET, |
| 559 | D0F0xBC_xE010707C_PowerplayStateFlag2_WIDTH, |
| 560 | (UINT16) offsetof (PP_FUSE_ARRAY, PolicyFlags[2]) |
| 561 | }, |
| 562 | { |
| 563 | D0F0xBC_xE010707C_PowerplayStateFlag3_OFFSET, |
| 564 | D0F0xBC_xE010707C_PowerplayStateFlag3_WIDTH, |
| 565 | (UINT16) offsetof (PP_FUSE_ARRAY, PolicyFlags[3]) |
| 566 | }, |
| 567 | { |
| 568 | D0F0xBC_xE010707C_PowerplayStateFlag4_OFFSET, |
| 569 | D0F0xBC_xE010707C_PowerplayStateFlag4_WIDTH, |
| 570 | (UINT16) offsetof (PP_FUSE_ARRAY, PolicyFlags[4]) |
| 571 | } |
| 572 | }; |
| 573 | |
| 574 | FUSE_REGISTER_ENTRY_TN D0F0xBC_xE010707F_TABLE [] = { |
| 575 | { |
| 576 | D0F0xBC_xE010707F_PowerplayStateFlag5_OFFSET, |
| 577 | D0F0xBC_xE010707F_PowerplayStateFlag5_WIDTH, |
| 578 | (UINT16) offsetof (PP_FUSE_ARRAY, PolicyFlags[5]) |
| 579 | } |
| 580 | }; |
| 581 | |
| 582 | FUSE_REGISTER_ENTRY_TN D0F0xBC_xFF000000_TABLE [] = { |
| 583 | { |
| 584 | D0F0xBC_xFF000000_MainPllOpFreqIdStartup_OFFSET, |
| 585 | D0F0xBC_xFF000000_MainPllOpFreqIdStartup_WIDTH, |
| 586 | (UINT16) offsetof (PP_FUSE_ARRAY, MainPllId) |
| 587 | } |
| 588 | }; |
| 589 | |
| 590 | FUSE_REGISTER_ENTRY_TN D0F0xBC_xE0001008_TABLE [] = { |
| 591 | { |
| 592 | D0F0xBC_xE0001008_SClkVid0_OFFSET, |
| 593 | D0F0xBC_xE0001008_SClkVid0_WIDTH, |
| 594 | (UINT16) offsetof (PP_FUSE_ARRAY, SclkVid[0]) |
| 595 | }, |
| 596 | { |
| 597 | D0F0xBC_xE0001008_SClkVid1_OFFSET, |
| 598 | D0F0xBC_xE0001008_SClkVid1_WIDTH, |
| 599 | (UINT16) offsetof (PP_FUSE_ARRAY, SclkVid[1]) |
| 600 | }, |
| 601 | { |
| 602 | D0F0xBC_xE0001008_SClkVid2_OFFSET, |
| 603 | D0F0xBC_xE0001008_SClkVid2_WIDTH, |
| 604 | (UINT16) offsetof (PP_FUSE_ARRAY, SclkVid[2]) |
| 605 | }, |
| 606 | { |
| 607 | D0F0xBC_xE0001008_SClkVid3_OFFSET, |
| 608 | D0F0xBC_xE0001008_SClkVid3_WIDTH, |
| 609 | (UINT16) offsetof (PP_FUSE_ARRAY, SclkVid[3]) |
| 610 | } |
| 611 | }; |
| 612 | |
| 613 | |
| 614 | FUSE_TABLE_ENTRY_TN FuseRegisterTableTN [] = { |
| 615 | { |
| 616 | D0F0xBC_xE0104158_TYPE, |
| 617 | D0F0xBC_xE0104158_ADDRESS, |
| 618 | sizeof (D0F0xBC_xE0104158_TABLE) / sizeof (FUSE_REGISTER_ENTRY_TN), |
| 619 | D0F0xBC_xE0104158_TABLE |
| 620 | }, |
| 621 | { |
| 622 | D0F0xBC_xE010415B_TYPE, |
| 623 | D0F0xBC_xE010415B_ADDRESS, |
| 624 | sizeof (D0F0xBC_xE010415B_TABLE) / sizeof (FUSE_REGISTER_ENTRY_TN), |
| 625 | D0F0xBC_xE010415B_TABLE |
| 626 | }, |
| 627 | { |
| 628 | D0F0xBC_xE0104184_TYPE, |
| 629 | D0F0xBC_xE0104184_ADDRESS, |
| 630 | sizeof (D0F0xBC_xE0104184_TABLE) / sizeof (FUSE_REGISTER_ENTRY_TN), |
| 631 | D0F0xBC_xE0104184_TABLE |
| 632 | }, |
| 633 | { |
| 634 | D0F0xBC_xE0104187_TYPE, |
| 635 | D0F0xBC_xE0104187_ADDRESS, |
| 636 | sizeof (D0F0xBC_xE0104187_TABLE) / sizeof (FUSE_REGISTER_ENTRY_TN), |
| 637 | D0F0xBC_xE0104187_TABLE |
| 638 | }, |
| 639 | { |
| 640 | D0F0xBC_xE0104188_TYPE, |
| 641 | D0F0xBC_xE0104188_ADDRESS, |
| 642 | sizeof (D0F0xBC_xE0104188_TABLE) / sizeof (FUSE_REGISTER_ENTRY_TN), |
| 643 | D0F0xBC_xE0104188_TABLE |
| 644 | }, |
| 645 | { |
| 646 | D0F0xBC_xE0106020_TYPE, |
| 647 | D0F0xBC_xE0106020_ADDRESS, |
| 648 | sizeof (D0F0xBC_xE0106020_TABLE) / sizeof (FUSE_REGISTER_ENTRY_TN), |
| 649 | D0F0xBC_xE0106020_TABLE |
| 650 | }, |
| 651 | { |
| 652 | D0F0xBC_xE0106023_TYPE, |
| 653 | D0F0xBC_xE0106023_ADDRESS, |
| 654 | sizeof (D0F0xBC_xE0106023_TABLE) / sizeof (FUSE_REGISTER_ENTRY_TN), |
| 655 | D0F0xBC_xE0106023_TABLE |
| 656 | }, |
| 657 | { |
| 658 | D0F0xBC_xE0106024_TYPE, |
| 659 | D0F0xBC_xE0106024_ADDRESS, |
| 660 | sizeof (D0F0xBC_xE0106024_TABLE) / sizeof (FUSE_REGISTER_ENTRY_TN), |
| 661 | D0F0xBC_xE0106024_TABLE |
| 662 | }, |
| 663 | { |
| 664 | D0F0xBC_xE010705C_TYPE, |
| 665 | D0F0xBC_xE010705C_ADDRESS, |
| 666 | sizeof (D0F0xBC_xE010705C_TABLE) / sizeof (FUSE_REGISTER_ENTRY_TN), |
| 667 | D0F0xBC_xE010705C_TABLE |
| 668 | }, |
| 669 | { |
| 670 | D0F0xBC_xE010705F_TYPE, |
| 671 | D0F0xBC_xE010705F_ADDRESS, |
| 672 | sizeof (D0F0xBC_xE010705F_TABLE) / sizeof (FUSE_REGISTER_ENTRY_TN), |
| 673 | D0F0xBC_xE010705F_TABLE |
| 674 | }, |
| 675 | { |
| 676 | D0F0xBC_xE0107060_TYPE, |
| 677 | D0F0xBC_xE0107060_ADDRESS, |
| 678 | sizeof (D0F0xBC_xE0107060_TABLE) / sizeof (FUSE_REGISTER_ENTRY_TN), |
| 679 | D0F0xBC_xE0107060_TABLE |
| 680 | }, |
| 681 | { |
| 682 | D0F0xBC_xE0107063_TYPE, |
| 683 | D0F0xBC_xE0107063_ADDRESS, |
| 684 | sizeof (D0F0xBC_xE0107063_TABLE) / sizeof (FUSE_REGISTER_ENTRY_TN), |
| 685 | D0F0xBC_xE0107063_TABLE |
| 686 | }, |
| 687 | { |
| 688 | D0F0xBC_xE0107064_TYPE, |
| 689 | D0F0xBC_xE0107064_ADDRESS, |
| 690 | sizeof (D0F0xBC_xE0107064_TABLE) / sizeof (FUSE_REGISTER_ENTRY_TN), |
| 691 | D0F0xBC_xE0107064_TABLE |
| 692 | }, |
| 693 | { |
| 694 | D0F0xBC_xE0107067_TYPE, |
| 695 | D0F0xBC_xE0107067_ADDRESS, |
| 696 | sizeof (D0F0xBC_xE0107067_TABLE) / sizeof (FUSE_REGISTER_ENTRY_TN), |
| 697 | D0F0xBC_xE0107067_TABLE |
| 698 | }, |
| 699 | { |
| 700 | D0F0xBC_xE0107068_TYPE, |
| 701 | D0F0xBC_xE0107068_ADDRESS, |
| 702 | sizeof (D0F0xBC_xE0107068_TABLE) / sizeof (FUSE_REGISTER_ENTRY_TN), |
| 703 | D0F0xBC_xE0107068_TABLE |
| 704 | }, |
| 705 | { |
| 706 | D0F0xBC_xE010706B_TYPE, |
| 707 | D0F0xBC_xE010706B_ADDRESS, |
| 708 | sizeof (D0F0xBC_xE010706B_TABLE) / sizeof (FUSE_REGISTER_ENTRY_TN), |
| 709 | D0F0xBC_xE010706B_TABLE |
| 710 | }, |
| 711 | { |
| 712 | D0F0xBC_xE010706C_TYPE, |
| 713 | D0F0xBC_xE010706C_ADDRESS, |
| 714 | sizeof (D0F0xBC_xE010706C_TABLE) / sizeof (FUSE_REGISTER_ENTRY_TN), |
| 715 | D0F0xBC_xE010706C_TABLE |
| 716 | }, |
| 717 | { |
| 718 | D0F0xBC_xE010706F_TYPE, |
| 719 | D0F0xBC_xE010706F_ADDRESS, |
| 720 | sizeof (D0F0xBC_xE010706F_TABLE) / sizeof (FUSE_REGISTER_ENTRY_TN), |
| 721 | D0F0xBC_xE010706F_TABLE |
| 722 | }, |
| 723 | { |
| 724 | D0F0xBC_xE0107070_TYPE, |
| 725 | D0F0xBC_xE0107070_ADDRESS, |
| 726 | sizeof (D0F0xBC_xE0107070_TABLE) / sizeof (FUSE_REGISTER_ENTRY_TN), |
| 727 | D0F0xBC_xE0107070_TABLE |
| 728 | }, |
| 729 | { |
| 730 | D0F0xBC_xE0107073_TYPE, |
| 731 | D0F0xBC_xE0107073_ADDRESS, |
| 732 | sizeof (D0F0xBC_xE0107073_TABLE) / sizeof (FUSE_REGISTER_ENTRY_TN), |
| 733 | D0F0xBC_xE0107073_TABLE |
| 734 | }, |
| 735 | { |
| 736 | D0F0xBC_xE0107074_TYPE, |
| 737 | D0F0xBC_xE0107074_ADDRESS, |
| 738 | sizeof (D0F0xBC_xE0107074_TABLE) / sizeof (FUSE_REGISTER_ENTRY_TN), |
| 739 | D0F0xBC_xE0107074_TABLE |
| 740 | }, |
| 741 | { |
| 742 | D0F0xBC_xE0107077_TYPE, |
| 743 | D0F0xBC_xE0107077_ADDRESS, |
| 744 | sizeof (D0F0xBC_xE0107077_TABLE) / sizeof (FUSE_REGISTER_ENTRY_TN), |
| 745 | D0F0xBC_xE0107077_TABLE |
| 746 | }, |
| 747 | { |
| 748 | D0F0xBC_xE0107078_TYPE, |
| 749 | D0F0xBC_xE0107078_ADDRESS, |
| 750 | sizeof (D0F0xBC_xE0107078_TABLE) / sizeof (FUSE_REGISTER_ENTRY_TN), |
| 751 | D0F0xBC_xE0107078_TABLE |
| 752 | }, |
| 753 | { |
| 754 | D0F0xBC_xE010707B_TYPE, |
| 755 | D0F0xBC_xE010707B_ADDRESS, |
| 756 | sizeof (D0F0xBC_xE010707B_TABLE) / sizeof (FUSE_REGISTER_ENTRY_TN), |
| 757 | D0F0xBC_xE010707B_TABLE |
| 758 | }, |
| 759 | { |
| 760 | D0F0xBC_xE010707C_TYPE, |
| 761 | D0F0xBC_xE010707C_ADDRESS, |
| 762 | sizeof (D0F0xBC_xE010707C_TABLE) / sizeof (FUSE_REGISTER_ENTRY_TN), |
| 763 | D0F0xBC_xE010707C_TABLE |
| 764 | }, |
| 765 | { |
| 766 | D0F0xBC_xE010707F_TYPE, |
| 767 | D0F0xBC_xE010707F_ADDRESS, |
| 768 | sizeof (D0F0xBC_xE010707F_TABLE) / sizeof (FUSE_REGISTER_ENTRY_TN), |
| 769 | D0F0xBC_xE010707F_TABLE |
| 770 | }, |
| 771 | { |
| 772 | D0F0xBC_xFF000000_TYPE, |
| 773 | D0F0xBC_xFF000000_ADDRESS, |
| 774 | sizeof (D0F0xBC_xFF000000_TABLE) / sizeof (FUSE_REGISTER_ENTRY_TN), |
| 775 | D0F0xBC_xFF000000_TABLE |
| 776 | }, |
| 777 | { |
| 778 | D0F0xBC_xE0001008_TYPE, |
| 779 | D0F0xBC_xE0001008_ADDRESS, |
| 780 | sizeof (D0F0xBC_xE0001008_TABLE) / sizeof (FUSE_REGISTER_ENTRY_TN), |
| 781 | D0F0xBC_xE0001008_TABLE |
| 782 | } |
| 783 | }; |
| 784 | |
| 785 | FUSE_TABLE_TN FuseTableTN = { |
| 786 | sizeof (FuseRegisterTableTN) / sizeof (FUSE_TABLE_ENTRY_TN), |
| 787 | FuseRegisterTableTN |
| 788 | }; |
| 789 | |
| 790 | /*----------------------------------------------------------------------------------------*/ |
| 791 | /** |
| 792 | * Load Fuse Table TN |
| 793 | * |
| 794 | * |
| 795 | * @param[out] PpFuseArray Pointer to save fuse table |
| 796 | * @param[in] StdHeader Pointer to Standard configuration |
| 797 | * @retval AGESA_STATUS |
| 798 | */ |
| 799 | |
| 800 | STATIC VOID |
| 801 | NbFuseLoadFuseTableTN ( |
| 802 | OUT PP_FUSE_ARRAY *PpFuseArray, |
| 803 | IN AMD_CONFIG_PARAMS *StdHeader |
| 804 | ) |
| 805 | { |
| 806 | FUSE_TABLE_TN *FuseTable; |
| 807 | UINTN RegisterIndex; |
| 808 | FuseTable = &FuseTableTN; |
| 809 | for (RegisterIndex = 0; RegisterIndex < FuseTable->FuseTableLength; RegisterIndex++ ) { |
| 810 | UINTN FieldIndex; |
| 811 | UINTN FuseRegisterTableLength; |
| 812 | UINT32 FuseValue; |
| 813 | FuseRegisterTableLength = FuseTable->FuseTable[RegisterIndex].FuseRegisterTableLength; |
| 814 | |
| 815 | GnbRegisterReadTN ( |
| 816 | FuseTable->FuseTable[RegisterIndex].RegisterSpaceType, |
| 817 | FuseTable->FuseTable[RegisterIndex].Register, |
| 818 | &FuseValue, |
| 819 | 0, |
| 820 | StdHeader |
| 821 | ); |
| 822 | for (FieldIndex = 0; FieldIndex < FuseRegisterTableLength; FieldIndex++) { |
| 823 | FUSE_REGISTER_ENTRY_TN RegisterEntry; |
| 824 | RegisterEntry = FuseTable->FuseTable[RegisterIndex].FuseRegisterTable[FieldIndex]; |
| 825 | *((UINT8 *) PpFuseArray + RegisterEntry.FuseOffset) = (UINT8) ((FuseValue >> RegisterEntry.FieldOffset) & |
| 826 | ((1 << RegisterEntry.FieldWidth) - 1)); |
| 827 | } |
| 828 | } |
| 829 | } |
| 830 | |
| 831 | /*----------------------------------------------------------------------------------------*/ |
| 832 | /** |
| 833 | * Gnb load fuse table |
| 834 | * |
| 835 | * |
| 836 | * |
| 837 | * @param[in] StdHeader Pointer to Standard configuration |
| 838 | * @retval AGESA_STATUS |
| 839 | */ |
| 840 | |
| 841 | AGESA_STATUS |
| 842 | GnbLoadFuseTableTN ( |
| 843 | IN AMD_CONFIG_PARAMS *StdHeader |
| 844 | ) |
| 845 | { |
| 846 | PP_FUSE_ARRAY *PpFuseArray; |
| 847 | AGESA_STATUS Status; |
| 848 | D18F3xA0_STRUCT D18F3xA0; |
| 849 | |
| 850 | Status = AGESA_SUCCESS; |
| 851 | IDS_HDT_CONSOLE (GNB_TRACE, "GnbLoadFuseTableTN Enter\n"); |
| 852 | |
| 853 | PpFuseArray = (PP_FUSE_ARRAY *) GnbAllocateHeapBuffer (AMD_PP_FUSE_TABLE_HANDLE, sizeof (PP_FUSE_ARRAY), StdHeader); |
| 854 | ASSERT (PpFuseArray != NULL); |
| 855 | if (PpFuseArray != NULL) { |
| 856 | //Support for real fuste table |
| 857 | GnbRegisterReadTN (D18F3xA0_TYPE, D18F3xA0_ADDRESS, &D18F3xA0.Value, 0, StdHeader); |
| 858 | if ((D18F3xA0.Field.CofVidProg) && (GnbBuildOptions.GnbLoadRealFuseTable)) { |
| 859 | NbFuseLoadFuseTableTN (PpFuseArray, StdHeader); |
| 860 | PpFuseArray->VceSateTableSupport = TRUE; |
| 861 | IDS_HDT_CONSOLE (NB_MISC, " Processor Fused\n"); |
| 862 | } else { |
| 863 | LibAmdMemCopy (PpFuseArray, &ex907 , sizeof (PP_FUSE_ARRAY), StdHeader); |
| 864 | IDS_HDT_CONSOLE (NB_MISC, " Processor Unfuse\n"); |
| 865 | } |
| 866 | } else { |
| 867 | Status = AGESA_ERROR; |
| 868 | } |
| 869 | IDS_OPTION_CALLOUT (IDS_CALLOUT_GNB_PPFUSE_OVERRIDE, PpFuseArray, StdHeader); |
| 870 | GnbFuseTableDebugDumpTN (PpFuseArray, StdHeader); |
| 871 | IDS_HDT_CONSOLE (GNB_TRACE, "GnbLoadFuseTableTN Exit [0x%x]\n", Status); |
| 872 | return Status; |
| 873 | } |
| 874 | |
| 875 | |
| 876 | /*----------------------------------------------------------------------------------------*/ |
| 877 | /** |
| 878 | * Debug dump fuse table |
| 879 | * |
| 880 | * |
| 881 | * @param[out] PpFuseArray Pointer to save fuse table |
| 882 | * @param[in] StdHeader Pointer to Standard configuration |
| 883 | */ |
| 884 | |
| 885 | VOID |
| 886 | GnbFuseTableDebugDumpTN ( |
| 887 | IN PP_FUSE_ARRAY *PpFuseArray, |
| 888 | IN AMD_CONFIG_PARAMS *StdHeader |
| 889 | ) |
| 890 | { |
| 891 | UINTN Index; |
| 892 | |
| 893 | IDS_HDT_CONSOLE (NB_MISC, "<------------ GNB FUSE TABLE------------>\n"); |
| 894 | for (Index = 0; Index < 4; Index++) { |
| 895 | if (PpFuseArray->LclkDpmValid[Index] != 0) { |
| 896 | IDS_HDT_CONSOLE ( |
| 897 | NB_MISC, |
| 898 | " LCLK DID[%d] - 0x%02x (%dMHz)\n", |
| 899 | Index, |
| 900 | PpFuseArray->LclkDpmDid[Index], |
| 901 | (PpFuseArray->LclkDpmDid[Index] != 0) ? (GfxFmCalculateClock (PpFuseArray->LclkDpmDid[Index], StdHeader) / 100) : 0 |
| 902 | ); |
| 903 | IDS_HDT_CONSOLE (NB_MISC, " LCLK VID[%d] - 0x02%x\n", Index, PpFuseArray->LclkDpmVid[Index]); |
| 904 | } |
| 905 | } |
| 906 | for (Index = 0; Index < 4; Index++) { |
| 907 | IDS_HDT_CONSOLE ( |
| 908 | NB_MISC, |
| 909 | " VCLK DID[%d] - 0x%02x (%dMHz)\n", |
| 910 | Index, |
| 911 | PpFuseArray->VclkDid[Index], |
| 912 | (PpFuseArray->VclkDid[Index] != 0) ? (GfxFmCalculateClock (PpFuseArray->VclkDid[Index], StdHeader) / 100) : 0 |
| 913 | ); |
| 914 | IDS_HDT_CONSOLE ( |
| 915 | NB_MISC, |
| 916 | " DCLK DID[%d] - 0x%02x (%dMHz)\n", |
| 917 | Index, |
| 918 | PpFuseArray->DclkDid[Index], |
| 919 | (PpFuseArray->DclkDid[Index] != 0) ? (GfxFmCalculateClock (PpFuseArray->DclkDid[Index], StdHeader) / 100) : 0 |
| 920 | ); |
| 921 | } |
| 922 | for (Index = 0; Index < 4; Index++) { |
| 923 | IDS_HDT_CONSOLE ( |
| 924 | NB_MISC, |
| 925 | " DISPCLK DID[%d] - 0x%02x (%dMHz)\n", |
| 926 | Index, |
| 927 | PpFuseArray->DisplclkDid[Index], |
| 928 | (PpFuseArray->DisplclkDid[Index] != 0) ? (GfxFmCalculateClock (PpFuseArray->DisplclkDid[Index], StdHeader) / 100) : 0 |
| 929 | ); |
| 930 | } |
| 931 | for (Index = 0; Index < 4; Index++) { |
| 932 | IDS_HDT_CONSOLE ( |
| 933 | NB_MISC, |
| 934 | " ECLK DID[%d] - 0x%02x (%dMHz)\n", |
| 935 | Index, |
| 936 | PpFuseArray->EclkDid[Index], |
| 937 | (PpFuseArray->EclkDid[Index] != 0) ? (GfxFmCalculateClock (PpFuseArray->EclkDid[Index], StdHeader) / 100) : 0 |
| 938 | ); |
| 939 | IDS_HDT_CONSOLE ( |
| 940 | NB_MISC, |
| 941 | " VCE SCLK DID[%d] - 0x%02x (%dMHz)\n", |
| 942 | Index, |
| 943 | PpFuseArray->SclkDpmDid[PpFuseArray->VceReqSclkSel[Index]], |
| 944 | (PpFuseArray->SclkDpmDid[PpFuseArray->VceReqSclkSel[Index]] != 0) ? (GfxFmCalculateClock (PpFuseArray->SclkDpmDid[PpFuseArray->VceReqSclkSel[Index]], StdHeader) / 100) : 0 |
| 945 | ); |
| 946 | IDS_HDT_CONSOLE ( |
| 947 | NB_MISC, |
| 948 | " VCE Flags[ % d] - 0x % 02x\n", |
| 949 | Index, |
| 950 | PpFuseArray->VceFlags[Index] |
| 951 | ); |
| 952 | } |
| 953 | for (Index = 0; Index < 6; Index++) { |
| 954 | IDS_HDT_CONSOLE ( |
| 955 | NB_MISC, |
| 956 | " SCLK DID[%d] - 0x%02x (%dMHz)\n", |
| 957 | Index, |
| 958 | PpFuseArray->SclkDpmDid[Index], |
| 959 | (PpFuseArray->SclkDpmDid[Index] != 0) ? (GfxFmCalculateClock (PpFuseArray->SclkDpmDid[Index], StdHeader) / 100) : 0 |
| 960 | ); |
| 961 | IDS_HDT_CONSOLE ( |
| 962 | NB_MISC, |
| 963 | " SCLK TDP[%d] - 0x%x \n", |
| 964 | Index, |
| 965 | PpFuseArray->SclkDpmTdpLimit[Index] |
| 966 | ); |
| 967 | IDS_HDT_CONSOLE (NB_MISC, " SCLK VID[%d] - 0x%02x\n", Index, PpFuseArray->SclkDpmVid[Index]); |
| 968 | } |
| 969 | for (Index = 0; Index < 6; Index++) { |
| 970 | IDS_HDT_CONSOLE (NB_MISC, " State #%d\n", Index); |
| 971 | } |
| 972 | IDS_HDT_CONSOLE (NB_MISC, "<------------ GNB FUSE END-------------->\n"); |
| 973 | } |