blob: 9a39b28046ad2c2781a3bff1cf79a32d238c514c [file] [log] [blame]
Arthur Heymans0bf87de2017-11-04 06:15:05 +01001/*
2 * This file is part of the coreboot project.
3 *
4 * Copyright (C) 2017 Arthur Heymans <arthur@aheymans.xyz>
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License as
8 * published by the Free Software Foundation; either version 2 of
9 * the License, or (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 */
16
17#include <arch/io.h>
18#include <stdint.h>
19#include "x4x.h"
20
21const struct dll_setting default_ddr2_667_ctrl[7] = {
22 /* tap pi db delay coarse*/
23 {13, 0, 1, 0, 0, 0}, /* clkset0 */
24 {4, 1, 0, 0, 0, 0}, /* ctrl0 */
25 {13, 0, 1, 0, 0, 0}, /* clkset1 */
26 {4, 5, 0, 0, 0, 0}, /* cmd */
27 {4, 1, 0, 0, 0, 0}, /* ctrl1 */
28 {4, 1, 0, 0, 0, 0}, /* ctrl2 */
29 {4, 1, 0, 0, 0, 0}, /* ctrl3 */
30};
31
Arthur Heymans276049f2017-11-05 05:56:34 +010032const struct dll_setting default_ddr2_667_dqs[TOTAL_BYTELANES] = {
Arthur Heymans0bf87de2017-11-04 06:15:05 +010033 {1, 5, 1, 1, 1, 0},
34 {1, 6, 1, 1, 1, 0},
35 {2, 0, 1, 1, 1, 0},
36 {2, 1, 1, 1, 1, 0},
37 {2, 1, 1, 1, 1, 0},
38 {14, 6, 1, 0, 0, 0},
39 {14, 3, 1, 0, 0, 0},
40 {14, 0, 1, 0, 0, 0},
41};
42
Arthur Heymans276049f2017-11-05 05:56:34 +010043const struct dll_setting default_ddr2_667_dq[TOTAL_BYTELANES] = {
Arthur Heymans0bf87de2017-11-04 06:15:05 +010044 {9, 0, 0, 0, 1, 0},
45 {9, 1, 0, 0, 1, 0},
46 {9, 2, 0, 0, 1, 0},
47 {9, 2, 0, 0, 1, 0},
48 {9, 1, 0, 0, 1, 0},
49 {6, 4, 0, 0, 1, 0},
50 {6, 2, 0, 0, 1, 0},
51 {5, 4, 0, 0, 1, 0}
52};
53
54const struct dll_setting default_ddr2_800_ctrl[7] = {
55 /* tap pi db delay coarse */
56 {11, 5, 1, 0, 0, 0},
57 {0, 5, 1, 1, 0, 0},
58 {11, 5, 1, 0, 0, 0},
59 {1, 4, 1, 1, 0, 0},
60 {0, 5, 1, 1, 0, 0},
61 {0, 5, 1, 1, 0, 0},
62 {0, 5, 1, 1, 0, 0},
63};
64
Arthur Heymans276049f2017-11-05 05:56:34 +010065const struct dll_setting default_ddr2_800_dqs[TOTAL_BYTELANES] = {
Arthur Heymans0bf87de2017-11-04 06:15:05 +010066 {2, 5, 1, 1, 1, 0},
67 {2, 6, 1, 1, 1, 0},
68 {3, 0, 1, 1, 1, 0},
69 {3, 0, 1, 1, 1, 0},
70 {3, 3, 1, 1, 1, 0},
71 {2, 0, 1, 1, 1, 0},
72 {1, 3, 1, 1, 1, 0},
73 {0, 3, 1, 1, 1, 0},
74};
75
Arthur Heymans276049f2017-11-05 05:56:34 +010076const struct dll_setting default_ddr2_800_dq[TOTAL_BYTELANES] = {
Arthur Heymans0bf87de2017-11-04 06:15:05 +010077 {9, 3, 0, 0, 1, 0},
78 {9, 4, 0, 0, 1, 0},
79 {9, 5, 0, 0, 1, 0},
80 {9, 6, 0, 0, 1, 0},
81 {10, 0, 0, 0, 1, 0},
82 {8, 1, 0, 0, 1, 0},
83 {7, 5, 0, 0, 1, 0},
84 {6, 2, 0, 0, 1, 0}
85};
86
87const struct dll_setting default_ddr3_800_ctrl[2][7] = {
88 { /* 1N */
89 /* tap pi db(2) delay coarse */
90 {8, 2, 0, 0, 0, 0},
91 {8, 4, 0, 0, 0, 0},
92 {9, 5, 0, 0, 0, 0},
93 {6, 1, 0, 0, 0, 0},
94 {8, 4, 0, 0, 0, 0},
95 {10, 0, 0, 0, 0, 0},
96 {10, 0, 0, 0, 0, 0}, },
97 { /* 2N */
98 {2, 2, 1, 1, 0, 0},
99 {2, 4, 1, 1, 0, 0},
100 {3, 5, 0, 0, 0, 0},
101 {3, 2, 1, 1, 0, 0},
102 {2, 4, 1, 1, 0, 0},
103 {3, 6, 0, 0, 0, 0},
104 {3, 6, 0, 0, 0, 0}, }
105};
106
Arthur Heymans276049f2017-11-05 05:56:34 +0100107const struct dll_setting default_ddr3_800_dqs[2][TOTAL_BYTELANES] = {
Arthur Heymans0bf87de2017-11-04 06:15:05 +0100108 { /* 1N */
109 {12, 0, 1, 0, 0, 0},
110 {1, 1, 1, 1, 1, 0},
111 {2, 4, 1, 1, 1, 0},
112 {3, 5, 0, 0, 1, 0},
113 {4, 3, 0, 0, 1, 0},
114 {5, 2, 0, 0, 1, 0},
115 {6, 1, 0, 0, 1, 0},
116 {6, 4, 0, 0, 1, 0}, },
117 { /* 2N */
118 {5, 6, 0, 0, 0, 0},
119 {8, 0, 0, 0, 0, 0},
120 {9, 4, 0, 0, 0, 0},
121 {10, 4, 1, 0, 0, 0},
122 {11, 3, 1, 0, 0, 0},
123 {12, 1, 1, 0, 0, 0},
124 {0, 1, 1, 1, 1, 0},
125 {0, 3, 1, 1, 1, 0}, }
126};
127
Arthur Heymans276049f2017-11-05 05:56:34 +0100128const struct dll_setting default_ddr3_800_dq[2][TOTAL_BYTELANES] = {
Arthur Heymans0bf87de2017-11-04 06:15:05 +0100129 { /* 1N */
130 {4, 1, 0, 0, 1, 0},
131 {6, 4, 0, 0, 1, 0},
132 {8, 1, 0, 0, 1, 0},
133 {8, 6, 0, 0, 1, 0},
134 {9, 5, 0, 0, 1, 0},
135 {10, 2, 0, 0, 1, 0},
136 {10, 6, 1, 0, 1, 0},
137 {11, 4, 1, 0, 1, 0} },
138 { /* 2N */
139 {11, 0, 1, 0, 0, 0},
140 {0, 3, 1, 1, 1, 0},
141 {2, 1, 1, 1, 1, 0},
142 {2, 5, 1, 1, 1, 0},
143 {3, 5, 0, 0, 1, 0},
144 {4, 2, 0, 0, 1, 0},
145 {4, 6, 0, 0, 1, 0},
146 {5, 4, 0, 0, 1, 0}, }
147};
148
149const struct dll_setting default_ddr3_1067_ctrl[2][7] = {
150 { /* 1N */
151 {8, 5, 0, 0, 0, 0},
152 {7, 6, 0, 0, 0, 0},
153 {10, 2, 1, 0, 0, 0},
154 {4, 4, 0, 0, 0, 0},
155 {7, 6, 0, 0, 0, 0},
156 {9, 2, 1, 0, 0, 0},
157 {9, 2, 1, 0, 0, 0}, },
158 { /* 2N */
159 {1, 5, 1, 1, 0, 0},
160 {0, 6, 1, 1, 0, 0},
161 {3, 2, 0, 0, 0, 0},
162 {2, 6, 1, 1, 0, 0},
163 {0, 6, 1, 1, 0, 0},
164 {2, 2, 1, 1, 0, 0},
165 {2, 2, 1, 1, 0, 0}, }
166};
167
Arthur Heymans276049f2017-11-05 05:56:34 +0100168const struct dll_setting default_ddr3_1067_dqs[2][TOTAL_BYTELANES] = {
Arthur Heymans0bf87de2017-11-04 06:15:05 +0100169 { /* 1N */
170 {2, 5, 1, 1, 1, 0},
171 {5, 1, 0, 0, 1, 0},
172 {6, 6, 0, 0, 1, 0},
173 {8, 0, 0, 0, 1, 0},
174 {8, 6, 0, 0, 1, 0},
175 {9, 6, 1, 0, 1, 0},
176 {10, 6, 1, 0, 1, 0},
177 {0, 1, 1, 1, 0, 1}, },
178 { /* 2N */
179 {6, 4, 0, 0, 0, 0},
180 {9, 1, 1, 0, 0, 0},
181 {10, 6, 1, 0, 0, 0},
182 {1, 0, 1, 1, 1, 0},
183 {1, 6, 1, 1, 1, 0},
184 {2, 5, 1, 1, 1, 0},
185 {3, 5, 0, 0, 1, 0},
186 {4, 1, 0, 0, 1, 0},
187 }
188};
189
Arthur Heymans276049f2017-11-05 05:56:34 +0100190const struct dll_setting default_ddr3_1067_dq[2][TOTAL_BYTELANES] = {
Arthur Heymans0bf87de2017-11-04 06:15:05 +0100191 { /* 1N */
192 {6, 5, 0, 0, 1, 0},
193 {9, 3, 1, 0, 1, 0},
194 {0, 2, 1, 1, 0, 1},
195 {1, 0, 1, 1, 0, 1},
196 {2, 0, 1, 1, 0, 1},
197 {2, 5, 1, 1, 0, 1},
198 {3, 2, 0, 0, 0, 1},
199 {4, 1, 0, 0, 0, 1}, },
200 { /* 2N */
201 {10, 5, 1, 0, 0, 0},
202 {2, 3, 1, 1, 1, 0},
203 {4, 1, 0, 0, 1, 0},
204 {5, 0, 0, 0, 1, 0},
205 {6, 0, 0, 0, 1, 0},
206 {6, 5, 0, 0, 1, 0},
207 {7, 2, 0, 0, 1, 0},
208 {8, 1, 0, 0, 1, 0},
209 }
210};
211
212const struct dll_setting default_ddr3_1333_ctrl[2][7] = {
213 { /* 1N */
214 {8, 5, 0, 0, 0, 0},
215 {9, 0, 1, 0, 0, 0},
216 {10, 2, 1, 0, 0, 0},
217 {0, 0, 1, 1, 0, 0},
218 {9, 0, 1, 0, 0, 0},
219 {10, 4, 1, 0, 0, 0},
220 {10, 4, 1, 0, 0, 0}, },
221 { /* 2N */
222 {1, 6, 1, 1, 0, 0},
223 {2, 2, 1, 1, 0, 0},
224 {4, 2, 0, 0, 0, 0},
225 {3, 1, 1, 1, 0, 0},
226 {2, 2, 1, 1, 0, 0},
227 {4, 5, 0, 0, 0, 0},
228 {4, 5, 0, 0, 0, 0}, }
229};
230
Arthur Heymans276049f2017-11-05 05:56:34 +0100231const struct dll_setting default_ddr3_1333_dqs[2][TOTAL_BYTELANES] = {
Arthur Heymans0bf87de2017-11-04 06:15:05 +0100232 { /* 1N */
233 {2, 4, 1, 1, 1, 0},
234 {5, 1, 0, 0, 1, 0},
235 {6, 6, 0, 0, 1, 0},
236 {8, 0, 0, 0, 1, 0},
237 {8, 6, 0, 0, 1, 0},
238 {9, 5, 1, 0, 1, 0},
239 {10, 6, 1, 0, 1, 0},
240 {0, 1, 1, 1, 0, 1}, },
241 { /* 2N */
242 {10, 4, 0, 0, 0, 0},
243 {0, 3, 1, 1, 1, 0},
244 {3, 2, 1, 1, 1, 0},
245 {5, 0, 0, 0, 1, 0},
246 {6, 1, 0, 0, 1, 0},
247 {7, 4, 0, 0, 1, 0},
248 {9, 2, 0, 0, 1, 0},
249 {9, 6, 0, 0, 1, 0}, }
250};
251
Arthur Heymans276049f2017-11-05 05:56:34 +0100252const struct dll_setting default_ddr3_1333_dq[2][TOTAL_BYTELANES] = {
Arthur Heymans0bf87de2017-11-04 06:15:05 +0100253 { /* 1N */
254 {6, 5, 0, 0, 1, 0},
255 {9, 3, 1, 0, 1, 0},
256 {0, 2, 1, 1, 0, 1},
257 {1, 0, 1, 1, 0, 1},
258 {2, 0, 1, 1, 0, 1},
259 {2, 5, 1, 1, 0, 1},
260 {3, 2, 0, 0, 0, 1},
261 {4, 1, 0, 0, 0, 1}, },
262 { /* 2N */
263 {1, 3, 1, 1, 1, 0},
264 {5, 6, 0, 0, 1, 0},
265 {8, 5, 0, 0, 1, 0},
266 {10, 2, 0, 0, 1, 0},
267 {11, 1, 0, 0, 1, 0},
268 {12, 3, 1, 0, 1, 0},
269 {13, 6, 1, 0, 1, 0},
270 {0, 3, 1, 1, 0, 1}, }
271};