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