AGESA F15: AMD family15 AGESA code
[coreboot.git] / src / vendorcode / amd / agesa / f15 / Proc / Mem / NB / DR / mndr.h
1 /* $NoKeywords:$ */
2 /**
3  * @file
4  *
5  * mndr.h
6  *
7  * Northbridge DR
8  *
9  * @xrefitem bom "File Content Label" "Release Content"
10  * @e project: AGESA
11  * @e sub-project: (Mem)
12  * @e \$Revision: 44324 $ @e \$Date: 2010-12-22 02:16:51 -0700 (Wed, 22 Dec 2010) $
13  *
14  **/
15 /*****************************************************************************
16   *
17  * Copyright (C) 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.
41   *
42   * ***************************************************************************
43   *
44  */
45
46 #ifndef _MNDR_H_
47 #define _MNDR_H_
48
49 /*----------------------------------------------------------------------------
50  *   Mixed (DEFINITIONS AND MACROS / TYPEDEFS, STRUCTURES, ENUMS)
51  *
52  *----------------------------------------------------------------------------
53  */
54 #define MAX_CHANNELS_PER_SOCKET_DR    2
55 #define MAX_DCTS_PER_NODE_DR          2
56 #define MAX_CHANNELS_PER_DCT_DR       1
57 #define MAX_NODES_SUPPORTED_DR        8
58
59 /*-----------------------------------------------------------------------------
60  *                         DEFINITIONS AND MACROS
61  *
62  *-----------------------------------------------------------------------------
63  */
64
65 /*----------------------------------------------------------------------------
66  *                         TYPEDEFS, STRUCTURES, ENUMS
67  *
68  *----------------------------------------------------------------------------
69  */
70
71 /*----------------------------------------------------------------------------
72  *                           FUNCTIONS PROTOTYPE
73  *
74  *----------------------------------------------------------------------------
75  */
76
77 BOOLEAN
78 MemConstructNBBlockDR (
79   IN OUT   MEM_NB_BLOCK *NBPtr,
80   IN OUT   MEM_DATA_STRUCT *MemPtr,
81   IN       MEM_FEAT_BLOCK_NB *FeatPtr,
82   IN       MEM_SHARED_DATA *SharedPtr,
83   IN       UINT8 NodeID
84   );
85
86 VOID
87 MemNInitNBDataDr (
88   IN OUT   MEM_NB_BLOCK *NBPtr
89   );
90
91 VOID
92 MemNInitDefaultsDR (
93   IN OUT   MEM_DATA_STRUCT *MemPtr
94   );
95
96 BOOLEAN
97 MemNInitializeMctDr (
98   IN OUT   MEM_NB_BLOCK *NBPtr
99   );
100
101 BOOLEAN
102 MemNFinalizeMctDr (
103   IN OUT   MEM_NB_BLOCK *NBPtr
104   );
105
106 VOID
107 MemNSendMrsCmdDr (
108   IN OUT   MEM_NB_BLOCK *NBPtr
109   );
110
111 BOOLEAN
112 memNAutoConfigDr (
113   IN OUT   MEM_NB_BLOCK *NBPtr
114   );
115
116 BOOLEAN
117 MemNOtherTimingDr (
118   IN OUT   MEM_NB_BLOCK *NBPtr
119   );
120
121 VOID
122 MemNWritePatternDr (
123   IN OUT   MEM_NB_BLOCK *NBPtr,
124   IN       UINT32 Address,
125   IN       UINT8 Pattern[],
126   IN       UINT16 ClCount
127   );
128
129 VOID
130 MemNReadPatternDr (
131   IN OUT   MEM_NB_BLOCK *NBPtr,
132   IN       UINT8 Buffer[],
133   IN       UINT32 Address,
134   IN       UINT16 ClCount
135   );
136
137 VOID
138 MemPNodeMemBoundaryDr (
139   IN OUT   MEM_NB_BLOCK *NBPtr,
140   IN OUT   UINT32 *NodeSysLimit
141   );
142
143 VOID
144 InitNBRegTableDr (
145   IN OUT   MEM_NB_BLOCK *NBPtr,
146   IN OUT   TSEFO NBRegTable[]
147   );
148
149 BOOLEAN
150 MemNIsIdSupportedDr (
151   IN OUT   MEM_NB_BLOCK *NBPtr,
152   IN       CPU_LOGICAL_ID *LogicalIdPtr
153   );
154
155 VOID
156 MemNBeforeDramInitDr (
157   IN OUT   MEM_NB_BLOCK *NBPtr
158   );
159
160 VOID
161 MemNBeforePlatformSpecDr (
162   IN OUT   MEM_NB_BLOCK *NBPtr
163   );
164
165 BOOLEAN
166 MemNPlatformSpecificFormFactorInitDr (
167   IN OUT   MEM_NB_BLOCK *NBPtr
168   );
169
170 VOID
171 MemPPhyFenceTrainingDr (
172   IN OUT   MEM_NB_BLOCK *NBPtr
173   );
174
175 UINT32
176 MemNCmnGetSetFieldDr (
177   IN OUT   MEM_NB_BLOCK *NBPtr,
178   IN       UINT8 IsSet,
179   IN       BIT_FIELD_NAME FieldName,
180   IN       UINT32 Field
181   );
182
183 VOID
184 MemNPFenceAdjustDr (
185   IN OUT   MEM_NB_BLOCK *NBPtr,
186   IN OUT   INT16 *Value16
187   );
188
189 VOID
190 MemNProgramCycTimingsDr (
191   IN OUT   MEM_NB_BLOCK *NBPtr
192   );
193
194 BOOLEAN
195 memNEnableTrainSequenceDr (
196   IN OUT   MEM_NB_BLOCK *NBPtr
197   );
198 #endif  /* _MNDR_H_ */