18c2ecf20Sopenharmony_ci* Rockchip PX30 Clock and Reset Unit 28c2ecf20Sopenharmony_ci 38c2ecf20Sopenharmony_ciThe PX30 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: PMU for CRU should be "rockchip,px30-pmu-cru" 108c2ecf20Sopenharmony_ci- compatible: CRU should be "rockchip,px30-cru" 118c2ecf20Sopenharmony_ci- reg: physical base address of the controller and length of memory mapped 128c2ecf20Sopenharmony_ci region. 138c2ecf20Sopenharmony_ci- clocks: A list of phandle + clock-specifier pairs for the clocks listed 148c2ecf20Sopenharmony_ci in clock-names 158c2ecf20Sopenharmony_ci- clock-names: Should contain the following: 168c2ecf20Sopenharmony_ci - "xin24m" for both PMUCRU and CRU 178c2ecf20Sopenharmony_ci - "gpll" for CRU (sourced from PMUCRU) 188c2ecf20Sopenharmony_ci- #clock-cells: should be 1. 198c2ecf20Sopenharmony_ci- #reset-cells: should be 1. 208c2ecf20Sopenharmony_ci 218c2ecf20Sopenharmony_ciOptional Properties: 228c2ecf20Sopenharmony_ci 238c2ecf20Sopenharmony_ci- rockchip,grf: phandle to the syscon managing the "general register files" 248c2ecf20Sopenharmony_ci If missing, pll rates are not changeable, due to the missing pll lock status. 258c2ecf20Sopenharmony_ci 268c2ecf20Sopenharmony_ciEach clock is assigned an identifier and client nodes can use this identifier 278c2ecf20Sopenharmony_cito specify the clock which they consume. All available clocks are defined as 288c2ecf20Sopenharmony_cipreprocessor macros in the dt-bindings/clock/px30-cru.h headers and can be 298c2ecf20Sopenharmony_ciused in device tree sources. Similar macros exist for the reset sources in 308c2ecf20Sopenharmony_cithese files. 318c2ecf20Sopenharmony_ci 328c2ecf20Sopenharmony_ciExternal clocks: 338c2ecf20Sopenharmony_ci 348c2ecf20Sopenharmony_ciThere are several clocks that are generated outside the SoC. It is expected 358c2ecf20Sopenharmony_cithat they are defined using standard clock bindings with following 368c2ecf20Sopenharmony_ciclock-output-names: 378c2ecf20Sopenharmony_ci - "xin24m" - crystal input - required, 388c2ecf20Sopenharmony_ci - "xin32k" - rtc clock - optional, 398c2ecf20Sopenharmony_ci - "i2sx_clkin" - external I2S clock - optional, 408c2ecf20Sopenharmony_ci - "gmac_clkin" - external GMAC clock - optional 418c2ecf20Sopenharmony_ci 428c2ecf20Sopenharmony_ciExample: Clock controller node: 438c2ecf20Sopenharmony_ci 448c2ecf20Sopenharmony_ci pmucru: clock-controller@ff2bc000 { 458c2ecf20Sopenharmony_ci compatible = "rockchip,px30-pmucru"; 468c2ecf20Sopenharmony_ci reg = <0x0 0xff2bc000 0x0 0x1000>; 478c2ecf20Sopenharmony_ci #clock-cells = <1>; 488c2ecf20Sopenharmony_ci #reset-cells = <1>; 498c2ecf20Sopenharmony_ci }; 508c2ecf20Sopenharmony_ci 518c2ecf20Sopenharmony_ci cru: clock-controller@ff2b0000 { 528c2ecf20Sopenharmony_ci compatible = "rockchip,px30-cru"; 538c2ecf20Sopenharmony_ci reg = <0x0 0xff2b0000 0x0 0x1000>; 548c2ecf20Sopenharmony_ci rockchip,grf = <&grf>; 558c2ecf20Sopenharmony_ci #clock-cells = <1>; 568c2ecf20Sopenharmony_ci #reset-cells = <1>; 578c2ecf20Sopenharmony_ci }; 588c2ecf20Sopenharmony_ci 598c2ecf20Sopenharmony_ciExample: UART controller node that consumes the clock generated by the clock 608c2ecf20Sopenharmony_ci controller: 618c2ecf20Sopenharmony_ci 628c2ecf20Sopenharmony_ci uart0: serial@ff030000 { 638c2ecf20Sopenharmony_ci compatible = "rockchip,px30-uart", "snps,dw-apb-uart"; 648c2ecf20Sopenharmony_ci reg = <0x0 0xff030000 0x0 0x100>; 658c2ecf20Sopenharmony_ci interrupts = <GIC_SPI 15 IRQ_TYPE_LEVEL_HIGH>; 668c2ecf20Sopenharmony_ci clocks = <&pmucru SCLK_UART0_PMU>, <&pmucru PCLK_UART0_PMU>; 678c2ecf20Sopenharmony_ci clock-names = "baudclk", "apb_pclk"; 688c2ecf20Sopenharmony_ci reg-shift = <2>; 698c2ecf20Sopenharmony_ci reg-io-width = <4>; 708c2ecf20Sopenharmony_ci }; 71