18c2ecf20Sopenharmony_ci* Rockchip RK3188/RK3066 Clock and Reset Unit
28c2ecf20Sopenharmony_ci
38c2ecf20Sopenharmony_ciThe RK3188/RK3066 clock controller generates and supplies clock to various
48c2ecf20Sopenharmony_cicontrollers within the SoC and also implements a reset controller for SoC
58c2ecf20Sopenharmony_ciperipherals.
68c2ecf20Sopenharmony_ci
78c2ecf20Sopenharmony_ciRequired Properties:
88c2ecf20Sopenharmony_ci
98c2ecf20Sopenharmony_ci- compatible: should be "rockchip,rk3188-cru", "rockchip,rk3188a-cru" or
108c2ecf20Sopenharmony_ci			"rockchip,rk3066a-cru"
118c2ecf20Sopenharmony_ci- reg: physical base address of the controller and length of memory mapped
128c2ecf20Sopenharmony_ci  region.
138c2ecf20Sopenharmony_ci- #clock-cells: should be 1.
148c2ecf20Sopenharmony_ci- #reset-cells: should be 1.
158c2ecf20Sopenharmony_ci
168c2ecf20Sopenharmony_ciOptional Properties:
178c2ecf20Sopenharmony_ci
188c2ecf20Sopenharmony_ci- rockchip,grf: phandle to the syscon managing the "general register files"
198c2ecf20Sopenharmony_ci  If missing pll rates are not changeable, due to the missing pll lock status.
208c2ecf20Sopenharmony_ci
218c2ecf20Sopenharmony_ciEach clock is assigned an identifier and client nodes can use this identifier
228c2ecf20Sopenharmony_cito specify the clock which they consume. All available clocks are defined as
238c2ecf20Sopenharmony_cipreprocessor macros in the dt-bindings/clock/rk3188-cru.h and
248c2ecf20Sopenharmony_cidt-bindings/clock/rk3066-cru.h headers and can be used in device tree sources.
258c2ecf20Sopenharmony_ciSimilar macros exist for the reset sources in these files.
268c2ecf20Sopenharmony_ci
278c2ecf20Sopenharmony_ciExternal clocks:
288c2ecf20Sopenharmony_ci
298c2ecf20Sopenharmony_ciThere are several clocks that are generated outside the SoC. It is expected
308c2ecf20Sopenharmony_cithat they are defined using standard clock bindings with following
318c2ecf20Sopenharmony_ciclock-output-names:
328c2ecf20Sopenharmony_ci - "xin24m" - crystal input - required,
338c2ecf20Sopenharmony_ci - "xin32k" - rtc clock - optional,
348c2ecf20Sopenharmony_ci - "xin27m" - 27mhz crystal input on rk3066 - optional,
358c2ecf20Sopenharmony_ci - "ext_hsadc" - external HSADC clock - optional,
368c2ecf20Sopenharmony_ci - "ext_cif0" - external camera clock - optional,
378c2ecf20Sopenharmony_ci - "ext_rmii" - external RMII clock - optional,
388c2ecf20Sopenharmony_ci - "ext_jtag" - externalJTAG clock - optional
398c2ecf20Sopenharmony_ci
408c2ecf20Sopenharmony_ciExample: Clock controller node:
418c2ecf20Sopenharmony_ci
428c2ecf20Sopenharmony_ci	cru: cru@20000000 {
438c2ecf20Sopenharmony_ci		compatible = "rockchip,rk3188-cru";
448c2ecf20Sopenharmony_ci		reg = <0x20000000 0x1000>;
458c2ecf20Sopenharmony_ci		rockchip,grf = <&grf>;
468c2ecf20Sopenharmony_ci
478c2ecf20Sopenharmony_ci		#clock-cells = <1>;
488c2ecf20Sopenharmony_ci		#reset-cells = <1>;
498c2ecf20Sopenharmony_ci	};
508c2ecf20Sopenharmony_ci
518c2ecf20Sopenharmony_ciExample: UART controller node that consumes the clock generated by the clock
528c2ecf20Sopenharmony_ci  controller:
538c2ecf20Sopenharmony_ci
548c2ecf20Sopenharmony_ci	uart0: serial@10124000 {
558c2ecf20Sopenharmony_ci		compatible = "snps,dw-apb-uart";
568c2ecf20Sopenharmony_ci		reg = <0x10124000 0x400>;
578c2ecf20Sopenharmony_ci		interrupts = <GIC_SPI 34 IRQ_TYPE_LEVEL_HIGH>;
588c2ecf20Sopenharmony_ci		reg-shift = <2>;
598c2ecf20Sopenharmony_ci		reg-io-width = <1>;
608c2ecf20Sopenharmony_ci		clocks = <&cru SCLK_UART0>;
618c2ecf20Sopenharmony_ci	};
62