1*c66ec88fSEmmanuel Vadot* Rockchip RK3399 Clock and Reset Unit 2*c66ec88fSEmmanuel Vadot 3*c66ec88fSEmmanuel VadotThe RK3399 clock controller generates and supplies clock to various 4*c66ec88fSEmmanuel Vadotcontrollers within the SoC and also implements a reset controller for SoC 5*c66ec88fSEmmanuel Vadotperipherals. 6*c66ec88fSEmmanuel Vadot 7*c66ec88fSEmmanuel VadotRequired Properties: 8*c66ec88fSEmmanuel Vadot 9*c66ec88fSEmmanuel Vadot- compatible: PMU for CRU should be "rockchip,rk3399-pmucru" 10*c66ec88fSEmmanuel Vadot- compatible: CRU should be "rockchip,rk3399-cru" 11*c66ec88fSEmmanuel Vadot- reg: physical base address of the controller and length of memory mapped 12*c66ec88fSEmmanuel Vadot region. 13*c66ec88fSEmmanuel Vadot- #clock-cells: should be 1. 14*c66ec88fSEmmanuel Vadot- #reset-cells: should be 1. 15*c66ec88fSEmmanuel Vadot 16*c66ec88fSEmmanuel VadotOptional Properties: 17*c66ec88fSEmmanuel Vadot 18*c66ec88fSEmmanuel Vadot- rockchip,grf: phandle to the syscon managing the "general register files". 19*c66ec88fSEmmanuel Vadot It is used for GRF muxes, if missing any muxes present in the GRF will not 20*c66ec88fSEmmanuel Vadot be available. 21*c66ec88fSEmmanuel Vadot 22*c66ec88fSEmmanuel VadotEach clock is assigned an identifier and client nodes can use this identifier 23*c66ec88fSEmmanuel Vadotto specify the clock which they consume. All available clocks are defined as 24*c66ec88fSEmmanuel Vadotpreprocessor macros in the dt-bindings/clock/rk3399-cru.h headers and can be 25*c66ec88fSEmmanuel Vadotused in device tree sources. Similar macros exist for the reset sources in 26*c66ec88fSEmmanuel Vadotthese files. 27*c66ec88fSEmmanuel Vadot 28*c66ec88fSEmmanuel VadotExternal clocks: 29*c66ec88fSEmmanuel Vadot 30*c66ec88fSEmmanuel VadotThere are several clocks that are generated outside the SoC. It is expected 31*c66ec88fSEmmanuel Vadotthat they are defined using standard clock bindings with following 32*c66ec88fSEmmanuel Vadotclock-output-names: 33*c66ec88fSEmmanuel Vadot - "xin24m" - crystal input - required, 34*c66ec88fSEmmanuel Vadot - "xin32k" - rtc clock - optional, 35*c66ec88fSEmmanuel Vadot - "clkin_gmac" - external GMAC clock - optional, 36*c66ec88fSEmmanuel Vadot - "clkin_i2s" - external I2S clock - optional, 37*c66ec88fSEmmanuel Vadot - "pclkin_cif" - external ISP clock - optional, 38*c66ec88fSEmmanuel Vadot - "clk_usbphy0_480m" - output clock of the pll in the usbphy0 39*c66ec88fSEmmanuel Vadot - "clk_usbphy1_480m" - output clock of the pll in the usbphy1 40*c66ec88fSEmmanuel Vadot 41*c66ec88fSEmmanuel VadotExample: Clock controller node: 42*c66ec88fSEmmanuel Vadot 43*c66ec88fSEmmanuel Vadot pmucru: pmu-clock-controller@ff750000 { 44*c66ec88fSEmmanuel Vadot compatible = "rockchip,rk3399-pmucru"; 45*c66ec88fSEmmanuel Vadot reg = <0x0 0xff750000 0x0 0x1000>; 46*c66ec88fSEmmanuel Vadot #clock-cells = <1>; 47*c66ec88fSEmmanuel Vadot #reset-cells = <1>; 48*c66ec88fSEmmanuel Vadot }; 49*c66ec88fSEmmanuel Vadot 50*c66ec88fSEmmanuel Vadot cru: clock-controller@ff760000 { 51*c66ec88fSEmmanuel Vadot compatible = "rockchip,rk3399-cru"; 52*c66ec88fSEmmanuel Vadot reg = <0x0 0xff760000 0x0 0x1000>; 53*c66ec88fSEmmanuel Vadot #clock-cells = <1>; 54*c66ec88fSEmmanuel Vadot #reset-cells = <1>; 55*c66ec88fSEmmanuel Vadot }; 56*c66ec88fSEmmanuel Vadot 57*c66ec88fSEmmanuel VadotExample: UART controller node that consumes the clock generated by the clock 58*c66ec88fSEmmanuel Vadot controller: 59*c66ec88fSEmmanuel Vadot 60*c66ec88fSEmmanuel Vadot uart0: serial@ff1a0000 { 61*c66ec88fSEmmanuel Vadot compatible = "rockchip,rk3399-uart", "snps,dw-apb-uart"; 62*c66ec88fSEmmanuel Vadot reg = <0x0 0xff180000 0x0 0x100>; 63*c66ec88fSEmmanuel Vadot clocks = <&cru SCLK_UART0>, <&cru PCLK_UART0>; 64*c66ec88fSEmmanuel Vadot clock-names = "baudclk", "apb_pclk"; 65*c66ec88fSEmmanuel Vadot interrupts = <GIC_SPI 99 IRQ_TYPE_LEVEL_HIGH>; 66*c66ec88fSEmmanuel Vadot reg-shift = <2>; 67*c66ec88fSEmmanuel Vadot reg-io-width = <4>; 68*c66ec88fSEmmanuel Vadot }; 69