zbao | 7d94cf9 | 2012-07-02 14:19:14 +0800 | [diff] [blame] | 1 | /* $NoKeywords:$ */ |
| 2 | /** |
| 3 | * @file |
| 4 | * |
| 5 | * mpStnfp2.c |
| 6 | * |
| 7 | * Platform specific settings for TN DDR3 SO-DIMM FP2 system |
| 8 | * |
| 9 | * @xrefitem bom "File Content Label" "Release Content" |
| 10 | * @e project: AGESA |
| 11 | * @e sub-project: (Mem/Ps/TN/FP2) |
| 12 | * @e \$Revision: 63425 $ @e \$Date: 2011-12-22 11:24:10 -0600 (Thu, 22 Dec 2011) $ |
| 13 | * |
| 14 | **/ |
| 15 | /***************************************************************************** |
| 16 | * |
Siyuan Wang | 641f00c | 2013-06-08 11:50:55 +0800 | [diff] [blame] | 17 | * Copyright (c) 2008 - 2012, Advanced Micro Devices, Inc. |
| 18 | * All rights reserved. |
| 19 | * |
| 20 | * Redistribution and use in source and binary forms, with or without |
| 21 | * modification, are permitted provided that the following conditions are met: |
| 22 | * * Redistributions of source code must retain the above copyright |
| 23 | * notice, this list of conditions and the following disclaimer. |
| 24 | * * Redistributions in binary form must reproduce the above copyright |
| 25 | * notice, this list of conditions and the following disclaimer in the |
| 26 | * documentation and/or other materials provided with the distribution. |
| 27 | * * Neither the name of Advanced Micro Devices, Inc. nor the names of |
| 28 | * its contributors may be used to endorse or promote products derived |
| 29 | * from this software without specific prior written permission. |
| 30 | * |
| 31 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND |
| 32 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
| 33 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
| 34 | * DISCLAIMED. IN NO EVENT SHALL ADVANCED MICRO DEVICES, INC. BE LIABLE FOR ANY |
| 35 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
| 36 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
| 37 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND |
| 38 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 39 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
| 40 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
zbao | 7d94cf9 | 2012-07-02 14:19:14 +0800 | [diff] [blame] | 41 | * *************************************************************************** |
| 42 | * |
| 43 | */ |
| 44 | |
| 45 | #include "AGESA.h" |
| 46 | #include "AdvancedApi.h" |
| 47 | #include "mport.h" |
| 48 | #include "ma.h" |
| 49 | #include "Ids.h" |
| 50 | #include "cpuFamRegisters.h" |
| 51 | #include "cpuRegisters.h" |
| 52 | #include "mm.h" |
| 53 | #include "mn.h" |
| 54 | #include "mp.h" |
| 55 | #include "mu.h" |
| 56 | #include "OptionMemory.h" |
| 57 | #include "PlatformMemoryConfiguration.h" |
| 58 | #include "Filecode.h" |
| 59 | CODE_GROUP (G2_PEI) |
| 60 | RDATA_GROUP (G2_PEI) |
| 61 | |
| 62 | #define FILECODE PROC_MEM_PS_TN_FP2_MPSTNFP2_FILECODE |
| 63 | /*---------------------------------------------------------------------------- |
| 64 | * DEFINITIONS AND MACROS |
| 65 | * |
| 66 | *---------------------------------------------------------------------------- |
| 67 | */ |
| 68 | #define SOCKET_FP2_TN 0 |
| 69 | |
| 70 | /*---------------------------------------------------------------------------- |
| 71 | * TYPEDEFS AND STRUCTURES |
| 72 | * |
| 73 | *---------------------------------------------------------------------------- |
| 74 | */ |
| 75 | |
| 76 | /*---------------------------------------------------------------------------- |
| 77 | * PROTOTYPES OF LOCAL FUNCTIONS |
| 78 | * |
| 79 | *---------------------------------------------------------------------------- |
| 80 | */ |
| 81 | /* |
| 82 | *----------------------------------------------------------------------------- |
| 83 | * EXPORTED FUNCTIONS |
| 84 | * |
| 85 | *----------------------------------------------------------------------------- |
| 86 | */ |
| 87 | // Slow mode, Address timing and Output drive compensation for soldered down SODIMM configuration |
| 88 | // Format : |
| 89 | // DimmPerCh, DDRrate, VDDIO, Dimm0, Dimm1, Dimm2, SlowMode, AddTmgCtl, ODC |
| 90 | // |
| 91 | STATIC CONST PSCFG_SAO_ENTRY TNSODWNSODdr3SAO[] = { |
| 92 | {_DIMM_NONE, DDR667 + DDR800, VOLT_ALL, DIMM_SR + DIMM_DR, NP, NP, 0, 0x00000000, 0x00002222}, |
| 93 | {_DIMM_NONE, DDR1066, VOLT_ALL, DIMM_SR, NP, NP, 0, 0x003D3D3D, 0x10002222}, |
| 94 | {_DIMM_NONE, DDR1066, VOLT_ALL, DIMM_DR, NP, NP, 0, 0x00000000, 0x10002222}, |
| 95 | {_DIMM_NONE, DDR1333, VOLT_ALL, DIMM_SR, NP, NP, 0, 0x003D3D3D, 0x20002222}, |
| 96 | {_DIMM_NONE, DDR1333, VOLT_ALL, DIMM_DR, NP, NP, 0, 0x00003D3D, 0x20002222}, |
| 97 | }; |
| 98 | CONST PSC_TBL_ENTRY TNSAOTblEntSODWNSO3 = { |
| 99 | {PSCFG_SAO, SODWN_SODIMM_TYPE, _DIMM_NONE, {AMD_FAMILY_15_TN, (AMD_F15_OR_ALL | AMD_F15_TN_ALL | 0x0000000000100000ull) }, PT_DONT_CARE, DDR3_TECHNOLOGY}, |
| 100 | sizeof (TNSODWNSODdr3SAO) / sizeof (PSCFG_SAO_ENTRY), |
| 101 | (VOID *)&TNSODWNSODdr3SAO |
| 102 | }; |
| 103 | |
| 104 | // Dram Term and Dynamic Dram Term for soldered down SODIMM configuration |
| 105 | // Format : |
| 106 | // DimmPerCh, DDRrate, VDDIO, Dimm0, Dimm1, Dimm2, Dimm, Rank, RttNom, RttWr |
| 107 | // |
| 108 | // RttNom: |
| 109 | // 0 On die termination disabled |
| 110 | // 1 60ohms |
| 111 | // 2 120ohms |
| 112 | // 3 40ohms |
| 113 | // 4 20ohms |
| 114 | // 5 30ohms |
| 115 | // RttWr: |
| 116 | // 0 Dynamic termination for writes disabled. |
| 117 | // 1 60ohms |
| 118 | // 2 120ohms |
| 119 | STATIC CONST PSCFG_RTT_ENTRY DramTermTNSODWNSODIMM[] = { |
| 120 | {_DIMM_NONE, DDR667 + DDR800 + DDR1066, VOLT_ALL, DIMM_SR + DIMM_DR, NP, NP, DIMM_SR + DIMM_DR, R0 + R1, 2, 0}, |
| 121 | {_DIMM_NONE, DDR1333, VOLT_ALL, DIMM_SR + DIMM_DR, NP, NP, DIMM_SR + DIMM_DR, R0 + R1, 1, 0}, |
| 122 | }; |
| 123 | CONST PSC_TBL_ENTRY TNDramTermTblEntSODWNSO = { |
| 124 | {PSCFG_RTT, SODWN_SODIMM_TYPE, _DIMM_NONE, {AMD_FAMILY_15_TN, (AMD_F15_OR_ALL | AMD_F15_TN_ALL | 0x0000000000100000ull) }, PT_DONT_CARE, DDR3_TECHNOLOGY}, |
| 125 | sizeof (DramTermTNSODWNSODIMM) / sizeof (PSCFG_RTT_ENTRY), |
| 126 | (VOID *)&DramTermTNSODWNSODIMM |
| 127 | }; |
| 128 | |
| 129 | // Max Freq. for soldered down SODIMM configuration |
| 130 | // Format : |
| 131 | // DimmPerCh, Dimms, SR, DR, QR, Speed1_5V, Speed1_35V, Speed1_25V |
| 132 | // |
| 133 | STATIC CONST PSCFG_MAXFREQ_ENTRY ROMDATA MaxFreqTNSODWNSODIMM[] = { |
| 134 | }; |
| 135 | CONST PSC_TBL_ENTRY TNMaxFreqTblEntSODWNSO = { |
| 136 | {PSCFG_MAXFREQ, SODWN_SODIMM_TYPE, _DIMM_NONE, {AMD_FAMILY_15_TN, (AMD_F15_OR_ALL | AMD_F15_TN_ALL | 0x0000000000100000ull) }, PT_DONT_CARE, DDR3_TECHNOLOGY}, |
| 137 | sizeof (MaxFreqTNSODWNSODIMM) / sizeof (PSCFG_MAXFREQ_ENTRY), |
| 138 | (VOID *)&MaxFreqTNSODWNSODIMM |
| 139 | }; |
| 140 | |
| 141 | // |
| 142 | // MemClkDis |
| 143 | // |
| 144 | STATIC CONST UINT8 ROMDATA TNSODdr3CLKDisFP2[] = {0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00}; |
| 145 | CONST PSC_TBL_ENTRY TNClkDisMapEntSOFP2 = { |
| 146 | {PSCFG_CLKDIS, SODIMM_TYPE + UDIMM_TYPE, _1DIMM + _2DIMM, {AMD_FAMILY_15_TN, (AMD_F15_OR_ALL | AMD_F15_TN_ALL | 0x0000000000100000ull) }, SOCKET_FP2_TN, DDR3_TECHNOLOGY}, |
| 147 | sizeof (TNSODdr3CLKDisFP2) / sizeof (UINT8), |
| 148 | (VOID *)&TNSODdr3CLKDisFP2 |
| 149 | }; |
| 150 | |
| 151 | // |
| 152 | // ODT tri-state |
| 153 | // |
| 154 | STATIC CONST UINT8 ROMDATA TNSODdr3ODTTriFP2[] = {0xFF, 0xFF, 0xFF, 0xFF}; |
| 155 | CONST PSC_TBL_ENTRY TNSODdr3ODTTriEntFP2 = { |
| 156 | {PSCFG_ODTTRI, SODIMM_TYPE + UDIMM_TYPE, _1DIMM + _2DIMM, {AMD_FAMILY_15_TN, (AMD_F15_OR_ALL | AMD_F15_TN_ALL | 0x0000000000100000ull) }, SOCKET_FP2_TN, DDR3_TECHNOLOGY}, |
| 157 | sizeof (TNSODdr3ODTTriFP2) / sizeof (UINT8), |
| 158 | (VOID *)&TNSODdr3ODTTriFP2 |
| 159 | }; |
| 160 | |
| 161 | // |
| 162 | // ChipSel tri-state |
| 163 | // |
| 164 | STATIC CONST UINT8 ROMDATA TNSODdr3CSTriFP2[] = {0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00}; |
| 165 | CONST PSC_TBL_ENTRY TNSODdr3CSTriEntFP2 = { |
| 166 | {PSCFG_CSTRI, SODIMM_TYPE + UDIMM_TYPE, _1DIMM + _2DIMM, {AMD_FAMILY_15_TN, (AMD_F15_OR_ALL | AMD_F15_TN_ALL | 0x0000000000100000ull) }, SOCKET_FP2_TN, DDR3_TECHNOLOGY}, |
| 167 | sizeof (TNSODdr3CSTriFP2) / sizeof (UINT8), |
| 168 | (VOID *)&TNSODdr3CSTriFP2 |
| 169 | }; |