1*344c8376SSimon GlassRockchip Dynamic Memory Controller Driver 2*344c8376SSimon GlassRequired properties: 3*344c8376SSimon Glass- compatible: "rockchip,rk3288-dmc", "syscon" 4*344c8376SSimon Glass- rockchip,cru: this driver should access cru regs, so need get cru here 5*344c8376SSimon Glass- rockchip,grf: this driver should access grf regs, so need get grf here 6*344c8376SSimon Glass- rockchip,pmu: this driver should access pmu regs, so need get pmu here 7*344c8376SSimon Glass- rockchip,sgrf: this driver should access sgrf regs, so need get sgrf here 8*344c8376SSimon Glass- rockchip,noc: this driver should access noc regs, so need get noc here 9*344c8376SSimon Glass- reg: dynamic ram protocol controller(PCTL) address and phy controller(PHYCTL) address 10*344c8376SSimon Glass- clock: must include clock specifiers corresponding to entries in the clock-names property. 11*344c8376SSimon Glass- clock-output-names: from common clock binding to override the default output clock name 12*344c8376SSimon Glass Must contain 13*344c8376SSimon Glass pclk_ddrupctl0: support clock for access protocol controller registers of channel 0 14*344c8376SSimon Glass pclk_publ0: support clock for access phy controller registers of channel 0 15*344c8376SSimon Glass pclk_ddrupctl1: support clock for access protocol controller registers of channel 1 16*344c8376SSimon Glass pclk_publ1: support clock for access phy controller registers of channel 1 17*344c8376SSimon Glass arm_clk: for get arm frequency 18*344c8376SSimon Glass-logic-supply: this driver should adjust VDD_LOGIC according to dmc frequency, so need get logic-supply here 19*344c8376SSimon Glass-timings: 20*344c8376SSimon Glass Must contain 21*344c8376SSimon Glass rockchip,odt-disable-freq: if ddr clock frequency low than odt-disable-freq,this driver should disable DDR ODT 22*344c8376SSimon Glass rockchip,dll-disable-freq: if ddr clock frequency low than dll-disable-freq,this driver should disable DDR DLL 23*344c8376SSimon Glass rockchip,sr-enable-freq: if ddr clock frequency high than sr-enable-freq,this driver should enable the automatic self refresh function 24*344c8376SSimon Glass rockchip,pd-enable-freq: if ddr clock frequency high than pd-enable-freq,this driver should enable the automatic power down function 25*344c8376SSimon Glass rockchip,auto-self-refresh-cnt: Self Refresh idle period. Memories are placed into Self-Refresh mode if the NIF is idle in Access state for auto-self-refresh-cnt * 32 * n_clk cycles.The automatic self refresh function is disabled when auto-self-refresh-cnt=0. 26*344c8376SSimon Glass rockchip,auto-power-down-cnt: Power-down idle period. Memories are placed into power-down mode if the NIF is idle for auto-power-down-cnt n_clk cycles.The automatic power down function is disabled when auto-power-down-cnt=0. 27*344c8376SSimon Glass rockchip,ddr-speed-bin: DDR3 type,AC timing parameters from the memory data-sheet 28*344c8376SSimon Glass 0.DDR3_800D (5-5-5) 29*344c8376SSimon Glass 1.DDR3_800E (6-6-6) 30*344c8376SSimon Glass 2.DDR3_1066E (6-6-6) 31*344c8376SSimon Glass 3.DDR3_1066F (7-7-7) 32*344c8376SSimon Glass 4.DDR3_1066G (8-8-8) 33*344c8376SSimon Glass 5.DDR3_1333F (7-7-7) 34*344c8376SSimon Glass 6.DDR3_1333G (8-8-8) 35*344c8376SSimon Glass 7.DDR3_1333H (9-9-9) 36*344c8376SSimon Glass 8.DDR3_1333J (10-10-10) 37*344c8376SSimon Glass 9.DDR3_1600G (8-8-8) 38*344c8376SSimon Glass 10.DDR3_1600H (9-9-9) 39*344c8376SSimon Glass 11.DDR3_1600J (10-10-10) 40*344c8376SSimon Glass 12.DDR3_1600K (11-11-11) 41*344c8376SSimon Glass 13.DDR3_1866J (10-10-10) 42*344c8376SSimon Glass 14.DDR3_1866K (11-11-11) 43*344c8376SSimon Glass 15.DDR3_1866L (12-12-12) 44*344c8376SSimon Glass 16.DDR3_1866M (13-13-13) 45*344c8376SSimon Glass 17.DDR3_2133K (11-11-11) 46*344c8376SSimon Glass 18.DDR3_2133L (12-12-12) 47*344c8376SSimon Glass 19.DDR3_2133M (13-13-13) 48*344c8376SSimon Glass 20.DDR3_2133N (14-14-14) 49*344c8376SSimon Glass 21.DDR3_DEFAULT 50*344c8376SSimon Glass rockchip,trcd: tRCD,AC timing parameters from the memory data-sheet 51*344c8376SSimon Glass rockchip,trp: tRP,AC timing parameters from the memory data-sheet 52*344c8376SSimon Glass-rockchip,num-channels: number of SDRAM channels (1 or 2) 53*344c8376SSimon Glass-rockchip,pctl-timing: parameters for the SDRAM setup, in this order: 54*344c8376SSimon Glass togcnt1u 55*344c8376SSimon Glass tinit 56*344c8376SSimon Glass trsth 57*344c8376SSimon Glass togcnt100n 58*344c8376SSimon Glass trefi 59*344c8376SSimon Glass tmrd 60*344c8376SSimon Glass trfc 61*344c8376SSimon Glass trp 62*344c8376SSimon Glass trtw 63*344c8376SSimon Glass tal 64*344c8376SSimon Glass tcl 65*344c8376SSimon Glass tcwl 66*344c8376SSimon Glass tras 67*344c8376SSimon Glass trc 68*344c8376SSimon Glass trcd 69*344c8376SSimon Glass trrd 70*344c8376SSimon Glass trtp 71*344c8376SSimon Glass twr 72*344c8376SSimon Glass twtr 73*344c8376SSimon Glass texsr 74*344c8376SSimon Glass txp 75*344c8376SSimon Glass txpdll 76*344c8376SSimon Glass tzqcs 77*344c8376SSimon Glass tzqcsi 78*344c8376SSimon Glass tdqs 79*344c8376SSimon Glass tcksre 80*344c8376SSimon Glass tcksrx 81*344c8376SSimon Glass tcke 82*344c8376SSimon Glass tmod 83*344c8376SSimon Glass trstl 84*344c8376SSimon Glass tzqcl 85*344c8376SSimon Glass tmrr 86*344c8376SSimon Glass tckesr 87*344c8376SSimon Glass tdpd 88*344c8376SSimon Glass-rockchip,phy-timing: PHY timing information in this order: 89*344c8376SSimon Glass dtpr0 90*344c8376SSimon Glass dtpr1 91*344c8376SSimon Glass dtpr2 92*344c8376SSimon Glass mr0..mr3 93*344c8376SSimon Glass-rockchip,sdram-channel: SDRAM channel information, each 8 bits. Both channels 94*344c8376SSimon Glasswill be set up the same. The parameters are in this order: 95*344c8376SSimon Glass rank 96*344c8376SSimon Glass col 97*344c8376SSimon Glass bk 98*344c8376SSimon Glass bw 99*344c8376SSimon Glass dbw 100*344c8376SSimon Glass row_3_4 101*344c8376SSimon Glass cs0_row 102*344c8376SSimon Glass cs1_row 103*344c8376SSimon Glass- rockchip,sdram-params: SDRAM base parameters, in this order: 104*344c8376SSimon Glass NOC timing - value for ddrtiming register 105*344c8376SSimon Glass NOC activate - value for activate register 106*344c8376SSimon Glass ddrconf - value for ddrconf register 107*344c8376SSimon Glass DDR frequency in MHz 108*344c8376SSimon Glass DRAM type (3=DDR3, 6=LPDDR3) 109*344c8376SSimon Glass stride - stride value for soc_con2 register 110*344c8376SSimon Glass odt - 1 to enable DDR ODT, 0 to disable 111*344c8376SSimon Glass 112*344c8376SSimon GlassExample: 113*344c8376SSimon Glass dmc: dmc@ff610000 { 114*344c8376SSimon Glass compatible = "rockchip,rk3288-dmc", "syscon"; 115*344c8376SSimon Glass rockchip,cru = <&cru>; 116*344c8376SSimon Glass rockchip,grf = <&grf>; 117*344c8376SSimon Glass rockchip,pmu = <&pmu>; 118*344c8376SSimon Glass rockchip,sgrf = <&sgrf>; 119*344c8376SSimon Glass rockchip,noc = <&noc>; 120*344c8376SSimon Glass reg = <0xff610000 0x3fc 121*344c8376SSimon Glass 0xff620000 0x294 122*344c8376SSimon Glass 0xff630000 0x3fc 123*344c8376SSimon Glass 0xff640000 0x294>; 124*344c8376SSimon Glass clocks = <&cru PCLK_DDRUPCTL0>, <&cru PCLK_PUBL0>, 125*344c8376SSimon Glass <&cru PCLK_DDRUPCTL1>, <&cru PCLK_PUBL1>, 126*344c8376SSimon Glass <&cru ARMCLK>; 127*344c8376SSimon Glass clock-names = "pclk_ddrupctl0", "pclk_publ0", 128*344c8376SSimon Glass "pclk_ddrupctl1", "pclk_publ1", 129*344c8376SSimon Glass "arm_clk"; 130*344c8376SSimon Glass }; 131*344c8376SSimon Glass 132*344c8376SSimon Glass &dmc { 133*344c8376SSimon Glass logic-supply = <&vdd_logic>; 134*344c8376SSimon Glass timings { 135*344c8376SSimon Glass rockchip,odt-disable-freq = <333000000>; 136*344c8376SSimon Glass rockchip,dll-disable-freq = <333000000>; 137*344c8376SSimon Glass rockchip,sr-enable-freq = <333000000>; 138*344c8376SSimon Glass rockchip,pd-enable-freq = <666000000>; 139*344c8376SSimon Glass rockchip,auto-self-refresh-cnt = <0>; 140*344c8376SSimon Glass rockchip,auto-power-down-cnt = <64>; 141*344c8376SSimon Glass rockchip,ddr-speed-bin = <21>; 142*344c8376SSimon Glass rockchip,trcd = <10>; 143*344c8376SSimon Glass rockchip,trp = <10>; 144*344c8376SSimon Glass }; 145*344c8376SSimon Glass rockchip,num-channels = <2>; 146*344c8376SSimon Glass rockchip,pctl-timing = <0x29a 0x1f4 0xc8 0x42 0x4e 0x4 0xea 0xa 147*344c8376SSimon Glass 0x5 0x0 0xa 0x7 0x19 0x24 0xa 0x7 148*344c8376SSimon Glass 0x5 0xa 0x5 0x200 0x5 0x10 0x40 0x0 149*344c8376SSimon Glass 0x1 0x7 0x7 0x4 0xc 0x43 0x100 0x0 150*344c8376SSimon Glass 0x5 0x0>; 151*344c8376SSimon Glass rockchip,phy-timing = <0x48f9aab4 0xea0910 0x1002c200 152*344c8376SSimon Glass 0xa60 0x40 0x10 0x0>; 153*344c8376SSimon Glass rockchip,sdram-channel = /bits/ 8 <0x1 0xa 0x3 0x2 0x1 0x0 0xf 0xf>; 154*344c8376SSimon Glass rockchip,sdram-params = <0x30B25564 0x627 3 666000000 3 9 1>; 155*344c8376SSimon Glass }; 156