blob: 926e3e83b3fa70024b6633e9987e6cadb060c639 [file] [log] [blame]
Patrick Delaunay939d5362018-03-12 10:46:11 +01001ST,stm32mp1 DDR3/LPDDR2/LPDDR3 Controller (DDRCTRL and DDRPHYC)
2
3--------------------
4Required properties:
5--------------------
6- compatible : Should be "st,stm32mp1-ddr"
7- reg : controleur (DDRCTRL) and phy (DDRPHYC) base address
8- clocks : controller clocks handle
9- clock-names : associated controller clock names
10 the "ddrphyc" clock is used to check the DDR frequency
11 at phy level according the expected value in "mem-speed" field
12
13the next attributes are DDR parameters, they are generated by DDR tools
14included in STM32 Cube tool
15
16info attributes:
17----------------
18- st,mem-name : name for DDR configuration, simple string for information
Patrick Delaunay29e1a942019-04-10 14:09:23 +020019- st,mem-speed : DDR expected speed for the setting in kHz
Patrick Delaunay939d5362018-03-12 10:46:11 +010020- st,mem-size : DDR mem size in byte
21
22
23controlleur attributes:
24-----------------------
25- st,ctl-reg : controleur values depending of the DDR type
26 (DDR3/LPDDR2/LPDDR3)
27 for STM32MP15x: 25 values are requested in this order
28 MSTR
29 MRCTRL0
30 MRCTRL1
31 DERATEEN
32 DERATEINT
33 PWRCTL
34 PWRTMG
35 HWLPCTL
36 RFSHCTL0
37 RFSHCTL3
38 CRCPARCTL0
39 ZQCTL0
40 DFITMG0
41 DFITMG1
42 DFILPCFG0
43 DFIUPD0
44 DFIUPD1
45 DFIUPD2
46 DFIPHYMSTR
47 ODTMAP
48 DBG0
49 DBG1
50 DBGCMD
51 POISONCFG
52 PCCFG
53
54- st,ctl-timing : controleur values depending of frequency and timing parameter
55 of DDR
56 for STM32MP15x: 12 values are requested in this order
57 RFSHTMG
58 DRAMTMG0
59 DRAMTMG1
60 DRAMTMG2
61 DRAMTMG3
62 DRAMTMG4
63 DRAMTMG5
64 DRAMTMG6
65 DRAMTMG7
66 DRAMTMG8
67 DRAMTMG14
68 ODTCFG
69
70- st,ctl-map : controleur values depending of address mapping
71 for STM32MP15x: 9 values are requested in this order
72 ADDRMAP1
73 ADDRMAP2
74 ADDRMAP3
75 ADDRMAP4
76 ADDRMAP5
77 ADDRMAP6
78 ADDRMAP9
79 ADDRMAP10
80 ADDRMAP11
81
82- st,ctl-perf : controleur values depending of performance and scheduling
83 for STM32MP15x: 17 values are requested in this order
84 SCHED
85 SCHED1
86 PERFHPR1
87 PERFLPR1
88 PERFWR1
89 PCFGR_0
90 PCFGW_0
91 PCFGQOS0_0
92 PCFGQOS1_0
93 PCFGWQOS0_0
94 PCFGWQOS1_0
95 PCFGR_1
96 PCFGW_1
97 PCFGQOS0_1
98 PCFGQOS1_1
99 PCFGWQOS0_1
100 PCFGWQOS1_1
101
102phyc attributes:
103----------------
104- st,phy-reg : phy values depending of the DDR type (DDR3/LPDDR2/LPDDR3)
Patrick Delaunayd892d272019-04-10 14:09:25 +0200105 for STM32MP15x: 11 values are requested in this order
Patrick Delaunay939d5362018-03-12 10:46:11 +0100106 PGCR
107 ACIOCR
108 DXCCR
109 DSGCR
110 DCR
111 ODTCR
112 ZQ0CR1
113 DX0GCR
114 DX1GCR
115 DX2GCR
116 DX3GCR
117
118- st,phy-timing : phy values depending of frequency and timing parameter of DDR
119 for STM32MP15x: 10 values are requested in this order
120 PTR0
121 PTR1
122 PTR2
123 DTPR0
124 DTPR1
125 DTPR2
126 MR0
127 MR1
128 MR2
129 MR3
130
Patrick Delaunay939d5362018-03-12 10:46:11 +0100131Example:
132
133/ {
134 soc {
135 u-boot,dm-spl;
136
137 ddr: ddr@0x5A003000{
138 u-boot,dm-spl;
139 u-boot,dm-pre-reloc;
140
141 compatible = "st,stm32mp1-ddr";
142
143 reg = <0x5A003000 0x550
144 0x5A004000 0x234>;
145
146 clocks = <&rcc_clk AXIDCG>,
147 <&rcc_clk DDRC1>,
148 <&rcc_clk DDRC2>,
149 <&rcc_clk DDRPHYC>,
150 <&rcc_clk DDRCAPB>,
151 <&rcc_clk DDRPHYCAPB>;
152
153 clock-names = "axidcg",
154 "ddrc1",
155 "ddrc2",
156 "ddrphyc",
157 "ddrcapb",
158 "ddrphycapb";
159
160 st,mem-name = "DDR3 2x4Gb 533MHz";
Patrick Delaunay29e1a942019-04-10 14:09:23 +0200161 st,mem-speed = <533000>;
Patrick Delaunay939d5362018-03-12 10:46:11 +0100162 st,mem-size = <0x40000000>;
163
164 st,ctl-reg = <
165 0x00040401 /*MSTR*/
166 0x00000010 /*MRCTRL0*/
167 0x00000000 /*MRCTRL1*/
168 0x00000000 /*DERATEEN*/
169 0x00800000 /*DERATEINT*/
170 0x00000000 /*PWRCTL*/
171 0x00400010 /*PWRTMG*/
172 0x00000000 /*HWLPCTL*/
173 0x00210000 /*RFSHCTL0*/
174 0x00000000 /*RFSHCTL3*/
175 0x00000000 /*CRCPARCTL0*/
176 0xC2000040 /*ZQCTL0*/
177 0x02050105 /*DFITMG0*/
178 0x00000202 /*DFITMG1*/
179 0x07000000 /*DFILPCFG0*/
180 0xC0400003 /*DFIUPD0*/
181 0x00000000 /*DFIUPD1*/
182 0x00000000 /*DFIUPD2*/
183 0x00000000 /*DFIPHYMSTR*/
184 0x00000001 /*ODTMAP*/
185 0x00000000 /*DBG0*/
186 0x00000000 /*DBG1*/
187 0x00000000 /*DBGCMD*/
188 0x00000000 /*POISONCFG*/
189 0x00000010 /*PCCFG*/
190 >;
191
192 st,ctl-timing = <
193 0x0080008A /*RFSHTMG*/
194 0x121B2414 /*DRAMTMG0*/
195 0x000D041B /*DRAMTMG1*/
196 0x0607080E /*DRAMTMG2*/
197 0x0050400C /*DRAMTMG3*/
198 0x07040407 /*DRAMTMG4*/
199 0x06060303 /*DRAMTMG5*/
200 0x02020002 /*DRAMTMG6*/
201 0x00000202 /*DRAMTMG7*/
202 0x00001005 /*DRAMTMG8*/
203 0x000D041B /*DRAMTMG1*/4
204 0x06000600 /*ODTCFG*/
205 >;
206
207 st,ctl-map = <
208 0x00080808 /*ADDRMAP1*/
209 0x00000000 /*ADDRMAP2*/
210 0x00000000 /*ADDRMAP3*/
211 0x00001F1F /*ADDRMAP4*/
212 0x07070707 /*ADDRMAP5*/
213 0x0F070707 /*ADDRMAP6*/
214 0x00000000 /*ADDRMAP9*/
215 0x00000000 /*ADDRMAP10*/
216 0x00000000 /*ADDRMAP11*/
217 >;
218
219 st,ctl-perf = <
220 0x00001201 /*SCHED*/
221 0x00001201 /*SCHED*/1
222 0x01000001 /*PERFHPR1*/
223 0x08000200 /*PERFLPR1*/
224 0x08000400 /*PERFWR1*/
225 0x00010000 /*PCFGR_0*/
226 0x00000000 /*PCFGW_0*/
227 0x02100B03 /*PCFGQOS0_0*/
228 0x00800100 /*PCFGQOS1_0*/
229 0x01100B03 /*PCFGWQOS0_0*/
230 0x01000200 /*PCFGWQOS1_0*/
231 0x00010000 /*PCFGR_1*/
232 0x00000000 /*PCFGW_1*/
233 0x02100B03 /*PCFGQOS0_1*/
234 0x00800000 /*PCFGQOS1_1*/
235 0x01100B03 /*PCFGWQOS0_1*/
236 0x01000200 /*PCFGWQOS1_1*/
237 >;
238
239 st,phy-reg = <
240 0x01442E02 /*PGCR*/
241 0x10400812 /*ACIOCR*/
242 0x00000C40 /*DXCCR*/
243 0xF200001F /*DSGCR*/
244 0x0000000B /*DCR*/
245 0x00010000 /*ODTCR*/
246 0x0000007B /*ZQ0CR1*/
247 0x0000CE81 /*DX0GCR*/
248 0x0000CE81 /*DX1GCR*/
249 0x0000CE81 /*DX2GCR*/
250 0x0000CE81 /*DX3GCR*/
251 >;
252
253 st,phy-timing = <
254 0x0022A41B /*PTR0*/
255 0x047C0740 /*PTR1*/
256 0x042D9C80 /*PTR2*/
257 0x369477D0 /*DTPR0*/
258 0x098A00D8 /*DTPR1*/
259 0x10023600 /*DTPR2*/
260 0x00000830 /*MR0*/
261 0x00000000 /*MR1*/
262 0x00000208 /*MR2*/
263 0x00000000 /*MR3*/
264 >;
265
Patrick Delaunay939d5362018-03-12 10:46:11 +0100266 status = "okay";
267 };
268 };
269};