1*e4061556SMario Six /* SPDX-License-Identifier: GPL-2.0+ */
2*e4061556SMario Six /*
3*e4061556SMario Six  * (C) Copyright 2018
4*e4061556SMario Six  * Mario Six, Guntermann & Drunck GmbH, mario.six@gdsys.cc
5*e4061556SMario Six  */
6*e4061556SMario Six 
7*e4061556SMario Six #ifndef DT_BINDINGS_MPC83XX_SDRAM_H
8*e4061556SMario Six #define DT_BINDINGS_MPC83XX_SDRAM_H
9*e4061556SMario Six 
10*e4061556SMario Six /* DDR Control Driver register */
11*e4061556SMario Six 
12*e4061556SMario Six #define DSO_DISABLE	0
13*e4061556SMario Six #define DSO_ENABLE	1
14*e4061556SMario Six 
15*e4061556SMario Six #define DSO_P_IMPEDANCE_HIGHEST_Z	0x0
16*e4061556SMario Six #define DSO_P_IMPEDANCE_MUCH_HIGHER_Z	0x8
17*e4061556SMario Six #define DSO_P_IMPEDANCE_HIGHER_Z	0xC
18*e4061556SMario Six #define DSO_P_IMPEDANCE_NOMINAL		0xE
19*e4061556SMario Six #define DSO_P_IMPEDANCE_LOWER_Z		0xF
20*e4061556SMario Six 
21*e4061556SMario Six #define DSO_N_IMPEDANCE_HIGHEST_Z	0x0
22*e4061556SMario Six #define DSO_N_IMPEDANCE_MUCH_HIGHER_Z	0x8
23*e4061556SMario Six #define DSO_N_IMPEDANCE_HIGHER_Z	0xC
24*e4061556SMario Six #define DSO_N_IMPEDANCE_NOMINAL		0xE
25*e4061556SMario Six #define DSO_N_IMPEDANCE_LOWER_Z		0xF
26*e4061556SMario Six 
27*e4061556SMario Six #define ODT_TERMINATION_75_OHM		0
28*e4061556SMario Six #define ODT_TERMINATION_150_OHM		1
29*e4061556SMario Six 
30*e4061556SMario Six #define DDR_TYPE_DDR2_1_8_VOLT		0
31*e4061556SMario Six #define DDR_TYPE_DDR1_2_5_VOLT		1
32*e4061556SMario Six 
33*e4061556SMario Six #define MVREF_SEL_EXTERNAL		0
34*e4061556SMario Six #define MVREF_SEL_INTERNAL_GVDD		1
35*e4061556SMario Six 
36*e4061556SMario Six #define M_ODR_ENABLE			0
37*e4061556SMario Six #define M_ODR_DISABLE			1
38*e4061556SMario Six 
39*e4061556SMario Six /* CS config register */
40*e4061556SMario Six 
41*e4061556SMario Six #define AUTO_PRECHARGE_ENABLE	0x00800000
42*e4061556SMario Six #define AUTO_PRECHARGE_DISABLE	0x00000000
43*e4061556SMario Six 
44*e4061556SMario Six #define ODT_RD_NEVER		0x00000000
45*e4061556SMario Six #define ODT_RD_ONLY_CURRENT	0x00100000
46*e4061556SMario Six #define ODT_RD_ONLY_OTHER_CS	0x00200000
47*e4061556SMario Six #define ODT_RD_ONLY_OTHER_DIMM	0x00300000
48*e4061556SMario Six #define ODT_RD_ALL		0x00400000
49*e4061556SMario Six 
50*e4061556SMario Six #define ODT_WR_NEVER		0x00000000
51*e4061556SMario Six #define ODT_WR_ONLY_CURRENT	0x00010000
52*e4061556SMario Six #define ODT_WR_ONLY_OTHER_CS	0x00020000
53*e4061556SMario Six #define ODT_WR_ONLY_OTHER_DIMM	0x00030000
54*e4061556SMario Six #define ODT_WR_ALL		0x00040000
55*e4061556SMario Six 
56*e4061556SMario Six /* DDR SDRAM Clock Control register */
57*e4061556SMario Six 
58*e4061556SMario Six #define CLOCK_ADJUST_025	0x01000000
59*e4061556SMario Six #define CLOCK_ADJUST_05		0x02000000
60*e4061556SMario Six #define CLOCK_ADJUST_075	0x03000000
61*e4061556SMario Six #define CLOCK_ADJUST_1		0x04000000
62*e4061556SMario Six 
63*e4061556SMario Six #define CASLAT_20		0x3	/* CAS latency = 2.0 */
64*e4061556SMario Six #define CASLAT_25		0x4	/* CAS latency = 2.5 */
65*e4061556SMario Six #define CASLAT_30		0x5	/* CAS latency = 3.0 */
66*e4061556SMario Six #define CASLAT_35		0x6	/* CAS latency = 3.5 */
67*e4061556SMario Six #define CASLAT_40		0x7	/* CAS latency = 4.0 */
68*e4061556SMario Six #define CASLAT_45		0x8	/* CAS latency = 4.5 */
69*e4061556SMario Six #define CASLAT_50		0x9	/* CAS latency = 5.0 */
70*e4061556SMario Six #define CASLAT_55		0xa	/* CAS latency = 5.5 */
71*e4061556SMario Six #define CASLAT_60		0xb	/* CAS latency = 6.0 */
72*e4061556SMario Six #define CASLAT_65		0xc	/* CAS latency = 6.5 */
73*e4061556SMario Six #define CASLAT_70		0xd	/* CAS latency = 7.0 */
74*e4061556SMario Six #define CASLAT_75		0xe	/* CAS latency = 7.5 */
75*e4061556SMario Six #define CASLAT_80		0xf	/* CAS latency = 8.0 */
76*e4061556SMario Six 
77*e4061556SMario Six /* DDR SDRAM Timing Configuration 2 register */
78*e4061556SMario Six 
79*e4061556SMario Six #define READ_LAT_PLUS_1		0x0
80*e4061556SMario Six #define READ_LAT		0x2
81*e4061556SMario Six #define READ_LAT_PLUS_1_4	0x3
82*e4061556SMario Six #define READ_LAT_PLUS_1_2	0x4
83*e4061556SMario Six #define READ_LAT_PLUS_3_4	0x5
84*e4061556SMario Six #define READ_LAT_PLUS_5_4	0x7
85*e4061556SMario Six #define READ_LAT_PLUS_3_2	0x8
86*e4061556SMario Six #define READ_LAT_PLUS_7_4	0x9
87*e4061556SMario Six #define READ_LAT_PLUS_2		0xA
88*e4061556SMario Six #define READ_LAT_PLUS_9_4	0xB
89*e4061556SMario Six #define READ_LAT_PLUS_5_2	0xC
90*e4061556SMario Six #define READ_LAT_PLUS_11_4	0xD
91*e4061556SMario Six #define READ_LAT_PLUS_3		0xE
92*e4061556SMario Six #define READ_LAT_PLUS_13_4	0xF
93*e4061556SMario Six #define READ_LAT_PLUS_7_2	0x10
94*e4061556SMario Six #define READ_LAT_PLUS_15_4	0x11
95*e4061556SMario Six #define READ_LAT_PLUS_4		0x12
96*e4061556SMario Six #define READ_LAT_PLUS_17_4	0x13
97*e4061556SMario Six #define READ_LAT_PLUS_9_2	0x14
98*e4061556SMario Six #define READ_LAT_PLUS_19_4	0x15
99*e4061556SMario Six 
100*e4061556SMario Six #define CLOCK_DELAY_0		0x0
101*e4061556SMario Six #define CLOCK_DELAY_1_4		0x1
102*e4061556SMario Six #define CLOCK_DELAY_1_2		0x2
103*e4061556SMario Six #define CLOCK_DELAY_3_4		0x3
104*e4061556SMario Six #define CLOCK_DELAY_1		0x4
105*e4061556SMario Six #define CLOCK_DELAY_5_4		0x5
106*e4061556SMario Six #define CLOCK_DELAY_3_2		0x6
107*e4061556SMario Six 
108*e4061556SMario Six /* DDR SDRAM Control Configuration */
109*e4061556SMario Six 
110*e4061556SMario Six #define SREN_DISABLE	0x0
111*e4061556SMario Six #define SREN_ENABLE	0x1
112*e4061556SMario Six 
113*e4061556SMario Six #define ECC_DISABLE	0x0
114*e4061556SMario Six #define ECC_ENABLE	0x1
115*e4061556SMario Six 
116*e4061556SMario Six #define RD_DISABLE	0x0
117*e4061556SMario Six #define RD_ENABLE	0x1
118*e4061556SMario Six 
119*e4061556SMario Six #define TYPE_DDR1	0x2
120*e4061556SMario Six #define TYPE_DDR2	0x3
121*e4061556SMario Six 
122*e4061556SMario Six #define DYN_PWR_DISABLE		0x0
123*e4061556SMario Six #define DYN_PWR_ENABLE		0x1
124*e4061556SMario Six 
125*e4061556SMario Six #define DATA_BUS_WIDTH_16	0x1
126*e4061556SMario Six #define DATA_BUS_WIDTH_32	0x2
127*e4061556SMario Six 
128*e4061556SMario Six #define NCAP_DISABLE	0x0
129*e4061556SMario Six #define NCAP_ENABLE	0x1
130*e4061556SMario Six 
131*e4061556SMario Six #define TIMING_1T	0x0
132*e4061556SMario Six #define TIMING_2T	0x1
133*e4061556SMario Six 
134*e4061556SMario Six #define INTERLEAVE_NONE		0x0
135*e4061556SMario Six #define INTERLEAVE_1_AND_2	0x1
136*e4061556SMario Six 
137*e4061556SMario Six #define PRECHARGE_MA_10		0x0
138*e4061556SMario Six #define PRECHARGE_MA_8		0x1
139*e4061556SMario Six 
140*e4061556SMario Six #define STRENGTH_FULL		0x0
141*e4061556SMario Six #define STRENGTH_HALF		0x1
142*e4061556SMario Six 
143*e4061556SMario Six #define INITIALIZATION_DONT_BYPASS	0x0
144*e4061556SMario Six #define INITIALIZATION_BYPASS		0x1
145*e4061556SMario Six 
146*e4061556SMario Six /* DDR SDRAM Control Configuration 2 register */
147*e4061556SMario Six 
148*e4061556SMario Six #define MODE_NORMAL	0x0
149*e4061556SMario Six #define MODE_REFRESH	0x1
150*e4061556SMario Six 
151*e4061556SMario Six #define DLL_RESET_ENABLE	0x0
152*e4061556SMario Six #define DLL_RESET_DISABLE	0x1
153*e4061556SMario Six 
154*e4061556SMario Six #define DQS_TRUE	0x0
155*e4061556SMario Six 
156*e4061556SMario Six #define ODT_ASSERT_NEVER	0x0
157*e4061556SMario Six #define ODT_ASSERT_WRITES	0x1
158*e4061556SMario Six #define ODT_ASSERT_READS	0x2
159*e4061556SMario Six #define ODT_ASSERT_ALWAYS	0x3
160*e4061556SMario Six 
161*e4061556SMario Six #endif
162