soc: rockchip: power-domain: add rk3568 powerdomains
Subsystems (2)
v2 cover soc: rockchip: power-domain: add rk3568 powerdomains
Support power domain function for RK3568 Soc.
Change in V2:
[PATCH v2 1/3]: No change.
[PATCH v2 2/3]: Fix up yaml code styles.
[PATCH v2 3/3]: No change.
Elaine Zhang (3):
dt-bindings: add power-domain header for RK3568 SoCs
dt-bindings: Convert the rockchip power_domain to YAML and extend
soc: rockchip: power-domain: add rk3568 powerdomains
.../bindings/soc/rockchip/power_domain.txt | 136 --------- .../rockchip/rockchip,power-controller.yaml | 259 ++++++++++++++++++ drivers/soc/rockchip/pm_domains.c | 31 +++ include/dt-bindings/power/rk3568-power.h | 32 +++ 4 files changed, 322 insertions(+), 136 deletions(-) delete mode 100644 Documentation/devicetree/bindings/soc/rockchip/power_domain.txt create mode 100644 Documentation/devicetree/bindings/soc/rockchip/rockchip,power-controller.yaml create mode 100644 include/dt-bindings/power/rk3568-power.h
Signature · 9 lines
2.17.1 _______________________________________________ Linux-rockchip mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-rockchip
PATCH v2 1/3 dt-bindings: add power-domain header for RK3568 SoCs
According to a description from TRM, add all the power domains
--- include/dt-bindings/power/rk3568-power.h | 32 ++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 include/dt-bindings/power/rk3568-power.h
include/dt-bindings/power/rk3568-power.h new file +32 -0
@@ -0,0 +1,32 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#ifndef __DT_BINDINGS_POWER_RK3568_POWER_H__ +#define __DT_BINDINGS_POWER_RK3568_POWER_H__ + +/* VD_CORE */ +#define RK3568_PD_CPU_0 0 +#define RK3568_PD_CPU_1 1 +#define RK3568_PD_CPU_2 2 +#define RK3568_PD_CPU_3 3 +#define RK3568_PD_CORE_ALIVE 4 + +/* VD_PMU */ +#define RK3568_PD_PMU 5 + +/* VD_NPU */ +#define RK3568_PD_NPU 6 + +/* VD_GPU */ +#define RK3568_PD_GPU 7 + +/* VD_LOGIC */ +#define RK3568_PD_VI 8 +#define RK3568_PD_VO 9 +#define RK3568_PD_RGA 10 +#define RK3568_PD_VPU 11 +#define RK3568_PD_CENTER 12 +#define RK3568_PD_RKVDEC 13 +#define RK3568_PD_RKVENC 14 +#define RK3568_PD_PIPE 15 +#define RK3568_PD_LOGIC_ALIVE 16 + +#endif
Signature · 9 lines
2.17.1 _______________________________________________ Linux-rockchip mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-rockchip
PATCH v2 2/3 dt-bindings: Convert the rockchip power_domain to YAML and extend
In reply to Elaine ZhangThis converts the rockchip power domain family bindings to YAML schema, and add binding documentation for the power domains found on Rockchip RK3568 SoCs.
--- .../bindings/soc/rockchip/power_domain.txt | 136 --------- .../rockchip/rockchip,power-controller.yaml | 259 ++++++++++++++++++ 2 files changed, 259 insertions(+), 136 deletions(-) delete mode 100644 Documentation/devicetree/bindings/soc/rockchip/power_domain.txt create mode 100644 Documentation/devicetree/bindings/soc/rockchip/rockchip,power-controller.yaml
Documentation/devicetree/bindings/soc/rockchip/power_domain.txt deleted +0 -136
@@ -1,136 +0,0 @@ -* Rockchip Power Domains - -Rockchip processors include support for multiple power domains which can be -powered up/down by software based on different application scenes to save power. - -Required properties for power domain controller: -- compatible: Should be one of the following. - "rockchip,px30-power-controller" - for PX30 SoCs. - "rockchip,rk3036-power-controller" - for RK3036 SoCs. - "rockchip,rk3066-power-controller" - for RK3066 SoCs. - "rockchip,rk3128-power-controller" - for RK3128 SoCs. - "rockchip,rk3188-power-controller" - for RK3188 SoCs. - "rockchip,rk3228-power-controller" - for RK3228 SoCs. - "rockchip,rk3288-power-controller" - for RK3288 SoCs. - "rockchip,rk3328-power-controller" - for RK3328 SoCs. - "rockchip,rk3366-power-controller" - for RK3366 SoCs. - "rockchip,rk3368-power-controller" - for RK3368 SoCs. - "rockchip,rk3399-power-controller" - for RK3399 SoCs. -- #power-domain-cells: Number of cells in a power-domain specifier. - Should be 1 for multiple PM domains. -- #address-cells: Should be 1. -- #size-cells: Should be 0. - -Required properties for power domain sub nodes: -- reg: index of the power domain, should use macros in: - "include/dt-bindings/power/px30-power.h" - for PX30 type power domain. - "include/dt-bindings/power/rk3036-power.h" - for RK3036 type power domain. - "include/dt-bindings/power/rk3066-power.h" - for RK3066 type power domain. - "include/dt-bindings/power/rk3128-power.h" - for RK3128 type power domain. - "include/dt-bindings/power/rk3188-power.h" - for RK3188 type power domain. - "include/dt-bindings/power/rk3228-power.h" - for RK3228 type power domain. - "include/dt-bindings/power/rk3288-power.h" - for RK3288 type power domain. - "include/dt-bindings/power/rk3328-power.h" - for RK3328 type power domain. - "include/dt-bindings/power/rk3366-power.h" - for RK3366 type power domain. - "include/dt-bindings/power/rk3368-power.h" - for RK3368 type power domain. - "include/dt-bindings/power/rk3399-power.h" - for RK3399 type power domain. -- clocks (optional): phandles to clocks which need to be enabled while power domain - switches state. -- pm_qos (optional): phandles to qos blocks which need to be saved and restored - while power domain switches state. - -Qos Example: - - qos_gpu: qos_gpu@ffaf0000 { - compatible ="syscon"; - reg = <0x0 0xffaf0000 0x0 0x20>; - }; - -Example: - - power: power-controller { - compatible = "rockchip,rk3288-power-controller"; - #power-domain-cells = <1>; - #address-cells = <1>; - #size-cells = <0>; - - pd_gpu { - reg = <RK3288_PD_GPU>; - clocks = <&cru ACLK_GPU>; - pm_qos = <&qos_gpu>; - }; - }; - - power: power-controller { - compatible = "rockchip,rk3368-power-controller"; - #power-domain-cells = <1>; - #address-cells = <1>; - #size-cells = <0>; - - pd_gpu_1 { - reg = <RK3368_PD_GPU_1>; - clocks = <&cru ACLK_GPU_CFG>; - }; - }; - -Example 2: - power: power-controller { - compatible = "rockchip,rk3399-power-controller"; - #power-domain-cells = <1>; - #address-cells = <1>; - #size-cells = <0>; - - pd_vio { - #address-cells = <1>; - #size-cells = <0>; - reg = <RK3399_PD_VIO>; - - pd_vo { - #address-cells = <1>; - #size-cells = <0>; - reg = <RK3399_PD_VO>; - - pd_vopb { - reg = <RK3399_PD_VOPB>; - }; - - pd_vopl { - reg = <RK3399_PD_VOPL>; - }; - }; - }; - }; - -Node of a device using power domains must have a power-domains property, -containing a phandle to the power device node and an index specifying which -power domain to use. -The index should use macros in: - "include/dt-bindings/power/px30-power.h" - for px30 type power domain. - "include/dt-bindings/power/rk3036-power.h" - for rk3036 type power domain. - "include/dt-bindings/power/rk3128-power.h" - for rk3128 type power domain. - "include/dt-bindings/power/rk3128-power.h" - for rk3228 type power domain. - "include/dt-bindings/power/rk3288-power.h" - for rk3288 type power domain. - "include/dt-bindings/power/rk3328-power.h" - for rk3328 type power domain. - "include/dt-bindings/power/rk3366-power.h" - for rk3366 type power domain. - "include/dt-bindings/power/rk3368-power.h" - for rk3368 type power domain. - "include/dt-bindings/power/rk3399-power.h" - for rk3399 type power domain. - -Example of the node using power domain: - - node { - /* ... */ - power-domains = <&power RK3288_PD_GPU>; - /* ... */ - }; - - node { - /* ... */ - power-domains = <&power RK3368_PD_GPU_1>; - /* ... */ - }; - - node { - /* ... */ - power-domains = <&power RK3399_PD_VOPB>; - /* ... */ - };
Documentation/devicetree/bindings/soc/rockchip/rockchip,power-controller.yaml new file +259 -0
259 lines not on this page · raw message
Signature · 9 lines
2.17.1 _______________________________________________ Linux-rockchip mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-rockchip
Re: [PATCH v2 2/3] dt-bindings: Convert the rockchip power_domain to YAML and extend
Hi Elaine,
Some comments. Have a look if it's useful or that you disagree with...(part 1)
======
There is currently already a patch proposal that does the same. Could you read that review history and port the good things to your own patch serie?
Re: [PATCH] dt-bindings: power: rockchip: Convert to json-schema
https://lore.kernel.org/linux-rockchip/20201007151159.GA221754@bogus/
Re: [PATCH v3] dt-bindings: power: rockchip: Convert to json-schema
https://lore.kernel.org/linux-rockchip/20201007151159.GA221754@bogus/
======
The kernel scripts checks expects that patches still have approx. 79-80 characters per line. Please keep the YAML descriptions max length < 80 and restyle.
Quoted 160 lines · Elaine Zhang
This converts the rockchip power domain family bindings to YAML schema, and add binding documentation for the power domains found on Rockchip RK3568 SoCs.
Signed-off-by Elaine Zhang <[email protected]>--- .../bindings/soc/rockchip/power_domain.txt | 136 --------- .../rockchip/rockchip,power-controller.yaml | 259 ++++++++++++++++++ 2 files changed, 259 insertions(+), 136 deletions(-) delete mode 100644 Documentation/devicetree/bindings/soc/rockchip/power_domain.txt create mode 100644 Documentation/devicetree/bindings/soc/rockchip/rockchip,power-controller.yamlDocumentation/devicetree/bindings/soc/rockchip/power_domain.txt deleted +0
-136@@ -1,136 +0,0 @@ -* Rockchip Power Domains - -Rockchip processors include support for multiple power domains which can be -powered up/down by software based on different application scenes to save power. - -Required properties for power domain controller: -- compatible: Should be one of the following. - "rockchip,px30-power-controller" - for PX30 SoCs. - "rockchip,rk3036-power-controller" - for RK3036 SoCs. - "rockchip,rk3066-power-controller" - for RK3066 SoCs. - "rockchip,rk3128-power-controller" - for RK3128 SoCs. - "rockchip,rk3188-power-controller" - for RK3188 SoCs. - "rockchip,rk3228-power-controller" - for RK3228 SoCs. - "rockchip,rk3288-power-controller" - for RK3288 SoCs. - "rockchip,rk3328-power-controller" - for RK3328 SoCs. - "rockchip,rk3366-power-controller" - for RK3366 SoCs. - "rockchip,rk3368-power-controller" - for RK3368 SoCs. - "rockchip,rk3399-power-controller" - for RK3399 SoCs. -- #power-domain-cells: Number of cells in a power-domain specifier. - Should be 1 for multiple PM domains. -- #address-cells: Should be 1. -- #size-cells: Should be 0. - -Required properties for power domain sub nodes: -- reg: index of the power domain, should use macros in: - "include/dt-bindings/power/px30-power.h" - for PX30 type power domain. - "include/dt-bindings/power/rk3036-power.h" - for RK3036 type power domain. - "include/dt-bindings/power/rk3066-power.h" - for RK3066 type power domain. - "include/dt-bindings/power/rk3128-power.h" - for RK3128 type power domain. - "include/dt-bindings/power/rk3188-power.h" - for RK3188 type power domain. - "include/dt-bindings/power/rk3228-power.h" - for RK3228 type power domain. - "include/dt-bindings/power/rk3288-power.h" - for RK3288 type power domain. - "include/dt-bindings/power/rk3328-power.h" - for RK3328 type power domain. - "include/dt-bindings/power/rk3366-power.h" - for RK3366 type power domain. - "include/dt-bindings/power/rk3368-power.h" - for RK3368 type power domain. - "include/dt-bindings/power/rk3399-power.h" - for RK3399 type power domain. -- clocks (optional): phandles to clocks which need to be enabled while power domain - switches state. -- pm_qos (optional): phandles to qos blocks which need to be saved and restored - while power domain switches state. - -Qos Example: - - qos_gpu: qos_gpu@ffaf0000 { - compatible ="syscon"; - reg = <0x0 0xffaf0000 0x0 0x20>; - }; - -Example: - - power: power-controller { - compatible = "rockchip,rk3288-power-controller"; - #power-domain-cells = <1>; - #address-cells = <1>; - #size-cells = <0>; - - pd_gpu { - reg = <RK3288_PD_GPU>; - clocks = <&cru ACLK_GPU>; - pm_qos = <&qos_gpu>; - }; - }; - - power: power-controller { - compatible = "rockchip,rk3368-power-controller"; - #power-domain-cells = <1>; - #address-cells = <1>; - #size-cells = <0>; - - pd_gpu_1 { - reg = <RK3368_PD_GPU_1>; - clocks = <&cru ACLK_GPU_CFG>; - }; - }; - -Example 2: - power: power-controller { - compatible = "rockchip,rk3399-power-controller"; - #power-domain-cells = <1>; - #address-cells = <1>; - #size-cells = <0>; - - pd_vio { - #address-cells = <1>; - #size-cells = <0>; - reg = <RK3399_PD_VIO>; - - pd_vo { - #address-cells = <1>; - #size-cells = <0>; - reg = <RK3399_PD_VO>; - - pd_vopb { - reg = <RK3399_PD_VOPB>; - }; - - pd_vopl { - reg = <RK3399_PD_VOPL>; - }; - }; - }; - }; - -Node of a device using power domains must have a power-domains property, -containing a phandle to the power device node and an index specifying which -power domain to use. -The index should use macros in: - "include/dt-bindings/power/px30-power.h" - for px30 type power domain. - "include/dt-bindings/power/rk3036-power.h" - for rk3036 type power domain. - "include/dt-bindings/power/rk3128-power.h" - for rk3128 type power domain. - "include/dt-bindings/power/rk3128-power.h" - for rk3228 type power domain. - "include/dt-bindings/power/rk3288-power.h" - for rk3288 type power domain. - "include/dt-bindings/power/rk3328-power.h" - for rk3328 type power domain. - "include/dt-bindings/power/rk3366-power.h" - for rk3366 type power domain. - "include/dt-bindings/power/rk3368-power.h" - for rk3368 type power domain. - "include/dt-bindings/power/rk3399-power.h" - for rk3399 type power domain. - -Example of the node using power domain: - - node { - /* ... */ - power-domains = <&power RK3288_PD_GPU>; - /* ... */ - }; - - node { - /* ... */ - power-domains = <&power RK3368_PD_GPU_1>; - /* ... */ - }; - - node { - /* ... */ - power-domains = <&power RK3399_PD_VOPB>; - /* ... */ - };Documentation/devicetree/bindings/soc/rockchip/rockchip,power-controller.yaml new file +0
-0
Documentation/devicetree/bindings/soc/rockchip/rockchip,power-controller.yaml
Quoted 2 lines
Documentation/devicetree/bindings/soc/rockchip/rockchip,power-controller.yaml new file +1
-0@@ -0,0 +1,259 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
This is a conversion of an existing document, so GPL-2.0 only.
Quoted 5 lines
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/soc/rockchip/rockchip,power-controller.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#Documentation/devicetree/bindings/soc/rockchip/rockchip,power-controller.yaml new file +1
-0+
Documentation/devicetree/bindings/soc/rockchip/rockchip,power-controller.yaml line 15
Quoted 10 lines
Documentation/devicetree/bindings/soc/rockchip/rockchip,power-controller.yaml new file +9
-0+title: Rockchip Generic PM domains + +maintainers: + - Rob Herring <[email protected]> + - Heiko Stuebner <[email protected]> + +description: | + Rockchip processors include support for multiple power domains which can be + powered up/down by software based on different application scenes to save power.
scenes > scenarios ??
Quoted 10 lines
Documentation/devicetree/bindings/soc/rockchip/rockchip,power-controller.yaml new file +10
-0+ +properties: + $nodename: + const: power-controller + + compatible: + enum: + - rockchip,px30-power-controller + - rockchip,rk3036-power-controller + - rockchip,rk3066-power-controller
Documentation/devicetree/bindings/soc/rockchip/rockchip,power-controller.yaml line 34
Quoted 10 lines
Documentation/devicetree/bindings/soc/rockchip/rockchip,power-controller.yaml new file +9
-0+ - rockchip,rk3128-power-controller + - rockchip,rk3188-power-controller + - rockchip,rk3228-power-controller + - rockchip,rk3288-power-controller + - rockchip,rk3328-power-controller + - rockchip,rk3366-power-controller + - rockchip,rk3368-power-controller + - rockchip,rk3399-power-controller + - rockchip,rk3568-power-controller
Use separate patches for a YAML conversion and adding new compatibility strings.
Documentation/devicetree/bindings/soc/rockchip/rockchip,power-controller.yaml
Quoted 2 lines
Documentation/devicetree/bindings/soc/rockchip/rockchip,power-controller.yaml new file +2
-0+ + '#power-domain-cells':
Use "" instead of '' like in the rest of the YAML files. Change them all in this document.
Documentation/devicetree/bindings/soc/rockchip/rockchip,power-controller.yaml line 51
Quoted 10 lines
Documentation/devicetree/bindings/soc/rockchip/rockchip,power-controller.yaml new file +10
-0+ const: 1 + + '#address-cells': + const: 1 + + '#size-cells': + const: 0 + +patternProperties: +
"(pd_npu|pd_gpu|pd_vi|pd_vo|pd_rga|pd_vpu|pd_rkvdec|pd_rkvenc|pd_pipe|pd_edp|pd_emmc|pd_gmac|pd_iep|pd_sdioaudio|pd_usb3|pd_vcodec|pd_vdu|pd_vio|pd_mmc_nand|pd_sdcard|pd_usb|pd_hevc|pd_video|pd_perihp|pd_sd|pd_tcpc0|pd_tcpc1)@[0-9a-f]+$":
use a regex
======
Comment by Rob in review:
https://lore.kernel.org/linux-rockchip/20201007151159.GA221754@bogus/
Which in turn means the nested power domains will throw an error, so you can do:
patternProperties:
"^power-domain@[0-9a-f]+$":
$ref: '#/patternProperties/^power-domain@[0-9a-f]+$'======
Comment by Rob in review:
https://lore.kernel.org/linux-rockchip/20201007151159.GA221754@bogus/
(with indentation). Then you will get a bunch of errors as you are missing a level of nodes. The 'power-controller' node doesn't have 'reg' for example. You'll need to use 'patternProperties' with '^pd_'.
And to describe the nested power domains, you have to describe yet another level. You can do a $ref with something like:
$ref: '#/properties/power-controller/patternProperties/^pd_'
That creates a circular reference though and I'm not sure what will happen. :)
======
My version 2 comment:
Instead of using regex "^power-domain@[0-9a-f]+$" could you experiment with something like "^pd_[a-z]@[0-9a-f]+$" to prevent that all existing dtsi files generate notifications and have to be changed.
Quoted 8 lines
Documentation/devicetree/bindings/soc/rockchip/rockchip,power-controller.yaml new file +8
-0+ type: object + description: | + Represents the power domains within the power controller node as documented + in Documentation/devicetree/bindings/power/power-domain.yaml. + + properties: + + '#address-cells':
Documentation/devicetree/bindings/soc/rockchip/rockchip,power-controller.yaml line 63
Quoted 10 lines
Documentation/devicetree/bindings/soc/rockchip/rockchip,power-controller.yaml new file +9
-0+ const: 1 + + '#size-cells': + const: 0 + + reg: + maxItems: 1 + description: | + Power domain index. Valid values are defined in:
The ":" charecter should maybe not be used in the description to prevent misinterpretation.
Quoted 19 lines
Documentation/devicetree/bindings/soc/rockchip/rockchip,power-controller.yaml new file +19
-0+ "include/dt-bindings/power/px30-power.h" + "include/dt-bindings/power/rk3036-power.h" + "include/dt-bindings/power/rk3066-power.h" + "include/dt-bindings/power/rk3128-power.h" + "include/dt-bindings/power/rk3188-power.h" + "include/dt-bindings/power/rk3228-power.h" + "include/dt-bindings/power/rk3288-power.h" + "include/dt-bindings/power/rk3328-power.h" + "include/dt-bindings/power/rk3366-power.h" + "include/dt-bindings/power/rk3368-power.h" + "include/dt-bindings/power/rk3399-power.h" + "include/dt-bindings/power/rk3568-power.h" + + clocks: + description: | + A number of phandles to clocks that need to be enabled during domain + power-up sequencing. + + clock-names:
Documentation/devicetree/bindings/soc/rockchip/rockchip,power-controller.yaml line 91
Quoted 10 lines
Documentation/devicetree/bindings/soc/rockchip/rockchip,power-controller.yaml new file +9
-0+ description: | + List of names of clocks, in order to match the power-up sequencing + for each power domain we need to group the clocks by name. BASIC + clocks need to be enabled before enabling the corresponding power + domain. + + pm_qos: + description: | + QoS is an abriviation saved restored.
My previous comment was not clear enough I think... ;) Please correct your spelling.
======
The original text:
- pm_qos (optional): phandles to qos blocks which need to be saved and restored while power domain switches state.
======
Your version 1 text:
A number of phandles for qos registers that need to be save and
restor during domain
power-up sequencing.
======
My version 1 comment:
QoS is an abriviation
saved
restored
======
My version 2 comment:
Could you recheck the spelling?
QoS is an abbreviation which is normally written with capital letters. Explain the meaning of QoS blocks.(Quality of Service ??) Are they just memory regs?
qos > QoS (Is that correct ?? Please check!)
save > saved
restor > restored
Documentation/devicetree/bindings/soc/rockchip/rockchip,power-controller.yaml line 94
Quoted 4 lines
Documentation/devicetree/bindings/soc/rockchip/rockchip,power-controller.yaml new file +3
-0+ + patternProperties: + "(pd_vo|pd_tcpc0|pd_tcpc1|pd_hdcp|pd_isp0|pd_isp1|pd_sd)@[0-9a-f]+$":
use a regex
Quoted 21 lines
Documentation/devicetree/bindings/soc/rockchip/rockchip,power-controller.yaml new file +21
-0+ type: object + description: | + Represents a power domain child within a power domain parent node. + + properties: + + '#address-cells': + const: 1 + + '#size-cells': + const: 0 + + reg: + maxItems: 1 + + clocks: + description: | + A number of phandles to clocks that need to be enabled during domain + power-up sequencing. + + clock-names:
Documentation/devicetree/bindings/soc/rockchip/rockchip,power-controller.yaml line 124
Quoted 10 lines
Documentation/devicetree/bindings/soc/rockchip/rockchip,power-controller.yaml new file +9
-0+ description: | + List of names of clocks, in order to match the power-up sequencing + for each power domain we need to group the clocks by name. BASIC + clocks need to be enabled before enabling the corresponding power + domain. + + pm_qos: + description: | + QoS is an abriviation saved restored.
dito
Documentation/devicetree/bindings/soc/rockchip/rockchip,power-controller.yaml line 127
Quoted 4 lines
Documentation/devicetree/bindings/soc/rockchip/rockchip,power-controller.yaml new file +3
-0+ + patternProperties: + "(pd_vopb|pd_vopl)@[0-9a-f]+$":
use a regex
Quoted 21 lines
Documentation/devicetree/bindings/soc/rockchip/rockchip,power-controller.yaml new file +21
-0+ type: object + description: | + Represents a power domain child within a power domain parent node. + + properties: + + '#address-cells': + const: 1 + + '#size-cells': + const: 0 + + reg: + maxItems: 1 + + clocks: + description: | + A number of phandles to clocks that need to be enabled during domain + power-up sequencing. + + clock-names:
Documentation/devicetree/bindings/soc/rockchip/rockchip,power-controller.yaml line 124
Quoted 10 lines
Documentation/devicetree/bindings/soc/rockchip/rockchip,power-controller.yaml new file +9
-0+ description: | + List of names of clocks, in order to match the power-up sequencing + for each power domain we need to group the clocks by name. BASIC + clocks need to be enabled before enabling the corresponding power + domain. + + pm_qos: + description: | + QoS is an abriviation saved restored.
dito
Documentation/devicetree/bindings/soc/rockchip/rockchip,power-controller.yaml line 168
Quoted 11 lines
Documentation/devicetree/bindings/soc/rockchip/rockchip,power-controller.yaml new file +11
-0+ + additionalProperties: false + + additionalProperties: false + + additionalProperties: false + +required: + - compatible + +additionalProperties: false
====
+ required:
+ - reg
+
+ additionalProperties: false
+
+ required:
+ - reg
+
+ additionalProperties: false
+
+ required:
+ - reg
+
+ additionalProperties: false
+
+required:
+ - compatible
+ - '#power-domain-cells'
+
+additionalProperties: false
The patch link below adds more required things.
Could you recheck your patch?
https://lore.kernel.org/linux-rockchip/[email protected]/
====
Documentation/devicetree/bindings/soc/rockchip/rockchip,power-controller.yaml line 173
Quoted 6 lines
Documentation/devicetree/bindings/soc/rockchip/rockchip,power-controller.yaml new file +5
-0+ +examples: + - | + #include <dt-bindings/clock/rk3568-cru.h> + #include <dt-bindings/power/rk3568-power.h>
rk3568 still has no full support in the mainline kernel. Rob's script will generate errors.
Could you change to a rk3399 example for which all includes are already there?
Quoted 77 lines
Documentation/devicetree/bindings/soc/rockchip/rockchip,power-controller.yaml new file +76
-0+ + pmu: power-management@fdd90000 { + compatible = "rockchip,rk3568-pmu", "syscon", "simple-mfd"; + reg = <0xfdd90000 0x1000>; + + power: power-controller { + compatible = "rockchip,rk3568-power-controller"; + #power-domain-cells = <1>; + #address-cells = <1>; + #size-cells = <0>; + + /* These power domains are grouped by VD_NPU */ + pd_npu@RK3568_PD_NPU { + reg = <RK3568_PD_NPU>; + clocks = <&cru ACLK_NPU_PRE>, + <&cru HCLK_NPU_PRE>, + <&cru PCLK_NPU_PRE>; + pm_qos = <&qos_npu>; + }; + /* These power domains are grouped by VD_GPU */ + pd_gpu@RK3568_PD_GPU { + reg = <RK3568_PD_GPU>; + clocks = <&cru ACLK_GPU_PRE>, + <&cru PCLK_GPU_PRE>; + pm_qos = <&qos_gpu>; + }; + /* These power domains are grouped by VD_LOGIC */ + pd_vi@RK3568_PD_VI { + reg = <RK3568_PD_VI>; + clocks = <&cru HCLK_VI>, + <&cru PCLK_VI>; + pm_qos = <&qos_isp>, + <&qos_vicap0>, + <&qos_vicap1>; + }; + pd_vo@RK3568_PD_VO { + reg = <RK3568_PD_VO>; + clocks = <&cru HCLK_VO>, + <&cru PCLK_VO>, + <&cru ACLK_VOP_PRE>; + pm_qos = <&qos_hdcp>, + <&qos_vop_m0>, + <&qos_vop_m1>; + }; + pd_rga@RK3568_PD_RGA { + reg = <RK3568_PD_RGA>; + clocks = <&cru HCLK_RGA_PRE>, + <&cru PCLK_RGA_PRE>; + pm_qos = <&qos_ebc>, + <&qos_iep>, + <&qos_jpeg_dec>, + <&qos_jpeg_enc>, + <&qos_rga_rd>, + <&qos_rga_wr>; + }; + pd_vpu@RK3568_PD_VPU { + reg = <RK3568_PD_VPU>; + clocks = <&cru HCLK_VPU_PRE>; + pm_qos = <&qos_vpu>; + }; + pd_rkvdec@RK3568_PD_RKVDEC { + clocks = <&cru HCLK_RKVDEC_PRE>; + reg = <RK3568_PD_RKVDEC>; + pm_qos = <&qos_rkvdec>; + }; + pd_rkvenc@RK3568_PD_RKVENC { + reg = <RK3568_PD_RKVENC>; + clocks = <&cru HCLK_RKVENC_PRE>; + pm_qos = <&qos_rkvenc_rd_m0>, + <&qos_rkvenc_rd_m1>, + <&qos_rkvenc_wr_m0>; + }; + pd_pipe@RK3568_PD_PIPE { + reg = <RK3568_PD_PIPE>; + clocks = <&cru PCLK_PIPE>; + pm_qos = <&qos_pcie2x1>,
Documentation/devicetree/bindings/soc/rockchip/rockchip,power-controller.yaml line 259
Quoted 10 lines
Documentation/devicetree/bindings/soc/rockchip/rockchip,power-controller.yaml new file +10
-0+ <&qos_pcie3x1>, + <&qos_pcie3x2>, + <&qos_sata0>, + <&qos_sata1>, + <&qos_sata2>, + <&qos_usb3_0>, + <&qos_usb3_1>; + }; + }; + };
_______________________________________________
Linux-rockchip mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-rockchip
Re: [PATCH v2 2/3] dt-bindings: Convert the rockchip power_domain to YAML and extend
Hi Elaine,
Missatge de Johan Jonker <[email protected]> del dia dt., 23 de març 2021 a les 12:06:
Quoted 11 lines
Hi Elaine,
Some comments. Have a look if it's useful or that you disagree with...(part 1)
======
There is currently already a patch proposal that does the same. Could you read that review history and port the good things to your own patch serie?
Quoted 6 lines
Re: [PATCH] dt-bindings: power: rockchip: Convert to json-schema
https://lore.kernel.org/linux-rockchip/20201007151159.GA221754@bogus/Re: [PATCH v3] dt-bindings: power: rockchip: Convert to json-schema
https://lore.kernel.org/linux-rockchip/20201007151159.GA221754@bogus/
In fact, the latest version is v6 which can be found here:
https://patchwork.kernel.org/project/linux-rockchip/patch/[email protected]/
Feel free to integrate and/or improve that version in your series.
_______________________________________________
Linux-rockchip mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-rockchip
Re: [PATCH v2 2/3] dt-bindings: Convert the rockchip power_domain to YAML and extend
Hi, Enric
Quoted 17 lines · Enric Balletbo Serra
Hi Elaine,
Missatge de Johan Jonker <[email protected]> del dia dt., 23 de març 2021 a les 12:06:
Quoted 13 lines
Hi Elaine,
Some comments. Have a look if it's useful or that you disagree with...(part 1)
======
There is currently already a patch proposal that does the same. Could you read that review history and port the good things to your own patch serie?Re: [PATCH] dt-bindings: power: rockchip: Convert to json-schema
https://lore.kernel.org/linux-rockchip/20201007151159.GA221754@bogus/
Quoted 8 lines
Quoted 3 lines
Re: [PATCH v3] dt-bindings: power: rockchip: Convert to json-schema
https://lore.kernel.org/linux-rockchip/20201007151159.GA221754@bogus/In fact, the latest version is v6 which can be found here:
https://patchwork.kernel.org/project/linux-rockchip/patch/[email protected]/
Feel free to integrate and/or improve that version in your series.
Thank you for your submission. I will revise the submission on this basis.
Quoted 3 lines
_______________________________________________
Linux-rockchip mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-rockchip
Rob Herring
maintainerRe: [PATCH v2 2/3] dt-bindings: Convert the rockchip power_domain to YAML and extend
In reply to Elaine ZhangQuoted 4 lines · Elaine Zhang
This converts the rockchip power domain family bindings to YAML schema, and add binding documentation for the power domains found on Rockchip RK3568 SoCs.
Quoted 8 lines
Signed-off-by Elaine Zhang <[email protected]>--- .../bindings/soc/rockchip/power_domain.txt | 136 --------- .../rockchip/rockchip,power-controller.yaml | 259 ++++++++++++++++++ 2 files changed, 259 insertions(+), 136 deletions(-) delete mode 100644 Documentation/devicetree/bindings/soc/rockchip/power_domain.txt create mode 100644 Documentation/devicetree/bindings/soc/rockchip/rockchip,power-controller.yaml
My bot found errors running 'make dt_binding_check' on your patch:
yamllint warnings/errors:
dtschema/dtc warnings/errors:Documentation/devicetree/bindings/soc/rockchip/rockchip,power-controller.example.dts:19:18: fatal error: dt-bindings/clock/rk3568-cru.h: No such file or directory
19 | #include <dt-bindings/clock/rk3568-cru.h>
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make[1]: *** [scripts/Makefile.lib:349: Documentation/devicetree/bindings/soc/rockchip/rockchip,power-controller.example.dt.yaml] Error 1
make: *** [Makefile:1380: dt_binding_check] Error 2
See https://patchwork.ozlabs.org/patch/1457096
This check can fail if there are any dependencies. The base for a patch series is generally the most recent rc1.
If you already ran 'make dt_binding_check' and didn't see the above error(s), then make sure 'yamllint' is installed and dt-schema is up to date:
pip3 install dtschema --upgrade
Please check and re-submit.
_______________________________________________
Linux-rockchip mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-rockchip
Re: [PATCH v2 2/3] dt-bindings: Convert the rockchip power_domain to YAML and extend【请注意,邮件由[email protected]代发】
Hi, Rob Herring
Quoted 17 lines · Rob Herring
Quoted 4 lines · Elaine Zhang
This converts the rockchip power domain family bindings to YAML schema, and add binding documentation for the power domains found on Rockchip RK3568 SoCs.
Quoted 8 lines
Signed-off-by Elaine Zhang <[email protected]>--- .../bindings/soc/rockchip/power_domain.txt | 136 --------- .../rockchip/rockchip,power-controller.yaml | 259 ++++++++++++++++++ 2 files changed, 259 insertions(+), 136 deletions(-)delete mode 100644
Documentation/devicetree/bindings/soc/rockchip/power_domain.txtcreate mode 100644Documentation/devicetree/bindings/soc/rockchip/rockchip,power-controller.yamlMy bot found errors running 'make
dt_binding_check' on your patch:yamllint warnings/errors:
Quoted 7 lines
dtschema/dtc warnings/errors:
Documentation/devicetree/bindings/soc/rockchip/rockchip,power-controller.example.dts:19:18: fatal error:dt-bindings/clock/rk3568-cru.h: No such file or directory19 | #include <dt-bindings/clock/rk3568-cru.h> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~compilation terminated.
make[1]: *** [scripts/Makefile.lib:349:Documentation/devicetree/bindings/soc/rockchip/rockchip,power-controller.example.dt.yaml] Error 1
make: *** [Makefile:1380:dt_binding_check] Error 2
#include <dt-bindings/clock/rk3568-cru.h>
This file has been merged, can be seen on the Master branch of Linux-Next. I will rearrange the submission based on this:
https://patchwork.kernel.org/project/linux-rockchip/patch/[email protected]/
Quoted 6 lines
See https://patchwork.ozlabs.org/patch/1457096
This check can fail if there are any dependencies. The base for a patch series is generally the most recent rc1.
Quoted 10 lines
If you already ran 'make
dt_binding_check' and didn't see the above error(s), then make sure 'yamllint' is installed and dt-schema is up to date:pip3 install dtschema --upgrade
Please check and re-submit.
_______________________________________________
Linux-rockchip mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-rockchip
PATCH v2 3/3 soc: rockchip: power-domain: add rk3568 powerdomains
In reply to Elaine ZhangAdd power-domains found on rk3568 socs.
--- drivers/soc/rockchip/pm_domains.c | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+)
drivers/soc/rockchip/pm_domains.c +31 -0
@@ -27,6 +27,7 @@#include <dt-bindings/power/rk3366-power.h> #include <dt-bindings/power/rk3368-power.h> #include <dt-bindings/power/rk3399-power.h> +#include <dt-bindings/power/rk3568-power.h> struct rockchip_domain_info {int pwr_mask;
@@ -131,6 +132,9 @@ struct rockchip_pmu {#define DOMAIN_RK3399 (pwr, status, req, wakeup) \ DOMAIN(pwr, status, req, req, req, wakeup) +#define DOMAIN_RK3568 (pwr, req, wakeup) \ + DOMAIN_M(pwr, pwr, req, req, req, wakeup) +static bool rockchip_pmu_domain_is_idle (struct rockchip_pm_domain *pd) {struct rockchip_pmu *pmu = pd->pmu;
@@ -841,6 +845,18 @@ static const struct rockchip_domain_info rk3399_pm_domains[] = { [RK3399_PD_SDIOAUDIO] = DOMAIN_RK3399(BIT(31), BIT(31), BIT(29), true), }; +static const struct rockchip_domain_info rk3568_pm_domains[] = { + [RK3568_PD_NPU ] =DOMAIN_RK3568 (BIT (1 ),BIT (2 ), false), + [RK3568_PD_GPU ] =DOMAIN_RK3568 (BIT (0 ),BIT (1 ), false), + [RK3568_PD_VI ] =DOMAIN_RK3568 (BIT (6 ),BIT (3 ), false), + [RK3568_PD_VO ] =DOMAIN_RK3568 (BIT (7 ),BIT (4 ), false), + [RK3568_PD_RGA ] =DOMAIN_RK3568 (BIT (5 ),BIT (5 ), false), + [RK3568_PD_VPU ] =DOMAIN_RK3568 (BIT (2 ),BIT (6 ), false), + [RK3568_PD_RKVDEC ] =DOMAIN_RK3568 (BIT (4 ),BIT (8 ), false), + [RK3568_PD_RKVENC ] =DOMAIN_RK3568 (BIT (3 ),BIT (7 ), false), + [RK3568_PD_PIPE ] =DOMAIN_RK3568 (BIT (8 ),BIT (11 ), false), +}; +static const struct rockchip_pmu_info px30_pmu = { .pwr_offset =0x18 , .status_offset =0x20 ,
@@ -976,6 +992,17 @@ static const struct rockchip_pmu_info rk3399_pmu = { .domain_info = rk3399_pm_domains, }; +static const struct rockchip_pmu_info rk3568_pmu = { + .pwr_offset =0xa0 , + .status_offset =0x98 , + .req_offset =0x50 , + .idle_offset =0x68 , + .ack_offset =0x60 , + + .num_domains =ARRAY_SIZE (rk3568_pm_domains), + .domain_info = rk3568_pm_domains, +}; +static const struct of_device_id rockchip_pm_domain_dt_match[] = { { .compatible ="rockchip,px30-power-controller" ,
@@ -1021,6 +1048,10 @@ static const struct of_device_id rockchip_pm_domain_dt_match[] = { .compatible = "rockchip,rk3399-power-controller", .data = (void *)&rk3399_pmu, }, + { + .compatible = "rockchip,rk3568-power-controller", + .data = (void *)&rk3568_pmu, + }, { /* sentinel */ }, };
Signature · 9 lines
2.17.1 _______________________________________________ Linux-rockchip mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-rockchip