AGESA F15: AMD family15 AGESA code
[coreboot.git] / src / vendorcode / amd / agesa / f15 / Proc / Mem / Tech / DDR2 / mtspd2.h
1 /* $NoKeywords:$ */
2 /**
3  * @file
4  *
5  * mtspd2.h
6  *
7  * Technology SPD support for DDR2
8  *
9  * @xrefitem bom "File Content Label" "Release Content"
10  * @e project: AGESA
11  * @e sub-project: (Mem/Tech/DDR2)
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 _MTSPD2_H_
47 #define _MTSPD2_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 II
63  *===============================================================================
64  */
65 #define SPD_TYPE         2              /* SPD byte read location */
66 #define JED_DDR_SDRAM     7              /* Jedec defined bit field */
67 #define JED_DDR2_SDRAM    8              /* Jedec defined bit field */
68
69 #define SPD_DIMM_TYPE    20
70 #define SPD_ATTRIB       21
71 #define JED_DIF_CK_MSK   0x20            /* Differential Clock Input */
72 #define JED_REG_ADC_MSK  0x11            /* Registered Address/Control */
73 #define JED_PROBE_MSK    0x40            /* Analysis Probe installed */
74 #define JED_SODIMM       0x04            /* SO-DIMM */
75 #define SPD_DEV_ATTRIB   22
76 #define SPD_EDC_TYPE     11
77 #define JED_ECC          2
78 #define JED_ADRC_PAR     4
79 #define SPD_ROW_SZ       3
80 #define SPD_COL_SZ       4
81 #define SPD_L_BANKS      17              /* number of [logical] banks on each device */
82 #define SPD_DM_BANKS     5               /* number of physical banks on dimm */
83 #define SP_DPL_BIT       4               /*  Dram package bit */
84 #define SPD_BANK_SZ      31              /* capacity of physical bank */
85 #define SPD_DEV_WIDTH    13
86 #define SPD_CAS_LAT      18
87 #define SPD_TRP         27
88 #define SPD_TRRD        28
89 #define SPD_TRCD        29
90 #define SPD_TRAS        30
91 #define SPD_TWR         36
92 #define SPD_TWTR        37
93 #define SPD_TRTP        38
94 #define SPD_TRC         41
95 #define SPD_TRFC        42
96 #define SPD_CHECKSUM    63
97 #define SPD_MAN_DATE_YR   93             /* Module Manufacturing Year (BCD) */
98
99 #define SPD_MAN_DATE_WK   94             /* Module Manufacturing Week (BCD) */
100
101 /*-----------------------------
102  * Jedec DDR II related equates
103  *-----------------------------
104  */
105 #define M_YEAR_06         0x06           /*  Manufacturing Year BCD encoding of 2006 - 06d */
106 #define M_WEEK_24         0x24           /*  Manufacturing Week BCD encoding of June - 24d */
107
108 #define J_MIN           0              /* j loop constraint. 1=CL 2.0 T */
109 #define J_MAX           5              /* j loop constraint. 5=CL 7.0 T */
110 #define K_MIN           1              /* k loop constraint. 1=200 MHz */
111 #define K_MAX           5              /* k loop constraint. 5=533 MHz */
112 #define CL_DEF          2              /* Default value for failsafe operation. 2=CL 4.0 T */
113 #define T_DEF           1              /* Default value for failsafe operation. 1=5ns (cycle time) */
114
115
116 #define BIAS_TCL_T       1
117 #define BIAS_TRP_T       3              /* bias to convert bus clocks to bit field value */
118 #define BIAS_TRRD_T      2
119 #define BIAS_TRCD_T      3
120 #define BIAS_TRAS_T      3
121 #define BIAS_TRC_T       11
122 #define BIAS_TRTP_T      1
123 #define BIAS_TWR_T       3
124 #define BIAS_TWTR_T      0
125 #define BIAS_TFAW_T      7
126
127 #define MIN_TRP_T        3                   /* min programmable value in busclocks */
128 #define MAX_TRP_T        6                   /* max programmable value in busclocks */
129 #define MIN_TRRD_T       2
130 #define MAX_TRRD_T       5
131 #define MIN_TRCD_T       3
132 #define MAX_TRCD_T       6
133 #define MIN_TRAS_T       5
134 #define MAX_TRAS_T       18
135 #define MIN_TRC_T        11
136 #define MAX_TRC_T        26
137 #define MIN_TRTP_T       2
138 #define MAX_TRTP_T       4
139 #define MIN_TWR_T        3
140 #define MAX_TWR_T        6
141 #define MIN_TWTR_T       1
142 #define MAX_TWTR_T       3
143
144 /* DDR2-1066 support */
145 #define BIAS_TRCD_T_1066      5
146 #define BIAS_TRAS_T_1066      15
147 #define BIAS_TRRD_T_1066      4
148 #define BIAS_TWR_T_1066       4
149 #define BIAS_TRP_T_1066       5
150 #define BIAS_TWTR_T_1066      4
151
152 #define MIN_TRCD_T_1066       5
153 #define MAX_TRCD_T_1066       12
154 #define MIN_TRAS_T_1066       15
155 #define MAX_TRAS_T_1066       30
156 #define MIN_TRC_T_1066        11
157 #define MAX_TRC_T_1066        42
158 #define MIN_TRRD_T_1066       4
159 #define MAX_TRRD_T_1066       7
160 #define MIN_TWR_T_1066        5
161 #define MAX_TWR_T_1066        8
162 #define MIN_TRP_T_1066        5
163 #define MAX_TRP_T_1066        12
164 #define MIN_TWTR_T_1066       4
165 #define MAX_TWTR_T_1066       7
166
167
168 /*----------------------------------------------------------------------------
169  *                         TYPEDEFS, STRUCTURES, ENUMS
170  *
171  *----------------------------------------------------------------------------
172  */
173
174 /*----------------------------------------------------------------------------
175  *                           FUNCTIONS PROTOTYPE
176  *
177  *----------------------------------------------------------------------------
178  */
179
180
181 #endif  /* _MTSPD2_H_ */
182
183