xref: /freebsd/sys/contrib/device-tree/Bindings/devfreq/rk3399_dmc.txt (revision 8cc087a1eee9ec1ca9f7ac1e63ad51bdb5a682eb)
1c66ec88fSEmmanuel Vadot* Rockchip rk3399 DMC (Dynamic Memory Controller) device
2c66ec88fSEmmanuel Vadot
3c66ec88fSEmmanuel VadotRequired properties:
4c66ec88fSEmmanuel Vadot- compatible:		 Must be "rockchip,rk3399-dmc".
5c66ec88fSEmmanuel Vadot- devfreq-events:	 Node to get DDR loading, Refer to
6c66ec88fSEmmanuel Vadot			 Documentation/devicetree/bindings/devfreq/event/
7c66ec88fSEmmanuel Vadot			 rockchip-dfi.txt
8c66ec88fSEmmanuel Vadot- clocks:		 Phandles for clock specified in "clock-names" property
9c66ec88fSEmmanuel Vadot- clock-names :		 The name of clock used by the DFI, must be
10c66ec88fSEmmanuel Vadot			 "pclk_ddr_mon";
11354d7675SEmmanuel Vadot- operating-points-v2:	 Refer to Documentation/devicetree/bindings/opp/opp-v2.yaml
12c66ec88fSEmmanuel Vadot			 for details.
13c66ec88fSEmmanuel Vadot- center-supply:	 DMC supply node.
14c66ec88fSEmmanuel Vadot- status:		 Marks the node enabled/disabled.
152eb4d8dcSEmmanuel Vadot- rockchip,pmu:		 Phandle to the syscon managing the "PMU general register
162eb4d8dcSEmmanuel Vadot			 files".
17c66ec88fSEmmanuel Vadot
18c66ec88fSEmmanuel VadotOptional properties:
19c66ec88fSEmmanuel Vadot- interrupts:		 The CPU interrupt number. The interrupt specifier
20c66ec88fSEmmanuel Vadot			 format depends on the interrupt controller.
21c66ec88fSEmmanuel Vadot			 It should be a DCF interrupt. When DDR DVFS finishes
22c66ec88fSEmmanuel Vadot			 a DCF interrupt is triggered.
23c66ec88fSEmmanuel Vadot- rockchip,pmu:		 Phandle to the syscon managing the "PMU general register
24c66ec88fSEmmanuel Vadot			 files".
25c66ec88fSEmmanuel Vadot
26c66ec88fSEmmanuel VadotFollowing properties relate to DDR timing:
27c66ec88fSEmmanuel Vadot
28c66ec88fSEmmanuel Vadot- rockchip,dram_speed_bin :	  Value reference include/dt-bindings/clock/rk3399-ddr.h,
29c66ec88fSEmmanuel Vadot				  it selects the DDR3 cl-trp-trcd type. It must be
30c66ec88fSEmmanuel Vadot				  set according to "Speed Bin" in DDR3 datasheet,
31c66ec88fSEmmanuel Vadot				  DO NOT use a smaller "Speed Bin" than specified
32c66ec88fSEmmanuel Vadot				  for the DDR3 being used.
33c66ec88fSEmmanuel Vadot
34c66ec88fSEmmanuel Vadot- rockchip,pd_idle :		  Configure the PD_IDLE value. Defines the
35c66ec88fSEmmanuel Vadot				  power-down idle period in which memories are
36c66ec88fSEmmanuel Vadot				  placed into power-down mode if bus is idle
37c66ec88fSEmmanuel Vadot				  for PD_IDLE DFI clock cycles.
38c66ec88fSEmmanuel Vadot
39c66ec88fSEmmanuel Vadot- rockchip,sr_idle :		  Configure the SR_IDLE value. Defines the
40c66ec88fSEmmanuel Vadot				  self-refresh idle period in which memories are
41c66ec88fSEmmanuel Vadot				  placed into self-refresh mode if bus is idle
42c66ec88fSEmmanuel Vadot				  for SR_IDLE * 1024 DFI clock cycles (DFI
43c66ec88fSEmmanuel Vadot				  clocks freq is half of DRAM clock), default
44c66ec88fSEmmanuel Vadot				  value is "0".
45c66ec88fSEmmanuel Vadot
46c66ec88fSEmmanuel Vadot- rockchip,sr_mc_gate_idle :	  Defines the memory self-refresh and controller
47c66ec88fSEmmanuel Vadot				  clock gating idle period. Memories are placed
48c66ec88fSEmmanuel Vadot				  into self-refresh mode and memory controller
49c66ec88fSEmmanuel Vadot				  clock arg gating started if bus is idle for
50c66ec88fSEmmanuel Vadot				  sr_mc_gate_idle*1024 DFI clock cycles.
51c66ec88fSEmmanuel Vadot
52c66ec88fSEmmanuel Vadot- rockchip,srpd_lite_idle :	  Defines the self-refresh power down idle
53c66ec88fSEmmanuel Vadot				  period in which memories are placed into
54c66ec88fSEmmanuel Vadot				  self-refresh power down mode if bus is idle
55c66ec88fSEmmanuel Vadot				  for srpd_lite_idle * 1024 DFI clock cycles.
56c66ec88fSEmmanuel Vadot				  This parameter is for LPDDR4 only.
57c66ec88fSEmmanuel Vadot
58c66ec88fSEmmanuel Vadot- rockchip,standby_idle :	  Defines the standby idle period in which
59c66ec88fSEmmanuel Vadot				  memories are placed into self-refresh mode.
60c66ec88fSEmmanuel Vadot				  The controller, pi, PHY and DRAM clock will
61c66ec88fSEmmanuel Vadot				  be gated if bus is idle for standby_idle * DFI
62c66ec88fSEmmanuel Vadot				  clock cycles.
63c66ec88fSEmmanuel Vadot
64c66ec88fSEmmanuel Vadot- rockchip,dram_dll_dis_freq :	  Defines the DDR3 DLL bypass frequency in MHz.
65c66ec88fSEmmanuel Vadot				  When DDR frequency is less than DRAM_DLL_DISB_FREQ,
66c66ec88fSEmmanuel Vadot				  DDR3 DLL will be bypassed. Note: if DLL was bypassed,
67c66ec88fSEmmanuel Vadot				  the odt will also stop working.
68c66ec88fSEmmanuel Vadot
69c66ec88fSEmmanuel Vadot- rockchip,phy_dll_dis_freq :	  Defines the PHY dll bypass frequency in
70c66ec88fSEmmanuel Vadot				  MHz (Mega Hz). When DDR frequency is less than
71c66ec88fSEmmanuel Vadot				  DRAM_DLL_DISB_FREQ, PHY DLL will be bypassed.
72c66ec88fSEmmanuel Vadot				  Note: PHY DLL and PHY ODT are independent.
73c66ec88fSEmmanuel Vadot
74c66ec88fSEmmanuel Vadot- rockchip,ddr3_odt_dis_freq :	  When the DRAM type is DDR3, this parameter defines
75c66ec88fSEmmanuel Vadot				  the ODT disable frequency in MHz (Mega Hz).
76c66ec88fSEmmanuel Vadot				  when the DDR frequency is  less then ddr3_odt_dis_freq,
77c66ec88fSEmmanuel Vadot				  the ODT on the DRAM side and controller side are
78c66ec88fSEmmanuel Vadot				  both disabled.
79c66ec88fSEmmanuel Vadot
80c66ec88fSEmmanuel Vadot- rockchip,ddr3_drv :		  When the DRAM type is DDR3, this parameter defines
81c66ec88fSEmmanuel Vadot				  the DRAM side driver strength in ohms. Default
822eb4d8dcSEmmanuel Vadot				  value is 40.
83c66ec88fSEmmanuel Vadot
84c66ec88fSEmmanuel Vadot- rockchip,ddr3_odt :		  When the DRAM type is DDR3, this parameter defines
85c66ec88fSEmmanuel Vadot				  the DRAM side ODT strength in ohms. Default value
862eb4d8dcSEmmanuel Vadot				  is 120.
87c66ec88fSEmmanuel Vadot
88c66ec88fSEmmanuel Vadot- rockchip,phy_ddr3_ca_drv :	  When the DRAM type is DDR3, this parameter defines
89c66ec88fSEmmanuel Vadot				  the phy side CA line (incluing command line,
90c66ec88fSEmmanuel Vadot				  address line and clock line) driver strength.
912eb4d8dcSEmmanuel Vadot				  Default value is 40.
92c66ec88fSEmmanuel Vadot
93c66ec88fSEmmanuel Vadot- rockchip,phy_ddr3_dq_drv :	  When the DRAM type is DDR3, this parameter defines
94c66ec88fSEmmanuel Vadot				  the PHY side DQ line (including DQS/DQ/DM line)
952eb4d8dcSEmmanuel Vadot				  driver strength. Default value is 40.
96c66ec88fSEmmanuel Vadot
97c66ec88fSEmmanuel Vadot- rockchip,phy_ddr3_odt : 	  When the DRAM type is DDR3, this parameter defines
982eb4d8dcSEmmanuel Vadot				  the PHY side ODT strength. Default value is 240.
99c66ec88fSEmmanuel Vadot
100c66ec88fSEmmanuel Vadot- rockchip,lpddr3_odt_dis_freq : When the DRAM type is LPDDR3, this parameter defines
101c66ec88fSEmmanuel Vadot				  then ODT disable frequency in MHz (Mega Hz).
102c66ec88fSEmmanuel Vadot				  When DDR frequency is less then ddr3_odt_dis_freq,
103c66ec88fSEmmanuel Vadot				  the ODT on the DRAM side and controller side are
104c66ec88fSEmmanuel Vadot				  both disabled.
105c66ec88fSEmmanuel Vadot
106c66ec88fSEmmanuel Vadot- rockchip,lpddr3_drv :		  When the DRAM type is LPDDR3, this parameter defines
107c66ec88fSEmmanuel Vadot				  the DRAM side driver strength in ohms. Default
1082eb4d8dcSEmmanuel Vadot				  value is 34.
109c66ec88fSEmmanuel Vadot
110c66ec88fSEmmanuel Vadot- rockchip,lpddr3_odt :		  When the DRAM type is LPDDR3, this parameter defines
111c66ec88fSEmmanuel Vadot				  the DRAM side ODT strength in ohms. Default value
1122eb4d8dcSEmmanuel Vadot				  is 240.
113c66ec88fSEmmanuel Vadot
114c66ec88fSEmmanuel Vadot- rockchip,phy_lpddr3_ca_drv :	  When the DRAM type is LPDDR3, this parameter defines
115c66ec88fSEmmanuel Vadot				  the PHY side CA line (including command line,
116c66ec88fSEmmanuel Vadot				  address line and clock line) driver strength.
1172eb4d8dcSEmmanuel Vadot				  Default value is 40.
118c66ec88fSEmmanuel Vadot
119c66ec88fSEmmanuel Vadot- rockchip,phy_lpddr3_dq_drv :	  When the DRAM type is LPDDR3, this parameter defines
120c66ec88fSEmmanuel Vadot				  the PHY side DQ line (including DQS/DQ/DM line)
1212eb4d8dcSEmmanuel Vadot				  driver strength. Default value is 40.
122c66ec88fSEmmanuel Vadot
123c66ec88fSEmmanuel Vadot- rockchip,phy_lpddr3_odt : 	  When dram type is LPDDR3, this parameter define
1242eb4d8dcSEmmanuel Vadot				  the phy side odt strength, default value is 240.
125c66ec88fSEmmanuel Vadot
126c66ec88fSEmmanuel Vadot- rockchip,lpddr4_odt_dis_freq : When the DRAM type is LPDDR4, this parameter
127c66ec88fSEmmanuel Vadot				  defines the ODT disable frequency in
128c66ec88fSEmmanuel Vadot				  MHz (Mega Hz). When the DDR frequency is less then
129c66ec88fSEmmanuel Vadot				  ddr3_odt_dis_freq, the ODT on the DRAM side and
130c66ec88fSEmmanuel Vadot				  controller side are both disabled.
131c66ec88fSEmmanuel Vadot
132c66ec88fSEmmanuel Vadot- rockchip,lpddr4_drv :		  When the DRAM type is LPDDR4, this parameter defines
133c66ec88fSEmmanuel Vadot				  the DRAM side driver strength in ohms. Default
1342eb4d8dcSEmmanuel Vadot				  value is 60.
135c66ec88fSEmmanuel Vadot
136c66ec88fSEmmanuel Vadot- rockchip,lpddr4_dq_odt : 	  When the DRAM type is LPDDR4, this parameter defines
137c66ec88fSEmmanuel Vadot				  the DRAM side ODT on DQS/DQ line strength in ohms.
1382eb4d8dcSEmmanuel Vadot				  Default value is 40.
139c66ec88fSEmmanuel Vadot
140c66ec88fSEmmanuel Vadot- rockchip,lpddr4_ca_odt :	  When the DRAM type is LPDDR4, this parameter defines
141c66ec88fSEmmanuel Vadot				  the DRAM side ODT on CA line strength in ohms.
1422eb4d8dcSEmmanuel Vadot				  Default value is 40.
143c66ec88fSEmmanuel Vadot
144c66ec88fSEmmanuel Vadot- rockchip,phy_lpddr4_ca_drv :	  When the DRAM type is LPDDR4, this parameter defines
145c66ec88fSEmmanuel Vadot				  the PHY side CA line (including command address
1462eb4d8dcSEmmanuel Vadot				  line) driver strength. Default value is 40.
147c66ec88fSEmmanuel Vadot
148c66ec88fSEmmanuel Vadot- rockchip,phy_lpddr4_ck_cs_drv : When the DRAM type is LPDDR4, this parameter defines
149c66ec88fSEmmanuel Vadot				  the PHY side clock line and CS line driver
1502eb4d8dcSEmmanuel Vadot				  strength. Default value is 80.
151c66ec88fSEmmanuel Vadot
152c66ec88fSEmmanuel Vadot- rockchip,phy_lpddr4_dq_drv :	  When the DRAM type is LPDDR4, this parameter defines
153c66ec88fSEmmanuel Vadot				  the PHY side DQ line (including DQS/DQ/DM line)
1542eb4d8dcSEmmanuel Vadot				  driver strength. Default value is 80.
155c66ec88fSEmmanuel Vadot
156c66ec88fSEmmanuel Vadot- rockchip,phy_lpddr4_odt :	  When the DRAM type is LPDDR4, this parameter defines
1572eb4d8dcSEmmanuel Vadot				  the PHY side ODT strength. Default value is 60.
158c66ec88fSEmmanuel Vadot
159c66ec88fSEmmanuel VadotExample:
160c66ec88fSEmmanuel Vadot	dmc_opp_table: dmc_opp_table {
161c66ec88fSEmmanuel Vadot		compatible = "operating-points-v2";
162c66ec88fSEmmanuel Vadot
163c66ec88fSEmmanuel Vadot		opp00 {
164c66ec88fSEmmanuel Vadot			opp-hz = /bits/ 64 <300000000>;
165c66ec88fSEmmanuel Vadot			opp-microvolt = <900000>;
166c66ec88fSEmmanuel Vadot		};
167c66ec88fSEmmanuel Vadot		opp01 {
168c66ec88fSEmmanuel Vadot			opp-hz = /bits/ 64 <666000000>;
169c66ec88fSEmmanuel Vadot			opp-microvolt = <900000>;
170c66ec88fSEmmanuel Vadot		};
171c66ec88fSEmmanuel Vadot	};
172c66ec88fSEmmanuel Vadot
173c66ec88fSEmmanuel Vadot	dmc: dmc {
174c66ec88fSEmmanuel Vadot		compatible = "rockchip,rk3399-dmc";
175c66ec88fSEmmanuel Vadot		devfreq-events = <&dfi>;
176c66ec88fSEmmanuel Vadot		interrupts = <GIC_SPI 1 IRQ_TYPE_LEVEL_HIGH>;
177*8cc087a1SEmmanuel Vadot		clocks = <&cru SCLK_DDRC>;
178c66ec88fSEmmanuel Vadot		clock-names = "dmc_clk";
179c66ec88fSEmmanuel Vadot		operating-points-v2 = <&dmc_opp_table>;
180c66ec88fSEmmanuel Vadot		center-supply = <&ppvar_centerlogic>;
181c66ec88fSEmmanuel Vadot		upthreshold = <15>;
182c66ec88fSEmmanuel Vadot		downdifferential = <10>;
183c66ec88fSEmmanuel Vadot		rockchip,ddr3_speed_bin = <21>;
184c66ec88fSEmmanuel Vadot		rockchip,pd_idle = <0x40>;
185c66ec88fSEmmanuel Vadot		rockchip,sr_idle = <0x2>;
186c66ec88fSEmmanuel Vadot		rockchip,sr_mc_gate_idle = <0x3>;
187c66ec88fSEmmanuel Vadot		rockchip,srpd_lite_idle	= <0x4>;
188c66ec88fSEmmanuel Vadot		rockchip,standby_idle = <0x2000>;
189c66ec88fSEmmanuel Vadot		rockchip,dram_dll_dis_freq = <300>;
190c66ec88fSEmmanuel Vadot		rockchip,phy_dll_dis_freq = <125>;
191c66ec88fSEmmanuel Vadot		rockchip,auto_pd_dis_freq = <666>;
192c66ec88fSEmmanuel Vadot		rockchip,ddr3_odt_dis_freq = <333>;
1932eb4d8dcSEmmanuel Vadot		rockchip,ddr3_drv = <40>;
1942eb4d8dcSEmmanuel Vadot		rockchip,ddr3_odt = <120>;
1952eb4d8dcSEmmanuel Vadot		rockchip,phy_ddr3_ca_drv = <40>;
1962eb4d8dcSEmmanuel Vadot		rockchip,phy_ddr3_dq_drv = <40>;
1972eb4d8dcSEmmanuel Vadot		rockchip,phy_ddr3_odt = <240>;
198c66ec88fSEmmanuel Vadot		rockchip,lpddr3_odt_dis_freq = <333>;
1992eb4d8dcSEmmanuel Vadot		rockchip,lpddr3_drv = <34>;
2002eb4d8dcSEmmanuel Vadot		rockchip,lpddr3_odt = <240>;
2012eb4d8dcSEmmanuel Vadot		rockchip,phy_lpddr3_ca_drv = <40>;
2022eb4d8dcSEmmanuel Vadot		rockchip,phy_lpddr3_dq_drv = <40>;
2032eb4d8dcSEmmanuel Vadot		rockchip,phy_lpddr3_odt = <240>;
204c66ec88fSEmmanuel Vadot		rockchip,lpddr4_odt_dis_freq = <333>;
2052eb4d8dcSEmmanuel Vadot		rockchip,lpddr4_drv = <60>;
2062eb4d8dcSEmmanuel Vadot		rockchip,lpddr4_dq_odt = <40>;
2072eb4d8dcSEmmanuel Vadot		rockchip,lpddr4_ca_odt = <40>;
2082eb4d8dcSEmmanuel Vadot		rockchip,phy_lpddr4_ca_drv = <40>;
2092eb4d8dcSEmmanuel Vadot		rockchip,phy_lpddr4_ck_cs_drv = <80>;
2102eb4d8dcSEmmanuel Vadot		rockchip,phy_lpddr4_dq_drv = <80>;
2112eb4d8dcSEmmanuel Vadot		rockchip,phy_lpddr4_odt = <60>;
212c66ec88fSEmmanuel Vadot	};
213