AGESA F15: AMD family15 AGESA code
[coreboot.git] / src / vendorcode / amd / agesa / f15 / Proc / Mem / Tech / DDR3 / mtspd3.h
1 /* $NoKeywords:$ */
2 /**
3  * @file
4  *
5  * mtspd3.h
6  *
7  * Technology SPD support for DDR3
8  *
9  * @xrefitem bom "File Content Label" "Release Content"
10  * @e project: AGESA
11  * @e sub-project: (Mem/Tech/DDR3)
12  * @e \$Revision: 49133 $ @e \$Date: 2011-03-17 02:54:42 -0600 (Thu, 17 Mar 2011) $
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 _MTSPD3_H_
47 #define _MTSPD3_H_
48
49 /*----------------------------------------------------------------------------
50  *   Mixed (DEFINITIONS AND MACROS / TYPEDEFS, STRUCTURES, ENUMS)
51  *
52  *----------------------------------------------------------------------------
53  */
54
55 /*-----------------------------------------------------------------------------
56  *                         DEFINITIONS AND MACROS
57  *
58  *-----------------------------------------------------------------------------
59  */
60
61 /*===============================================================================
62  *   Jedec DDR III
63  *===============================================================================
64  */
65 #define SPD_BYTE_USED     0
66 #define SPD_TYPE         2              /* SPD byte read location */
67 #define JED_DDR_SDRAM     7              /* Jedec defined bit field */
68 #define JED_DDR2_SDRAM    8              /* Jedec defined bit field */
69 #define JED_DDR3SDRAM    0xB            /* Jedec defined bit field */
70
71 #define SPD_DIMM_TYPE    3
72 #define SPD_ATTRIB      21
73 #define JED_DIF_CK_MSK    0x20            /* Differential Clock Input */
74 #define JED_RDIMM       1
75 #define JED_MINIRDIMM   5
76 #define JED_UDIMM       2
77 #define JED_SODIMM       3
78 #define JED_LRDIMM      0xB
79 #define JED_UNDEFINED   0                /* Undefined value */
80
81 #define SPD_L_BANKS      4               /* [7:4] number of [logical] banks on each device */
82 #define SPD_DENSITY     4               /* bit 3:0 */
83 #define SPD_ROW_SZ       5               /* bit 5:3 */
84 #define SPD_COL_SZ       5               /* bit 2:0 */
85 #define SPD_RANKS       7               /* bit 5:3 */
86 #define SPD_DEV_WIDTH    7               /* bit 2:0 */
87 #define SPD_ECCBITS     8               /* bit 4:3 */
88 #define JED_ECC         8
89 #define SPD_RAWCARD     62              /* bit 2:0 */
90 #define SPD_ADDRMAP     63              /* bit 0 */
91
92 #define SPD_CTLWRD03     70              /* bit 7:4 */
93 #define SPD_CTLWRD04     71              /* bit 3:0 */
94 #define SPD_CTLWRD05     71              /* bit 7:4 */
95
96 #define SPD_FTB          9
97
98 #define SPD_DIVIDENT    10
99 #define SPD_DIVISOR     11
100
101 #define SPD_TCK         12
102 #define SPD_CASLO       14
103 #define SPD_CASHI       15
104 #define SPD_TAA         16
105
106 #define SPD_TRP         20
107 #define SPD_TRRD        19
108 #define SPD_TRCD        18
109 #define SPD_TRAS        22
110 #define SPD_TWR         17
111 #define SPD_TWTR        26
112 #define SPD_TRTP        27
113 #define SPD_TRC         23
114 #define SPD_UPPER_TRC   21              /* bit 7:4 */
115 #define SPD_UPPER_TRAS  21              /* bit 3:0 */
116 #define SPD_TFAW        29
117 #define SPD_UPPER_TFAW  28              /* bit 3:0 */
118
119 #define SPD_TCK_FTB     34
120 #define SPD_TAA_FTB     35
121 #define SPD_TRCD_FTB    36
122 #define SPD_TRP_FTB     37
123 #define SPD_TRC_FTB     38
124
125 /*-----------------------------
126  * Jedec DDR II related equates
127  *-----------------------------
128  */
129
130 #define CL_DEF          4              /* Default value for failsafe operation. 4=CL 6.0 T */
131 #define T_DEF           4              /* Default value for failsafe operation. 4=2.5ns (cycle time) */
132
133 #define BIAS_TRTP_T      4
134 #define BIAS_TRCD_T      5
135 #define BIAS_TRAS_T      15
136 #define BIAS_TRC_T       11
137 #define BIAS_TRRD_T      4
138 #define BIAS_TWR_T       4
139 #define BIAS_TRP_T       5
140 #define BIAS_TWTR_T      4
141 #define BIAS_TFAW_T      14
142
143 #define MIN_TRTP_T       4
144 #define MAX_TRTP_T       7
145 #define MIN_TRCD_T       5
146 #define MAX_TRCD_T       12
147 #define MIN_TRAS_T       15
148 #define MAX_TRAS_T       30
149 #define MIN_TRC_T        11
150 #define MAX_TRC_T        42
151 #define MIN_TRRD_T       4
152 #define MAX_TRRD_T       7
153 #define MIN_TWR_T        5
154 #define MAX_TWR_T        12
155 #define MIN_TRP_T        5
156 #define MAX_TRP_T        12
157 #define MIN_TWTR_T       4
158 #define MAX_TWTR_T       7
159 #define MIN_TFAW_T       16
160 #define MAX_TFAW_T       32
161
162 /*----------------------------------------------------------------------------
163  *                         TYPEDEFS, STRUCTURES, ENUMS
164  *
165  *----------------------------------------------------------------------------
166  */
167
168 /*----------------------------------------------------------------------------
169  *                           FUNCTIONS PROTOTYPE
170  *
171  *----------------------------------------------------------------------------
172  */
173
174
175 #endif  /* _MTSPD3_H_ */
176
177