18c2ecf20Sopenharmony_ci* Rockchip Power Domains 28c2ecf20Sopenharmony_ci 38c2ecf20Sopenharmony_ciRockchip processors include support for multiple power domains which can be 48c2ecf20Sopenharmony_cipowered up/down by software based on different application scenes to save power. 58c2ecf20Sopenharmony_ci 68c2ecf20Sopenharmony_ciRequired properties for power domain controller: 78c2ecf20Sopenharmony_ci- compatible: Should be one of the following. 88c2ecf20Sopenharmony_ci "rockchip,px30-power-controller" - for PX30 SoCs. 98c2ecf20Sopenharmony_ci "rockchip,rk3036-power-controller" - for RK3036 SoCs. 108c2ecf20Sopenharmony_ci "rockchip,rk3066-power-controller" - for RK3066 SoCs. 118c2ecf20Sopenharmony_ci "rockchip,rk3128-power-controller" - for RK3128 SoCs. 128c2ecf20Sopenharmony_ci "rockchip,rk3188-power-controller" - for RK3188 SoCs. 138c2ecf20Sopenharmony_ci "rockchip,rk3228-power-controller" - for RK3228 SoCs. 148c2ecf20Sopenharmony_ci "rockchip,rk3288-power-controller" - for RK3288 SoCs. 158c2ecf20Sopenharmony_ci "rockchip,rk3328-power-controller" - for RK3328 SoCs. 168c2ecf20Sopenharmony_ci "rockchip,rk3366-power-controller" - for RK3366 SoCs. 178c2ecf20Sopenharmony_ci "rockchip,rk3368-power-controller" - for RK3368 SoCs. 188c2ecf20Sopenharmony_ci "rockchip,rk3399-power-controller" - for RK3399 SoCs. 198c2ecf20Sopenharmony_ci- #power-domain-cells: Number of cells in a power-domain specifier. 208c2ecf20Sopenharmony_ci Should be 1 for multiple PM domains. 218c2ecf20Sopenharmony_ci- #address-cells: Should be 1. 228c2ecf20Sopenharmony_ci- #size-cells: Should be 0. 238c2ecf20Sopenharmony_ci 248c2ecf20Sopenharmony_ciRequired properties for power domain sub nodes: 258c2ecf20Sopenharmony_ci- reg: index of the power domain, should use macros in: 268c2ecf20Sopenharmony_ci "include/dt-bindings/power/px30-power.h" - for PX30 type power domain. 278c2ecf20Sopenharmony_ci "include/dt-bindings/power/rk3036-power.h" - for RK3036 type power domain. 288c2ecf20Sopenharmony_ci "include/dt-bindings/power/rk3066-power.h" - for RK3066 type power domain. 298c2ecf20Sopenharmony_ci "include/dt-bindings/power/rk3128-power.h" - for RK3128 type power domain. 308c2ecf20Sopenharmony_ci "include/dt-bindings/power/rk3188-power.h" - for RK3188 type power domain. 318c2ecf20Sopenharmony_ci "include/dt-bindings/power/rk3228-power.h" - for RK3228 type power domain. 328c2ecf20Sopenharmony_ci "include/dt-bindings/power/rk3288-power.h" - for RK3288 type power domain. 338c2ecf20Sopenharmony_ci "include/dt-bindings/power/rk3328-power.h" - for RK3328 type power domain. 348c2ecf20Sopenharmony_ci "include/dt-bindings/power/rk3366-power.h" - for RK3366 type power domain. 358c2ecf20Sopenharmony_ci "include/dt-bindings/power/rk3368-power.h" - for RK3368 type power domain. 368c2ecf20Sopenharmony_ci "include/dt-bindings/power/rk3399-power.h" - for RK3399 type power domain. 378c2ecf20Sopenharmony_ci- clocks (optional): phandles to clocks which need to be enabled while power domain 388c2ecf20Sopenharmony_ci switches state. 398c2ecf20Sopenharmony_ci- pm_qos (optional): phandles to qos blocks which need to be saved and restored 408c2ecf20Sopenharmony_ci while power domain switches state. 418c2ecf20Sopenharmony_ci 428c2ecf20Sopenharmony_ciQos Example: 438c2ecf20Sopenharmony_ci 448c2ecf20Sopenharmony_ci qos_gpu: qos_gpu@ffaf0000 { 458c2ecf20Sopenharmony_ci compatible ="syscon"; 468c2ecf20Sopenharmony_ci reg = <0x0 0xffaf0000 0x0 0x20>; 478c2ecf20Sopenharmony_ci }; 488c2ecf20Sopenharmony_ci 498c2ecf20Sopenharmony_ciExample: 508c2ecf20Sopenharmony_ci 518c2ecf20Sopenharmony_ci power: power-controller { 528c2ecf20Sopenharmony_ci compatible = "rockchip,rk3288-power-controller"; 538c2ecf20Sopenharmony_ci #power-domain-cells = <1>; 548c2ecf20Sopenharmony_ci #address-cells = <1>; 558c2ecf20Sopenharmony_ci #size-cells = <0>; 568c2ecf20Sopenharmony_ci 578c2ecf20Sopenharmony_ci pd_gpu { 588c2ecf20Sopenharmony_ci reg = <RK3288_PD_GPU>; 598c2ecf20Sopenharmony_ci clocks = <&cru ACLK_GPU>; 608c2ecf20Sopenharmony_ci pm_qos = <&qos_gpu>; 618c2ecf20Sopenharmony_ci }; 628c2ecf20Sopenharmony_ci }; 638c2ecf20Sopenharmony_ci 648c2ecf20Sopenharmony_ci power: power-controller { 658c2ecf20Sopenharmony_ci compatible = "rockchip,rk3368-power-controller"; 668c2ecf20Sopenharmony_ci #power-domain-cells = <1>; 678c2ecf20Sopenharmony_ci #address-cells = <1>; 688c2ecf20Sopenharmony_ci #size-cells = <0>; 698c2ecf20Sopenharmony_ci 708c2ecf20Sopenharmony_ci pd_gpu_1 { 718c2ecf20Sopenharmony_ci reg = <RK3368_PD_GPU_1>; 728c2ecf20Sopenharmony_ci clocks = <&cru ACLK_GPU_CFG>; 738c2ecf20Sopenharmony_ci }; 748c2ecf20Sopenharmony_ci }; 758c2ecf20Sopenharmony_ci 768c2ecf20Sopenharmony_ciExample 2: 778c2ecf20Sopenharmony_ci power: power-controller { 788c2ecf20Sopenharmony_ci compatible = "rockchip,rk3399-power-controller"; 798c2ecf20Sopenharmony_ci #power-domain-cells = <1>; 808c2ecf20Sopenharmony_ci #address-cells = <1>; 818c2ecf20Sopenharmony_ci #size-cells = <0>; 828c2ecf20Sopenharmony_ci 838c2ecf20Sopenharmony_ci pd_vio { 848c2ecf20Sopenharmony_ci #address-cells = <1>; 858c2ecf20Sopenharmony_ci #size-cells = <0>; 868c2ecf20Sopenharmony_ci reg = <RK3399_PD_VIO>; 878c2ecf20Sopenharmony_ci 888c2ecf20Sopenharmony_ci pd_vo { 898c2ecf20Sopenharmony_ci #address-cells = <1>; 908c2ecf20Sopenharmony_ci #size-cells = <0>; 918c2ecf20Sopenharmony_ci reg = <RK3399_PD_VO>; 928c2ecf20Sopenharmony_ci 938c2ecf20Sopenharmony_ci pd_vopb { 948c2ecf20Sopenharmony_ci reg = <RK3399_PD_VOPB>; 958c2ecf20Sopenharmony_ci }; 968c2ecf20Sopenharmony_ci 978c2ecf20Sopenharmony_ci pd_vopl { 988c2ecf20Sopenharmony_ci reg = <RK3399_PD_VOPL>; 998c2ecf20Sopenharmony_ci }; 1008c2ecf20Sopenharmony_ci }; 1018c2ecf20Sopenharmony_ci }; 1028c2ecf20Sopenharmony_ci }; 1038c2ecf20Sopenharmony_ci 1048c2ecf20Sopenharmony_ciNode of a device using power domains must have a power-domains property, 1058c2ecf20Sopenharmony_cicontaining a phandle to the power device node and an index specifying which 1068c2ecf20Sopenharmony_cipower domain to use. 1078c2ecf20Sopenharmony_ciThe index should use macros in: 1088c2ecf20Sopenharmony_ci "include/dt-bindings/power/px30-power.h" - for px30 type power domain. 1098c2ecf20Sopenharmony_ci "include/dt-bindings/power/rk3036-power.h" - for rk3036 type power domain. 1108c2ecf20Sopenharmony_ci "include/dt-bindings/power/rk3128-power.h" - for rk3128 type power domain. 1118c2ecf20Sopenharmony_ci "include/dt-bindings/power/rk3128-power.h" - for rk3228 type power domain. 1128c2ecf20Sopenharmony_ci "include/dt-bindings/power/rk3288-power.h" - for rk3288 type power domain. 1138c2ecf20Sopenharmony_ci "include/dt-bindings/power/rk3328-power.h" - for rk3328 type power domain. 1148c2ecf20Sopenharmony_ci "include/dt-bindings/power/rk3366-power.h" - for rk3366 type power domain. 1158c2ecf20Sopenharmony_ci "include/dt-bindings/power/rk3368-power.h" - for rk3368 type power domain. 1168c2ecf20Sopenharmony_ci "include/dt-bindings/power/rk3399-power.h" - for rk3399 type power domain. 1178c2ecf20Sopenharmony_ci 1188c2ecf20Sopenharmony_ciExample of the node using power domain: 1198c2ecf20Sopenharmony_ci 1208c2ecf20Sopenharmony_ci node { 1218c2ecf20Sopenharmony_ci /* ... */ 1228c2ecf20Sopenharmony_ci power-domains = <&power RK3288_PD_GPU>; 1238c2ecf20Sopenharmony_ci /* ... */ 1248c2ecf20Sopenharmony_ci }; 1258c2ecf20Sopenharmony_ci 1268c2ecf20Sopenharmony_ci node { 1278c2ecf20Sopenharmony_ci /* ... */ 1288c2ecf20Sopenharmony_ci power-domains = <&power RK3368_PD_GPU_1>; 1298c2ecf20Sopenharmony_ci /* ... */ 1308c2ecf20Sopenharmony_ci }; 1318c2ecf20Sopenharmony_ci 1328c2ecf20Sopenharmony_ci node { 1338c2ecf20Sopenharmony_ci /* ... */ 1348c2ecf20Sopenharmony_ci power-domains = <&power RK3399_PD_VOPB>; 1358c2ecf20Sopenharmony_ci /* ... */ 1368c2ecf20Sopenharmony_ci }; 137