9 * @xrefitem bom "File Content Label" "Release Content"
11 * @e sub-project: (Mem)
12 * @e \$Revision: 45735 $ @e \$Date: 2011-01-21 07:49:28 +0800 (Fri, 21 Jan 2011) $
15 /*****************************************************************************
17 * Copyright (c) 2011, Advanced Micro Devices, Inc.
18 * All rights reserved.
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.
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.
41 * ***************************************************************************
48 /*----------------------------------------------------------------------------
49 * Mixed (DEFINITIONS AND MACROS / TYPEDEFS, STRUCTURES, ENUMS)
51 *----------------------------------------------------------------------------
54 /*-----------------------------------------------------------------------------
55 * DEFINITIONS AND MACROS
57 *-----------------------------------------------------------------------------
60 #define PSO_ENTRY UINT8
64 // Maximum value macro
67 #define MAX(X, Y) (((X) < (Y)) ? (Y) : (X))
70 // Minimum Value macro
73 #define MIN(X, Y) (((X) < (Y)) ? (X) : (Y))
76 // Absolute Value Macro
78 #define ABS(X) (((X) < 0) ? (-(X)) : (X))
82 /*----------------------------------------------------------------------------
83 * TYPEDEFS, STRUCTURES, ENUMS
85 *----------------------------------------------------------------------------
88 /// Test patterns for DQS training
90 TestPattern0, ///< Test pattern used in first pass of receiver enable training
91 TestPattern1, ///< Test pattern used in first pass of receiver enable training
92 TestPattern2, ///< Test pattern used in second pass of receiver enable training
93 TestPatternJD1B, ///< 72-bit test pattern used in position training (ganged mode)
94 TestPatternJD1A, ///< 72-bit test pattern used in position training
95 TestPatternJD256B, ///< 256-bit test pattern used in position training (ganged mode)
96 TestPatternJD256A, ///< 256-bit test pattern used in position training
97 TestPatternML, ///< Test pattern used in first pass of max latency training
98 TestPattern3, ///< Test pattern used in first pass of receiver enable training
99 TestPattern4 ///< Test pattern used in first pass of receiver enable training
102 /*----------------------------------------------------------------------------
103 * FUNCTIONS PROTOTYPE
105 *----------------------------------------------------------------------------
109 MemUWriteCachelines (
135 MemUFillTrainPattern (
136 IN TRAIN_PATTERN Pattern,
144 IN OUT MEM_DATA_STRUCT *MemPtr
150 IN OUT MEM_DATA_STRUCT *MemPtr
154 MemUResetTargetWTIO (
155 IN OUT MEM_DATA_STRUCT *MemPtr
162 IN OUT MEM_DATA_STRUCT *MemPtr
168 IN OUT MEM_DATA_STRUCT *MemPtr
173 IN OUT UINT16 *ErrBitmap,
179 AlignPointerTo16Byte (
180 IN OUT UINT8 **BufferPtrPtr
184 FindPSOverrideEntry (
185 IN PSO_TABLE *PlatformMemoryConfiguration,
186 IN PSO_ENTRY EntryType,
192 GetMaxDimmsPerChannel (
193 IN PSO_TABLE *PlatformMemoryConfiguration,
199 GetMaxChannelsPerSocket (
200 IN PSO_TABLE *PlatformMemoryConfiguration,
202 IN AMD_CONFIG_PARAMS *StdHeader
207 IN PSO_TABLE *PlatformMemoryConfiguration,
214 IN PSO_TABLE *PlatformMemoryConfiguration,
216 IN AMD_CONFIG_PARAMS *StdHeader
221 IN PSO_TABLE *PlatformMemoryConfiguration,
224 IN AMD_CONFIG_PARAMS *StdHeader
229 IN CPU_LOGICAL_ID *LogicalIdPtr,
230 IN AMD_CONFIG_PARAMS *StdHeader
240 IN MEMORY_BUS_SPEED Speed,