* Re: [PATCH v3] dt-bindings: power: rockchip: Convert to json-schema
@ 2020-10-07 15:11 ` Rob Herring
0 siblings, 0 replies; 21+ messages in thread
From: Rob Herring @ 2020-10-07 15:11 UTC (permalink / raw)
To: Enric Balletbo i Serra
Cc: devicetree, heiko, linux-kernel, dianders, linux-rockchip,
Collabora Kernel ML, linux-arm-kernel, Caesar Wang
On Mon, Sep 21, 2020 at 11:29:51AM +0200, Enric Balletbo i Serra wrote:
> Convert the soc/rockchip/power_domain.txt binding document to json-schema
> and move to the power bindings directory.
>
> Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
> ---
>
> Changes in v3:
> - Fixed tab errors found by bot
>
> Changes in v2:
> - Fixed a warning that says that 'syscon' should not be used alone.
> - Use patternProperties to define a new level for power-domains.
> - Add const values for power-domain-cells, address-cells, etc.
>
> .../power/rockchip,power-controller.yaml | 207 ++++++++++++++++++
> .../bindings/soc/rockchip/power_domain.txt | 136 ------------
> 2 files changed, 207 insertions(+), 136 deletions(-)
> create mode 100644 Documentation/devicetree/bindings/power/rockchip,power-controller.yaml
> delete mode 100644 Documentation/devicetree/bindings/soc/rockchip/power_domain.txt
>
> diff --git a/Documentation/devicetree/bindings/power/rockchip,power-controller.yaml b/Documentation/devicetree/bindings/power/rockchip,power-controller.yaml
> new file mode 100644
> index 000000000000..b23ea37e2a08
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/power/rockchip,power-controller.yaml
> @@ -0,0 +1,207 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/power/rockchip,power-controller.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Rockchip Power Domains
> +
> +maintainers:
> + - Caesar Wang <wxt@rock-chips.com>
> + - Heiko Stuebner <heiko@sntech.de>
> +
> +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.
> +
> + Power domains contained within power-controller node are generic power domain
> + providers documented in Documentation/devicetree/bindings/power/power-domain.yaml.
> +
> + IP cores belonging to a power domain should contain a 'power-domains'
> + property that is a phandle for the power domain node representing the domain.
> +
> +properties:
> + $nodename:
> + const: power-controller
> +
> + compatible:
> + enum:
> + - rockchip,px30-power-controller
> + - rockchip,rk3036-power-controller
> + - rockchip,rk3066-power-controller
> + - 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
> +
> + '#power-domain-cells':
> + const: 1
> +
> + '#address-cells':
> + const: 1
> +
> + '#size-cells':
> + const: 0
> +
> +patternProperties:
> + "^power-domain@[0-9]+$":
unit-addresses are hex.
> + type: object
> + description: |
> + Represents the power domains within the power controller node as documented
> + in Documentation/devicetree/bindings/power/power-domain.yaml.
> +
> + properties:
> +
> + '#power-domain-cells':
> + description:
> + Must be 0 for nodes representing a single PM domain and 1 for nodes
> + providing multiple PM domains.
> +
> + '#address-cells':
> + const: 1
> +
> + '#size-cells':
> + const: 0
> +
> + reg:
> + description: |
> + Power domain index. Valid values are defined 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.
> + maxItems: 1
Range of values?
> +
> + clocks:
> + description: |
> + A number of phandles to clocks that need to be enabled while power domain
> + switches state.
Can you at least put a range of how many clocks?
> +
> + pm_qos:
> + description: |
> + A number of phandles to qos blocks which need to be saved and restored
> + while power domain switches state.
And here.
> +
> + required:
> + - reg
additionalProperties: false
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]+$'
> +
> +required:
> + - compatible
> + - '#power-domain-cells'
> +
> +additionalProperties: false
> +
> +examples:
> + - |
> + #include <dt-bindings/clock/rk3399-cru.h>
> + #include <dt-bindings/power/rk3399-power.h>
> +
> + soc {
> + #address-cells = <2>;
> + #size-cells = <2>;
> +
> + qos_hdcp: qos@ffa90000 {
> + compatible = "rockchip,rk3399-qos","syscon";
space ^
> + reg = <0x0 0xffa90000 0x0 0x20>;
> + };
> +
> + qos_iep: qos@ffa98000 {
> + compatible = "rk3399-qos","syscon";
> + reg = <0x0 0xffa98000 0x0 0x20>;
> + };
> +
> + qos_rga_r: qos@ffab0000 {
> + compatible = "rk3399-qos","syscon";
> + reg = <0x0 0xffab0000 0x0 0x20>;
> + };
> +
> + qos_rga_w: qos@ffab0080 {
> + compatible = "rk3399-qos","syscon";
> + reg = <0x0 0xffab0080 0x0 0x20>;
> + };
> +
> + qos_video_m0: qos@ffab8000 {
> + compatible = "rk3399-qos","syscon";
> + reg = <0x0 0xffab8000 0x0 0x20>;
> + };
> +
> + qos_video_m1_r: qos@ffac0000 {
> + compatible = "rk3399-qos","syscon";
> + reg = <0x0 0xffac0000 0x0 0x20>;
> + };
> +
> + qos_video_m1_w: qos@ffac0080 {
> + compatible = "rk3399-qos","syscon";
> + reg = <0x0 0xffac0080 0x0 0x20>;
> + };
> +
> + power-management@ff310000 {
> + compatible = "rockchip,rk3399-pmu", "syscon", "simple-mfd";
> + reg = <0x0 0xff310000 0x0 0x1000>;
> +
> + power-controller {
> + compatible = "rockchip,rk3399-power-controller";
> + #power-domain-cells = <1>;
> + #address-cells = <1>;
> + #size-cells = <0>;
> +
> + /* These power domains are grouped by VD_CENTER */
> + power-domain@RK3399_PD_IEP {
> + reg = <RK3399_PD_IEP>;
> + clocks = <&cru ACLK_IEP>,
> + <&cru HCLK_IEP>;
> + pm_qos = <&qos_iep>;
> + #power-domain-cells = <0>;
> + };
> + power-domain@RK3399_PD_RGA {
> + reg = <RK3399_PD_RGA>;
> + clocks = <&cru ACLK_RGA>,
> + <&cru HCLK_RGA>;
> + pm_qos = <&qos_rga_r>,
> + <&qos_rga_w>;
> + #power-domain-cells = <0>;
> + };
> + power-domain@RK3399_PD_VCODEC {
> + reg = <RK3399_PD_VCODEC>;
> + clocks = <&cru ACLK_VCODEC>,
> + <&cru HCLK_VCODEC>;
> + pm_qos = <&qos_video_m0>;
> + #power-domain-cells = <0>;
> + };
> + power-domain@RK3399_PD_VDU {
> + reg = <RK3399_PD_VDU>;
> + clocks = <&cru ACLK_VDU>,
> + <&cru HCLK_VDU>;
> + pm_qos = <&qos_video_m1_r>,
> + <&qos_video_m1_w>;
> + #power-domain-cells = <0>;
> + };
> + power-domain@RK3399_PD_VIO {
> + reg = <RK3399_PD_VIO>;
> + #power-domain-cells = <1>;
> + #address-cells = <1>;
> + #size-cells = <0>;
> +
> + power-domain@RK3399_PD_HDCP {
> + reg = <RK3399_PD_HDCP>;
> + clocks = <&cru ACLK_HDCP>,
> + <&cru HCLK_HDCP>,
> + <&cru PCLK_HDCP>;
> + pm_qos = <&qos_hdcp>;
> + #power-domain-cells = <0>;
> + };
> + };
> + };
> + };
> + };
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH v3] dt-bindings: power: rockchip: Convert to json-schema
@ 2020-10-07 15:11 ` Rob Herring
0 siblings, 0 replies; 21+ messages in thread
From: Rob Herring @ 2020-10-07 15:11 UTC (permalink / raw)
To: Enric Balletbo i Serra
Cc: devicetree, heiko, linux-kernel, dianders, linux-rockchip,
Collabora Kernel ML, linux-arm-kernel, Caesar Wang
On Mon, Sep 21, 2020 at 11:29:51AM +0200, Enric Balletbo i Serra wrote:
> Convert the soc/rockchip/power_domain.txt binding document to json-schema
> and move to the power bindings directory.
>
> Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
> ---
>
> Changes in v3:
> - Fixed tab errors found by bot
>
> Changes in v2:
> - Fixed a warning that says that 'syscon' should not be used alone.
> - Use patternProperties to define a new level for power-domains.
> - Add const values for power-domain-cells, address-cells, etc.
>
> .../power/rockchip,power-controller.yaml | 207 ++++++++++++++++++
> .../bindings/soc/rockchip/power_domain.txt | 136 ------------
> 2 files changed, 207 insertions(+), 136 deletions(-)
> create mode 100644 Documentation/devicetree/bindings/power/rockchip,power-controller.yaml
> delete mode 100644 Documentation/devicetree/bindings/soc/rockchip/power_domain.txt
>
> diff --git a/Documentation/devicetree/bindings/power/rockchip,power-controller.yaml b/Documentation/devicetree/bindings/power/rockchip,power-controller.yaml
> new file mode 100644
> index 000000000000..b23ea37e2a08
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/power/rockchip,power-controller.yaml
> @@ -0,0 +1,207 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/power/rockchip,power-controller.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Rockchip Power Domains
> +
> +maintainers:
> + - Caesar Wang <wxt@rock-chips.com>
> + - Heiko Stuebner <heiko@sntech.de>
> +
> +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.
> +
> + Power domains contained within power-controller node are generic power domain
> + providers documented in Documentation/devicetree/bindings/power/power-domain.yaml.
> +
> + IP cores belonging to a power domain should contain a 'power-domains'
> + property that is a phandle for the power domain node representing the domain.
> +
> +properties:
> + $nodename:
> + const: power-controller
> +
> + compatible:
> + enum:
> + - rockchip,px30-power-controller
> + - rockchip,rk3036-power-controller
> + - rockchip,rk3066-power-controller
> + - 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
> +
> + '#power-domain-cells':
> + const: 1
> +
> + '#address-cells':
> + const: 1
> +
> + '#size-cells':
> + const: 0
> +
> +patternProperties:
> + "^power-domain@[0-9]+$":
unit-addresses are hex.
> + type: object
> + description: |
> + Represents the power domains within the power controller node as documented
> + in Documentation/devicetree/bindings/power/power-domain.yaml.
> +
> + properties:
> +
> + '#power-domain-cells':
> + description:
> + Must be 0 for nodes representing a single PM domain and 1 for nodes
> + providing multiple PM domains.
> +
> + '#address-cells':
> + const: 1
> +
> + '#size-cells':
> + const: 0
> +
> + reg:
> + description: |
> + Power domain index. Valid values are defined 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.
> + maxItems: 1
Range of values?
> +
> + clocks:
> + description: |
> + A number of phandles to clocks that need to be enabled while power domain
> + switches state.
Can you at least put a range of how many clocks?
> +
> + pm_qos:
> + description: |
> + A number of phandles to qos blocks which need to be saved and restored
> + while power domain switches state.
And here.
> +
> + required:
> + - reg
additionalProperties: false
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]+$'
> +
> +required:
> + - compatible
> + - '#power-domain-cells'
> +
> +additionalProperties: false
> +
> +examples:
> + - |
> + #include <dt-bindings/clock/rk3399-cru.h>
> + #include <dt-bindings/power/rk3399-power.h>
> +
> + soc {
> + #address-cells = <2>;
> + #size-cells = <2>;
> +
> + qos_hdcp: qos@ffa90000 {
> + compatible = "rockchip,rk3399-qos","syscon";
space ^
> + reg = <0x0 0xffa90000 0x0 0x20>;
> + };
> +
> + qos_iep: qos@ffa98000 {
> + compatible = "rk3399-qos","syscon";
> + reg = <0x0 0xffa98000 0x0 0x20>;
> + };
> +
> + qos_rga_r: qos@ffab0000 {
> + compatible = "rk3399-qos","syscon";
> + reg = <0x0 0xffab0000 0x0 0x20>;
> + };
> +
> + qos_rga_w: qos@ffab0080 {
> + compatible = "rk3399-qos","syscon";
> + reg = <0x0 0xffab0080 0x0 0x20>;
> + };
> +
> + qos_video_m0: qos@ffab8000 {
> + compatible = "rk3399-qos","syscon";
> + reg = <0x0 0xffab8000 0x0 0x20>;
> + };
> +
> + qos_video_m1_r: qos@ffac0000 {
> + compatible = "rk3399-qos","syscon";
> + reg = <0x0 0xffac0000 0x0 0x20>;
> + };
> +
> + qos_video_m1_w: qos@ffac0080 {
> + compatible = "rk3399-qos","syscon";
> + reg = <0x0 0xffac0080 0x0 0x20>;
> + };
> +
> + power-management@ff310000 {
> + compatible = "rockchip,rk3399-pmu", "syscon", "simple-mfd";
> + reg = <0x0 0xff310000 0x0 0x1000>;
> +
> + power-controller {
> + compatible = "rockchip,rk3399-power-controller";
> + #power-domain-cells = <1>;
> + #address-cells = <1>;
> + #size-cells = <0>;
> +
> + /* These power domains are grouped by VD_CENTER */
> + power-domain@RK3399_PD_IEP {
> + reg = <RK3399_PD_IEP>;
> + clocks = <&cru ACLK_IEP>,
> + <&cru HCLK_IEP>;
> + pm_qos = <&qos_iep>;
> + #power-domain-cells = <0>;
> + };
> + power-domain@RK3399_PD_RGA {
> + reg = <RK3399_PD_RGA>;
> + clocks = <&cru ACLK_RGA>,
> + <&cru HCLK_RGA>;
> + pm_qos = <&qos_rga_r>,
> + <&qos_rga_w>;
> + #power-domain-cells = <0>;
> + };
> + power-domain@RK3399_PD_VCODEC {
> + reg = <RK3399_PD_VCODEC>;
> + clocks = <&cru ACLK_VCODEC>,
> + <&cru HCLK_VCODEC>;
> + pm_qos = <&qos_video_m0>;
> + #power-domain-cells = <0>;
> + };
> + power-domain@RK3399_PD_VDU {
> + reg = <RK3399_PD_VDU>;
> + clocks = <&cru ACLK_VDU>,
> + <&cru HCLK_VDU>;
> + pm_qos = <&qos_video_m1_r>,
> + <&qos_video_m1_w>;
> + #power-domain-cells = <0>;
> + };
> + power-domain@RK3399_PD_VIO {
> + reg = <RK3399_PD_VIO>;
> + #power-domain-cells = <1>;
> + #address-cells = <1>;
> + #size-cells = <0>;
> +
> + power-domain@RK3399_PD_HDCP {
> + reg = <RK3399_PD_HDCP>;
> + clocks = <&cru ACLK_HDCP>,
> + <&cru HCLK_HDCP>,
> + <&cru PCLK_HDCP>;
> + pm_qos = <&qos_hdcp>;
> + #power-domain-cells = <0>;
> + };
> + };
> + };
> + };
> + };
_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH v3] dt-bindings: power: rockchip: Convert to json-schema
2020-10-07 15:11 ` Rob Herring
(?)
@ 2020-10-07 20:57 ` Enric Balletbo Serra
-1 siblings, 0 replies; 21+ messages in thread
From: Enric Balletbo Serra @ 2020-10-07 20:57 UTC (permalink / raw)
To: Rob Herring
Cc: Enric Balletbo i Serra, devicetree, Heiko Stübner,
linux-kernel, Doug Anderson, open list:ARM/Rockchip SoC...,
Collabora Kernel ML, Linux ARM, Caesar Wang
Hi Rob,
Missatge de Rob Herring <robh@kernel.org> del dia dc., 7 d’oct. 2020 a
les 17:12:
>
> On Mon, Sep 21, 2020 at 11:29:51AM +0200, Enric Balletbo i Serra wrote:
> > Convert the soc/rockchip/power_domain.txt binding document to json-schema
> > and move to the power bindings directory.
> >
> > Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
> > ---
> >
> > Changes in v3:
> > - Fixed tab errors found by bot
> >
> > Changes in v2:
> > - Fixed a warning that says that 'syscon' should not be used alone.
> > - Use patternProperties to define a new level for power-domains.
> > - Add const values for power-domain-cells, address-cells, etc.
> >
> > .../power/rockchip,power-controller.yaml | 207 ++++++++++++++++++
> > .../bindings/soc/rockchip/power_domain.txt | 136 ------------
> > 2 files changed, 207 insertions(+), 136 deletions(-)
> > create mode 100644 Documentation/devicetree/bindings/power/rockchip,power-controller.yaml
> > delete mode 100644 Documentation/devicetree/bindings/soc/rockchip/power_domain.txt
> >
> > diff --git a/Documentation/devicetree/bindings/power/rockchip,power-controller.yaml b/Documentation/devicetree/bindings/power/rockchip,power-controller.yaml
> > new file mode 100644
> > index 000000000000..b23ea37e2a08
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/power/rockchip,power-controller.yaml
> > @@ -0,0 +1,207 @@
> > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> > +%YAML 1.2
> > +---
> > +$id: http://devicetree.org/schemas/power/rockchip,power-controller.yaml#
> > +$schema: http://devicetree.org/meta-schemas/core.yaml#
> > +
> > +title: Rockchip Power Domains
> > +
> > +maintainers:
> > + - Caesar Wang <wxt@rock-chips.com>
> > + - Heiko Stuebner <heiko@sntech.de>
> > +
> > +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.
> > +
> > + Power domains contained within power-controller node are generic power domain
> > + providers documented in Documentation/devicetree/bindings/power/power-domain.yaml.
> > +
> > + IP cores belonging to a power domain should contain a 'power-domains'
> > + property that is a phandle for the power domain node representing the domain.
> > +
> > +properties:
> > + $nodename:
> > + const: power-controller
> > +
> > + compatible:
> > + enum:
> > + - rockchip,px30-power-controller
> > + - rockchip,rk3036-power-controller
> > + - rockchip,rk3066-power-controller
> > + - 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
> > +
> > + '#power-domain-cells':
> > + const: 1
> > +
> > + '#address-cells':
> > + const: 1
> > +
> > + '#size-cells':
> > + const: 0
> > +
> > +patternProperties:
> > + "^power-domain@[0-9]+$":
>
> unit-addresses are hex.
>
> > + type: object
> > + description: |
> > + Represents the power domains within the power controller node as documented
> > + in Documentation/devicetree/bindings/power/power-domain.yaml.
> > +
> > + properties:
> > +
> > + '#power-domain-cells':
> > + description:
> > + Must be 0 for nodes representing a single PM domain and 1 for nodes
> > + providing multiple PM domains.
> > +
> > + '#address-cells':
> > + const: 1
> > +
> > + '#size-cells':
> > + const: 0
> > +
> > + reg:
> > + description: |
> > + Power domain index. Valid values are defined 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.
> > + maxItems: 1
>
> Range of values?
>
> > +
> > + clocks:
> > + description: |
> > + A number of phandles to clocks that need to be enabled while power domain
> > + switches state.
>
> Can you at least put a range of how many clocks?
>
> > +
> > + pm_qos:
> > + description: |
> > + A number of phandles to qos blocks which need to be saved and restored
> > + while power domain switches state.
>
> And here.
>
> > +
> > + required:
> > + - reg
>
> additionalProperties: false
>
> 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]+$'
>
When I tried this I got the following error:
rockchip,power-controller.yaml:
patternProperties:^power-domain@[0-9a-f]+$:patternProperties:^power-domain@[0-9a-f]+$:$ref:
'#/patternProperties/^power-domain@[0-9a-f]+$' is not a
'uri-reference'
Not sure if is my environment or I am still doing something silly, can
you confirm that this works for you? It doesn't seem to be any binding
doing this actually.
Thanks,
Enric
> > +
> > +required:
> > + - compatible
> > + - '#power-domain-cells'
> > +
> > +additionalProperties: false
> > +
> > +examples:
> > + - |
> > + #include <dt-bindings/clock/rk3399-cru.h>
> > + #include <dt-bindings/power/rk3399-power.h>
> > +
> > + soc {
> > + #address-cells = <2>;
> > + #size-cells = <2>;
> > +
> > + qos_hdcp: qos@ffa90000 {
> > + compatible = "rockchip,rk3399-qos","syscon";
>
> space ^
>
> > + reg = <0x0 0xffa90000 0x0 0x20>;
> > + };
> > +
> > + qos_iep: qos@ffa98000 {
> > + compatible = "rk3399-qos","syscon";
> > + reg = <0x0 0xffa98000 0x0 0x20>;
> > + };
> > +
> > + qos_rga_r: qos@ffab0000 {
> > + compatible = "rk3399-qos","syscon";
> > + reg = <0x0 0xffab0000 0x0 0x20>;
> > + };
> > +
> > + qos_rga_w: qos@ffab0080 {
> > + compatible = "rk3399-qos","syscon";
> > + reg = <0x0 0xffab0080 0x0 0x20>;
> > + };
> > +
> > + qos_video_m0: qos@ffab8000 {
> > + compatible = "rk3399-qos","syscon";
> > + reg = <0x0 0xffab8000 0x0 0x20>;
> > + };
> > +
> > + qos_video_m1_r: qos@ffac0000 {
> > + compatible = "rk3399-qos","syscon";
> > + reg = <0x0 0xffac0000 0x0 0x20>;
> > + };
> > +
> > + qos_video_m1_w: qos@ffac0080 {
> > + compatible = "rk3399-qos","syscon";
> > + reg = <0x0 0xffac0080 0x0 0x20>;
> > + };
> > +
> > + power-management@ff310000 {
> > + compatible = "rockchip,rk3399-pmu", "syscon", "simple-mfd";
> > + reg = <0x0 0xff310000 0x0 0x1000>;
> > +
> > + power-controller {
> > + compatible = "rockchip,rk3399-power-controller";
> > + #power-domain-cells = <1>;
> > + #address-cells = <1>;
> > + #size-cells = <0>;
> > +
> > + /* These power domains are grouped by VD_CENTER */
> > + power-domain@RK3399_PD_IEP {
> > + reg = <RK3399_PD_IEP>;
> > + clocks = <&cru ACLK_IEP>,
> > + <&cru HCLK_IEP>;
> > + pm_qos = <&qos_iep>;
> > + #power-domain-cells = <0>;
> > + };
> > + power-domain@RK3399_PD_RGA {
> > + reg = <RK3399_PD_RGA>;
> > + clocks = <&cru ACLK_RGA>,
> > + <&cru HCLK_RGA>;
> > + pm_qos = <&qos_rga_r>,
> > + <&qos_rga_w>;
> > + #power-domain-cells = <0>;
> > + };
> > + power-domain@RK3399_PD_VCODEC {
> > + reg = <RK3399_PD_VCODEC>;
> > + clocks = <&cru ACLK_VCODEC>,
> > + <&cru HCLK_VCODEC>;
> > + pm_qos = <&qos_video_m0>;
> > + #power-domain-cells = <0>;
> > + };
> > + power-domain@RK3399_PD_VDU {
> > + reg = <RK3399_PD_VDU>;
> > + clocks = <&cru ACLK_VDU>,
> > + <&cru HCLK_VDU>;
> > + pm_qos = <&qos_video_m1_r>,
> > + <&qos_video_m1_w>;
> > + #power-domain-cells = <0>;
> > + };
> > + power-domain@RK3399_PD_VIO {
> > + reg = <RK3399_PD_VIO>;
> > + #power-domain-cells = <1>;
> > + #address-cells = <1>;
> > + #size-cells = <0>;
> > +
> > + power-domain@RK3399_PD_HDCP {
> > + reg = <RK3399_PD_HDCP>;
> > + clocks = <&cru ACLK_HDCP>,
> > + <&cru HCLK_HDCP>,
> > + <&cru PCLK_HDCP>;
> > + pm_qos = <&qos_hdcp>;
> > + #power-domain-cells = <0>;
> > + };
> > + };
> > + };
> > + };
> > + };
>
> _______________________________________________
> Linux-rockchip mailing list
> Linux-rockchip@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-rockchip
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH v3] dt-bindings: power: rockchip: Convert to json-schema
@ 2020-10-07 20:57 ` Enric Balletbo Serra
0 siblings, 0 replies; 21+ messages in thread
From: Enric Balletbo Serra @ 2020-10-07 20:57 UTC (permalink / raw)
To: Rob Herring
Cc: devicetree, Heiko Stübner, Doug Anderson, linux-kernel,
open list:ARM/Rockchip SoC...,
Enric Balletbo i Serra, Collabora Kernel ML, Linux ARM,
Caesar Wang
Hi Rob,
Missatge de Rob Herring <robh@kernel.org> del dia dc., 7 d’oct. 2020 a
les 17:12:
>
> On Mon, Sep 21, 2020 at 11:29:51AM +0200, Enric Balletbo i Serra wrote:
> > Convert the soc/rockchip/power_domain.txt binding document to json-schema
> > and move to the power bindings directory.
> >
> > Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
> > ---
> >
> > Changes in v3:
> > - Fixed tab errors found by bot
> >
> > Changes in v2:
> > - Fixed a warning that says that 'syscon' should not be used alone.
> > - Use patternProperties to define a new level for power-domains.
> > - Add const values for power-domain-cells, address-cells, etc.
> >
> > .../power/rockchip,power-controller.yaml | 207 ++++++++++++++++++
> > .../bindings/soc/rockchip/power_domain.txt | 136 ------------
> > 2 files changed, 207 insertions(+), 136 deletions(-)
> > create mode 100644 Documentation/devicetree/bindings/power/rockchip,power-controller.yaml
> > delete mode 100644 Documentation/devicetree/bindings/soc/rockchip/power_domain.txt
> >
> > diff --git a/Documentation/devicetree/bindings/power/rockchip,power-controller.yaml b/Documentation/devicetree/bindings/power/rockchip,power-controller.yaml
> > new file mode 100644
> > index 000000000000..b23ea37e2a08
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/power/rockchip,power-controller.yaml
> > @@ -0,0 +1,207 @@
> > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> > +%YAML 1.2
> > +---
> > +$id: http://devicetree.org/schemas/power/rockchip,power-controller.yaml#
> > +$schema: http://devicetree.org/meta-schemas/core.yaml#
> > +
> > +title: Rockchip Power Domains
> > +
> > +maintainers:
> > + - Caesar Wang <wxt@rock-chips.com>
> > + - Heiko Stuebner <heiko@sntech.de>
> > +
> > +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.
> > +
> > + Power domains contained within power-controller node are generic power domain
> > + providers documented in Documentation/devicetree/bindings/power/power-domain.yaml.
> > +
> > + IP cores belonging to a power domain should contain a 'power-domains'
> > + property that is a phandle for the power domain node representing the domain.
> > +
> > +properties:
> > + $nodename:
> > + const: power-controller
> > +
> > + compatible:
> > + enum:
> > + - rockchip,px30-power-controller
> > + - rockchip,rk3036-power-controller
> > + - rockchip,rk3066-power-controller
> > + - 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
> > +
> > + '#power-domain-cells':
> > + const: 1
> > +
> > + '#address-cells':
> > + const: 1
> > +
> > + '#size-cells':
> > + const: 0
> > +
> > +patternProperties:
> > + "^power-domain@[0-9]+$":
>
> unit-addresses are hex.
>
> > + type: object
> > + description: |
> > + Represents the power domains within the power controller node as documented
> > + in Documentation/devicetree/bindings/power/power-domain.yaml.
> > +
> > + properties:
> > +
> > + '#power-domain-cells':
> > + description:
> > + Must be 0 for nodes representing a single PM domain and 1 for nodes
> > + providing multiple PM domains.
> > +
> > + '#address-cells':
> > + const: 1
> > +
> > + '#size-cells':
> > + const: 0
> > +
> > + reg:
> > + description: |
> > + Power domain index. Valid values are defined 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.
> > + maxItems: 1
>
> Range of values?
>
> > +
> > + clocks:
> > + description: |
> > + A number of phandles to clocks that need to be enabled while power domain
> > + switches state.
>
> Can you at least put a range of how many clocks?
>
> > +
> > + pm_qos:
> > + description: |
> > + A number of phandles to qos blocks which need to be saved and restored
> > + while power domain switches state.
>
> And here.
>
> > +
> > + required:
> > + - reg
>
> additionalProperties: false
>
> 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]+$'
>
When I tried this I got the following error:
rockchip,power-controller.yaml:
patternProperties:^power-domain@[0-9a-f]+$:patternProperties:^power-domain@[0-9a-f]+$:$ref:
'#/patternProperties/^power-domain@[0-9a-f]+$' is not a
'uri-reference'
Not sure if is my environment or I am still doing something silly, can
you confirm that this works for you? It doesn't seem to be any binding
doing this actually.
Thanks,
Enric
> > +
> > +required:
> > + - compatible
> > + - '#power-domain-cells'
> > +
> > +additionalProperties: false
> > +
> > +examples:
> > + - |
> > + #include <dt-bindings/clock/rk3399-cru.h>
> > + #include <dt-bindings/power/rk3399-power.h>
> > +
> > + soc {
> > + #address-cells = <2>;
> > + #size-cells = <2>;
> > +
> > + qos_hdcp: qos@ffa90000 {
> > + compatible = "rockchip,rk3399-qos","syscon";
>
> space ^
>
> > + reg = <0x0 0xffa90000 0x0 0x20>;
> > + };
> > +
> > + qos_iep: qos@ffa98000 {
> > + compatible = "rk3399-qos","syscon";
> > + reg = <0x0 0xffa98000 0x0 0x20>;
> > + };
> > +
> > + qos_rga_r: qos@ffab0000 {
> > + compatible = "rk3399-qos","syscon";
> > + reg = <0x0 0xffab0000 0x0 0x20>;
> > + };
> > +
> > + qos_rga_w: qos@ffab0080 {
> > + compatible = "rk3399-qos","syscon";
> > + reg = <0x0 0xffab0080 0x0 0x20>;
> > + };
> > +
> > + qos_video_m0: qos@ffab8000 {
> > + compatible = "rk3399-qos","syscon";
> > + reg = <0x0 0xffab8000 0x0 0x20>;
> > + };
> > +
> > + qos_video_m1_r: qos@ffac0000 {
> > + compatible = "rk3399-qos","syscon";
> > + reg = <0x0 0xffac0000 0x0 0x20>;
> > + };
> > +
> > + qos_video_m1_w: qos@ffac0080 {
> > + compatible = "rk3399-qos","syscon";
> > + reg = <0x0 0xffac0080 0x0 0x20>;
> > + };
> > +
> > + power-management@ff310000 {
> > + compatible = "rockchip,rk3399-pmu", "syscon", "simple-mfd";
> > + reg = <0x0 0xff310000 0x0 0x1000>;
> > +
> > + power-controller {
> > + compatible = "rockchip,rk3399-power-controller";
> > + #power-domain-cells = <1>;
> > + #address-cells = <1>;
> > + #size-cells = <0>;
> > +
> > + /* These power domains are grouped by VD_CENTER */
> > + power-domain@RK3399_PD_IEP {
> > + reg = <RK3399_PD_IEP>;
> > + clocks = <&cru ACLK_IEP>,
> > + <&cru HCLK_IEP>;
> > + pm_qos = <&qos_iep>;
> > + #power-domain-cells = <0>;
> > + };
> > + power-domain@RK3399_PD_RGA {
> > + reg = <RK3399_PD_RGA>;
> > + clocks = <&cru ACLK_RGA>,
> > + <&cru HCLK_RGA>;
> > + pm_qos = <&qos_rga_r>,
> > + <&qos_rga_w>;
> > + #power-domain-cells = <0>;
> > + };
> > + power-domain@RK3399_PD_VCODEC {
> > + reg = <RK3399_PD_VCODEC>;
> > + clocks = <&cru ACLK_VCODEC>,
> > + <&cru HCLK_VCODEC>;
> > + pm_qos = <&qos_video_m0>;
> > + #power-domain-cells = <0>;
> > + };
> > + power-domain@RK3399_PD_VDU {
> > + reg = <RK3399_PD_VDU>;
> > + clocks = <&cru ACLK_VDU>,
> > + <&cru HCLK_VDU>;
> > + pm_qos = <&qos_video_m1_r>,
> > + <&qos_video_m1_w>;
> > + #power-domain-cells = <0>;
> > + };
> > + power-domain@RK3399_PD_VIO {
> > + reg = <RK3399_PD_VIO>;
> > + #power-domain-cells = <1>;
> > + #address-cells = <1>;
> > + #size-cells = <0>;
> > +
> > + power-domain@RK3399_PD_HDCP {
> > + reg = <RK3399_PD_HDCP>;
> > + clocks = <&cru ACLK_HDCP>,
> > + <&cru HCLK_HDCP>,
> > + <&cru PCLK_HDCP>;
> > + pm_qos = <&qos_hdcp>;
> > + #power-domain-cells = <0>;
> > + };
> > + };
> > + };
> > + };
> > + };
>
> _______________________________________________
> Linux-rockchip mailing list
> Linux-rockchip@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-rockchip
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH v3] dt-bindings: power: rockchip: Convert to json-schema
@ 2020-10-07 20:57 ` Enric Balletbo Serra
0 siblings, 0 replies; 21+ messages in thread
From: Enric Balletbo Serra @ 2020-10-07 20:57 UTC (permalink / raw)
To: Rob Herring
Cc: devicetree, Heiko Stübner, Doug Anderson, linux-kernel,
open list:ARM/Rockchip SoC...,
Enric Balletbo i Serra, Collabora Kernel ML, Linux ARM,
Caesar Wang
Hi Rob,
Missatge de Rob Herring <robh@kernel.org> del dia dc., 7 d’oct. 2020 a
les 17:12:
>
> On Mon, Sep 21, 2020 at 11:29:51AM +0200, Enric Balletbo i Serra wrote:
> > Convert the soc/rockchip/power_domain.txt binding document to json-schema
> > and move to the power bindings directory.
> >
> > Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
> > ---
> >
> > Changes in v3:
> > - Fixed tab errors found by bot
> >
> > Changes in v2:
> > - Fixed a warning that says that 'syscon' should not be used alone.
> > - Use patternProperties to define a new level for power-domains.
> > - Add const values for power-domain-cells, address-cells, etc.
> >
> > .../power/rockchip,power-controller.yaml | 207 ++++++++++++++++++
> > .../bindings/soc/rockchip/power_domain.txt | 136 ------------
> > 2 files changed, 207 insertions(+), 136 deletions(-)
> > create mode 100644 Documentation/devicetree/bindings/power/rockchip,power-controller.yaml
> > delete mode 100644 Documentation/devicetree/bindings/soc/rockchip/power_domain.txt
> >
> > diff --git a/Documentation/devicetree/bindings/power/rockchip,power-controller.yaml b/Documentation/devicetree/bindings/power/rockchip,power-controller.yaml
> > new file mode 100644
> > index 000000000000..b23ea37e2a08
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/power/rockchip,power-controller.yaml
> > @@ -0,0 +1,207 @@
> > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> > +%YAML 1.2
> > +---
> > +$id: http://devicetree.org/schemas/power/rockchip,power-controller.yaml#
> > +$schema: http://devicetree.org/meta-schemas/core.yaml#
> > +
> > +title: Rockchip Power Domains
> > +
> > +maintainers:
> > + - Caesar Wang <wxt@rock-chips.com>
> > + - Heiko Stuebner <heiko@sntech.de>
> > +
> > +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.
> > +
> > + Power domains contained within power-controller node are generic power domain
> > + providers documented in Documentation/devicetree/bindings/power/power-domain.yaml.
> > +
> > + IP cores belonging to a power domain should contain a 'power-domains'
> > + property that is a phandle for the power domain node representing the domain.
> > +
> > +properties:
> > + $nodename:
> > + const: power-controller
> > +
> > + compatible:
> > + enum:
> > + - rockchip,px30-power-controller
> > + - rockchip,rk3036-power-controller
> > + - rockchip,rk3066-power-controller
> > + - 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
> > +
> > + '#power-domain-cells':
> > + const: 1
> > +
> > + '#address-cells':
> > + const: 1
> > +
> > + '#size-cells':
> > + const: 0
> > +
> > +patternProperties:
> > + "^power-domain@[0-9]+$":
>
> unit-addresses are hex.
>
> > + type: object
> > + description: |
> > + Represents the power domains within the power controller node as documented
> > + in Documentation/devicetree/bindings/power/power-domain.yaml.
> > +
> > + properties:
> > +
> > + '#power-domain-cells':
> > + description:
> > + Must be 0 for nodes representing a single PM domain and 1 for nodes
> > + providing multiple PM domains.
> > +
> > + '#address-cells':
> > + const: 1
> > +
> > + '#size-cells':
> > + const: 0
> > +
> > + reg:
> > + description: |
> > + Power domain index. Valid values are defined 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.
> > + maxItems: 1
>
> Range of values?
>
> > +
> > + clocks:
> > + description: |
> > + A number of phandles to clocks that need to be enabled while power domain
> > + switches state.
>
> Can you at least put a range of how many clocks?
>
> > +
> > + pm_qos:
> > + description: |
> > + A number of phandles to qos blocks which need to be saved and restored
> > + while power domain switches state.
>
> And here.
>
> > +
> > + required:
> > + - reg
>
> additionalProperties: false
>
> 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]+$'
>
When I tried this I got the following error:
rockchip,power-controller.yaml:
patternProperties:^power-domain@[0-9a-f]+$:patternProperties:^power-domain@[0-9a-f]+$:$ref:
'#/patternProperties/^power-domain@[0-9a-f]+$' is not a
'uri-reference'
Not sure if is my environment or I am still doing something silly, can
you confirm that this works for you? It doesn't seem to be any binding
doing this actually.
Thanks,
Enric
> > +
> > +required:
> > + - compatible
> > + - '#power-domain-cells'
> > +
> > +additionalProperties: false
> > +
> > +examples:
> > + - |
> > + #include <dt-bindings/clock/rk3399-cru.h>
> > + #include <dt-bindings/power/rk3399-power.h>
> > +
> > + soc {
> > + #address-cells = <2>;
> > + #size-cells = <2>;
> > +
> > + qos_hdcp: qos@ffa90000 {
> > + compatible = "rockchip,rk3399-qos","syscon";
>
> space ^
>
> > + reg = <0x0 0xffa90000 0x0 0x20>;
> > + };
> > +
> > + qos_iep: qos@ffa98000 {
> > + compatible = "rk3399-qos","syscon";
> > + reg = <0x0 0xffa98000 0x0 0x20>;
> > + };
> > +
> > + qos_rga_r: qos@ffab0000 {
> > + compatible = "rk3399-qos","syscon";
> > + reg = <0x0 0xffab0000 0x0 0x20>;
> > + };
> > +
> > + qos_rga_w: qos@ffab0080 {
> > + compatible = "rk3399-qos","syscon";
> > + reg = <0x0 0xffab0080 0x0 0x20>;
> > + };
> > +
> > + qos_video_m0: qos@ffab8000 {
> > + compatible = "rk3399-qos","syscon";
> > + reg = <0x0 0xffab8000 0x0 0x20>;
> > + };
> > +
> > + qos_video_m1_r: qos@ffac0000 {
> > + compatible = "rk3399-qos","syscon";
> > + reg = <0x0 0xffac0000 0x0 0x20>;
> > + };
> > +
> > + qos_video_m1_w: qos@ffac0080 {
> > + compatible = "rk3399-qos","syscon";
> > + reg = <0x0 0xffac0080 0x0 0x20>;
> > + };
> > +
> > + power-management@ff310000 {
> > + compatible = "rockchip,rk3399-pmu", "syscon", "simple-mfd";
> > + reg = <0x0 0xff310000 0x0 0x1000>;
> > +
> > + power-controller {
> > + compatible = "rockchip,rk3399-power-controller";
> > + #power-domain-cells = <1>;
> > + #address-cells = <1>;
> > + #size-cells = <0>;
> > +
> > + /* These power domains are grouped by VD_CENTER */
> > + power-domain@RK3399_PD_IEP {
> > + reg = <RK3399_PD_IEP>;
> > + clocks = <&cru ACLK_IEP>,
> > + <&cru HCLK_IEP>;
> > + pm_qos = <&qos_iep>;
> > + #power-domain-cells = <0>;
> > + };
> > + power-domain@RK3399_PD_RGA {
> > + reg = <RK3399_PD_RGA>;
> > + clocks = <&cru ACLK_RGA>,
> > + <&cru HCLK_RGA>;
> > + pm_qos = <&qos_rga_r>,
> > + <&qos_rga_w>;
> > + #power-domain-cells = <0>;
> > + };
> > + power-domain@RK3399_PD_VCODEC {
> > + reg = <RK3399_PD_VCODEC>;
> > + clocks = <&cru ACLK_VCODEC>,
> > + <&cru HCLK_VCODEC>;
> > + pm_qos = <&qos_video_m0>;
> > + #power-domain-cells = <0>;
> > + };
> > + power-domain@RK3399_PD_VDU {
> > + reg = <RK3399_PD_VDU>;
> > + clocks = <&cru ACLK_VDU>,
> > + <&cru HCLK_VDU>;
> > + pm_qos = <&qos_video_m1_r>,
> > + <&qos_video_m1_w>;
> > + #power-domain-cells = <0>;
> > + };
> > + power-domain@RK3399_PD_VIO {
> > + reg = <RK3399_PD_VIO>;
> > + #power-domain-cells = <1>;
> > + #address-cells = <1>;
> > + #size-cells = <0>;
> > +
> > + power-domain@RK3399_PD_HDCP {
> > + reg = <RK3399_PD_HDCP>;
> > + clocks = <&cru ACLK_HDCP>,
> > + <&cru HCLK_HDCP>,
> > + <&cru PCLK_HDCP>;
> > + pm_qos = <&qos_hdcp>;
> > + #power-domain-cells = <0>;
> > + };
> > + };
> > + };
> > + };
> > + };
>
> _______________________________________________
> Linux-rockchip mailing list
> Linux-rockchip@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-rockchip
_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH v3] dt-bindings: power: rockchip: Convert to json-schema
2020-10-07 20:57 ` Enric Balletbo Serra
(?)
@ 2020-10-08 19:47 ` Rob Herring
-1 siblings, 0 replies; 21+ messages in thread
From: Rob Herring @ 2020-10-08 19:47 UTC (permalink / raw)
To: Enric Balletbo Serra
Cc: Enric Balletbo i Serra, devicetree, Heiko Stübner,
linux-kernel, Doug Anderson, open list:ARM/Rockchip SoC...,
Collabora Kernel ML, Linux ARM, Caesar Wang
On Wed, Oct 7, 2020 at 3:57 PM Enric Balletbo Serra <eballetbo@gmail.com> wrote:
>
> Hi Rob,
>
> Missatge de Rob Herring <robh@kernel.org> del dia dc., 7 d’oct. 2020 a
> les 17:12:
> >
> > On Mon, Sep 21, 2020 at 11:29:51AM +0200, Enric Balletbo i Serra wrote:
> > > Convert the soc/rockchip/power_domain.txt binding document to json-schema
> > > and move to the power bindings directory.
> > >
> > > Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
> > > ---
> > >
> > > Changes in v3:
> > > - Fixed tab errors found by bot
> > >
> > > Changes in v2:
> > > - Fixed a warning that says that 'syscon' should not be used alone.
> > > - Use patternProperties to define a new level for power-domains.
> > > - Add const values for power-domain-cells, address-cells, etc.
> > >
> > > .../power/rockchip,power-controller.yaml | 207 ++++++++++++++++++
> > > .../bindings/soc/rockchip/power_domain.txt | 136 ------------
> > > 2 files changed, 207 insertions(+), 136 deletions(-)
> > > create mode 100644 Documentation/devicetree/bindings/power/rockchip,power-controller.yaml
> > > delete mode 100644 Documentation/devicetree/bindings/soc/rockchip/power_domain.txt
> > >
> > > diff --git a/Documentation/devicetree/bindings/power/rockchip,power-controller.yaml b/Documentation/devicetree/bindings/power/rockchip,power-controller.yaml
> > > new file mode 100644
> > > index 000000000000..b23ea37e2a08
> > > --- /dev/null
> > > +++ b/Documentation/devicetree/bindings/power/rockchip,power-controller.yaml
> > > @@ -0,0 +1,207 @@
> > > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> > > +%YAML 1.2
> > > +---
> > > +$id: http://devicetree.org/schemas/power/rockchip,power-controller.yaml#
> > > +$schema: http://devicetree.org/meta-schemas/core.yaml#
> > > +
> > > +title: Rockchip Power Domains
> > > +
> > > +maintainers:
> > > + - Caesar Wang <wxt@rock-chips.com>
> > > + - Heiko Stuebner <heiko@sntech.de>
> > > +
> > > +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.
> > > +
> > > + Power domains contained within power-controller node are generic power domain
> > > + providers documented in Documentation/devicetree/bindings/power/power-domain.yaml.
> > > +
> > > + IP cores belonging to a power domain should contain a 'power-domains'
> > > + property that is a phandle for the power domain node representing the domain.
> > > +
> > > +properties:
> > > + $nodename:
> > > + const: power-controller
> > > +
> > > + compatible:
> > > + enum:
> > > + - rockchip,px30-power-controller
> > > + - rockchip,rk3036-power-controller
> > > + - rockchip,rk3066-power-controller
> > > + - 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
> > > +
> > > + '#power-domain-cells':
> > > + const: 1
> > > +
> > > + '#address-cells':
> > > + const: 1
> > > +
> > > + '#size-cells':
> > > + const: 0
> > > +
> > > +patternProperties:
> > > + "^power-domain@[0-9]+$":
> >
> > unit-addresses are hex.
> >
> > > + type: object
> > > + description: |
> > > + Represents the power domains within the power controller node as documented
> > > + in Documentation/devicetree/bindings/power/power-domain.yaml.
> > > +
> > > + properties:
> > > +
> > > + '#power-domain-cells':
> > > + description:
> > > + Must be 0 for nodes representing a single PM domain and 1 for nodes
> > > + providing multiple PM domains.
> > > +
> > > + '#address-cells':
> > > + const: 1
> > > +
> > > + '#size-cells':
> > > + const: 0
> > > +
> > > + reg:
> > > + description: |
> > > + Power domain index. Valid values are defined 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.
> > > + maxItems: 1
> >
> > Range of values?
> >
> > > +
> > > + clocks:
> > > + description: |
> > > + A number of phandles to clocks that need to be enabled while power domain
> > > + switches state.
> >
> > Can you at least put a range of how many clocks?
> >
> > > +
> > > + pm_qos:
> > > + description: |
> > > + A number of phandles to qos blocks which need to be saved and restored
> > > + while power domain switches state.
> >
> > And here.
> >
> > > +
> > > + required:
> > > + - reg
> >
> > additionalProperties: false
> >
> > 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]+$'
> >
>
> When I tried this I got the following error:
>
> rockchip,power-controller.yaml:
> patternProperties:^power-domain@[0-9a-f]+$:patternProperties:^power-domain@[0-9a-f]+$:$ref:
> '#/patternProperties/^power-domain@[0-9a-f]+$' is not a
> 'uri-reference'
>
> Not sure if is my environment or I am still doing something silly, can
> you confirm that this works for you? It doesn't seem to be any binding
> doing this actually.
I think the regex would have to be escaped to be a valid URI:
$ref: '%23/patternProperties/%5Epower-domain@%5B0-9a-f%5D+%24'
That's not the most readable nor am I sure it would get translated
back to the right path, so it's probably going to be best to just
define the child nodes even if duplicated.
Rob
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH v3] dt-bindings: power: rockchip: Convert to json-schema
@ 2020-10-08 19:47 ` Rob Herring
0 siblings, 0 replies; 21+ messages in thread
From: Rob Herring @ 2020-10-08 19:47 UTC (permalink / raw)
To: Enric Balletbo Serra
Cc: devicetree, Heiko Stübner, Doug Anderson, linux-kernel,
open list:ARM/Rockchip SoC...,
Enric Balletbo i Serra, Collabora Kernel ML, Linux ARM,
Caesar Wang
On Wed, Oct 7, 2020 at 3:57 PM Enric Balletbo Serra <eballetbo@gmail.com> wrote:
>
> Hi Rob,
>
> Missatge de Rob Herring <robh@kernel.org> del dia dc., 7 d’oct. 2020 a
> les 17:12:
> >
> > On Mon, Sep 21, 2020 at 11:29:51AM +0200, Enric Balletbo i Serra wrote:
> > > Convert the soc/rockchip/power_domain.txt binding document to json-schema
> > > and move to the power bindings directory.
> > >
> > > Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
> > > ---
> > >
> > > Changes in v3:
> > > - Fixed tab errors found by bot
> > >
> > > Changes in v2:
> > > - Fixed a warning that says that 'syscon' should not be used alone.
> > > - Use patternProperties to define a new level for power-domains.
> > > - Add const values for power-domain-cells, address-cells, etc.
> > >
> > > .../power/rockchip,power-controller.yaml | 207 ++++++++++++++++++
> > > .../bindings/soc/rockchip/power_domain.txt | 136 ------------
> > > 2 files changed, 207 insertions(+), 136 deletions(-)
> > > create mode 100644 Documentation/devicetree/bindings/power/rockchip,power-controller.yaml
> > > delete mode 100644 Documentation/devicetree/bindings/soc/rockchip/power_domain.txt
> > >
> > > diff --git a/Documentation/devicetree/bindings/power/rockchip,power-controller.yaml b/Documentation/devicetree/bindings/power/rockchip,power-controller.yaml
> > > new file mode 100644
> > > index 000000000000..b23ea37e2a08
> > > --- /dev/null
> > > +++ b/Documentation/devicetree/bindings/power/rockchip,power-controller.yaml
> > > @@ -0,0 +1,207 @@
> > > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> > > +%YAML 1.2
> > > +---
> > > +$id: http://devicetree.org/schemas/power/rockchip,power-controller.yaml#
> > > +$schema: http://devicetree.org/meta-schemas/core.yaml#
> > > +
> > > +title: Rockchip Power Domains
> > > +
> > > +maintainers:
> > > + - Caesar Wang <wxt@rock-chips.com>
> > > + - Heiko Stuebner <heiko@sntech.de>
> > > +
> > > +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.
> > > +
> > > + Power domains contained within power-controller node are generic power domain
> > > + providers documented in Documentation/devicetree/bindings/power/power-domain.yaml.
> > > +
> > > + IP cores belonging to a power domain should contain a 'power-domains'
> > > + property that is a phandle for the power domain node representing the domain.
> > > +
> > > +properties:
> > > + $nodename:
> > > + const: power-controller
> > > +
> > > + compatible:
> > > + enum:
> > > + - rockchip,px30-power-controller
> > > + - rockchip,rk3036-power-controller
> > > + - rockchip,rk3066-power-controller
> > > + - 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
> > > +
> > > + '#power-domain-cells':
> > > + const: 1
> > > +
> > > + '#address-cells':
> > > + const: 1
> > > +
> > > + '#size-cells':
> > > + const: 0
> > > +
> > > +patternProperties:
> > > + "^power-domain@[0-9]+$":
> >
> > unit-addresses are hex.
> >
> > > + type: object
> > > + description: |
> > > + Represents the power domains within the power controller node as documented
> > > + in Documentation/devicetree/bindings/power/power-domain.yaml.
> > > +
> > > + properties:
> > > +
> > > + '#power-domain-cells':
> > > + description:
> > > + Must be 0 for nodes representing a single PM domain and 1 for nodes
> > > + providing multiple PM domains.
> > > +
> > > + '#address-cells':
> > > + const: 1
> > > +
> > > + '#size-cells':
> > > + const: 0
> > > +
> > > + reg:
> > > + description: |
> > > + Power domain index. Valid values are defined 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.
> > > + maxItems: 1
> >
> > Range of values?
> >
> > > +
> > > + clocks:
> > > + description: |
> > > + A number of phandles to clocks that need to be enabled while power domain
> > > + switches state.
> >
> > Can you at least put a range of how many clocks?
> >
> > > +
> > > + pm_qos:
> > > + description: |
> > > + A number of phandles to qos blocks which need to be saved and restored
> > > + while power domain switches state.
> >
> > And here.
> >
> > > +
> > > + required:
> > > + - reg
> >
> > additionalProperties: false
> >
> > 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]+$'
> >
>
> When I tried this I got the following error:
>
> rockchip,power-controller.yaml:
> patternProperties:^power-domain@[0-9a-f]+$:patternProperties:^power-domain@[0-9a-f]+$:$ref:
> '#/patternProperties/^power-domain@[0-9a-f]+$' is not a
> 'uri-reference'
>
> Not sure if is my environment or I am still doing something silly, can
> you confirm that this works for you? It doesn't seem to be any binding
> doing this actually.
I think the regex would have to be escaped to be a valid URI:
$ref: '%23/patternProperties/%5Epower-domain@%5B0-9a-f%5D+%24'
That's not the most readable nor am I sure it would get translated
back to the right path, so it's probably going to be best to just
define the child nodes even if duplicated.
Rob
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH v3] dt-bindings: power: rockchip: Convert to json-schema
@ 2020-10-08 19:47 ` Rob Herring
0 siblings, 0 replies; 21+ messages in thread
From: Rob Herring @ 2020-10-08 19:47 UTC (permalink / raw)
To: Enric Balletbo Serra
Cc: devicetree, Heiko Stübner, Doug Anderson, linux-kernel,
open list:ARM/Rockchip SoC...,
Enric Balletbo i Serra, Collabora Kernel ML, Linux ARM,
Caesar Wang
On Wed, Oct 7, 2020 at 3:57 PM Enric Balletbo Serra <eballetbo@gmail.com> wrote:
>
> Hi Rob,
>
> Missatge de Rob Herring <robh@kernel.org> del dia dc., 7 d’oct. 2020 a
> les 17:12:
> >
> > On Mon, Sep 21, 2020 at 11:29:51AM +0200, Enric Balletbo i Serra wrote:
> > > Convert the soc/rockchip/power_domain.txt binding document to json-schema
> > > and move to the power bindings directory.
> > >
> > > Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
> > > ---
> > >
> > > Changes in v3:
> > > - Fixed tab errors found by bot
> > >
> > > Changes in v2:
> > > - Fixed a warning that says that 'syscon' should not be used alone.
> > > - Use patternProperties to define a new level for power-domains.
> > > - Add const values for power-domain-cells, address-cells, etc.
> > >
> > > .../power/rockchip,power-controller.yaml | 207 ++++++++++++++++++
> > > .../bindings/soc/rockchip/power_domain.txt | 136 ------------
> > > 2 files changed, 207 insertions(+), 136 deletions(-)
> > > create mode 100644 Documentation/devicetree/bindings/power/rockchip,power-controller.yaml
> > > delete mode 100644 Documentation/devicetree/bindings/soc/rockchip/power_domain.txt
> > >
> > > diff --git a/Documentation/devicetree/bindings/power/rockchip,power-controller.yaml b/Documentation/devicetree/bindings/power/rockchip,power-controller.yaml
> > > new file mode 100644
> > > index 000000000000..b23ea37e2a08
> > > --- /dev/null
> > > +++ b/Documentation/devicetree/bindings/power/rockchip,power-controller.yaml
> > > @@ -0,0 +1,207 @@
> > > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> > > +%YAML 1.2
> > > +---
> > > +$id: http://devicetree.org/schemas/power/rockchip,power-controller.yaml#
> > > +$schema: http://devicetree.org/meta-schemas/core.yaml#
> > > +
> > > +title: Rockchip Power Domains
> > > +
> > > +maintainers:
> > > + - Caesar Wang <wxt@rock-chips.com>
> > > + - Heiko Stuebner <heiko@sntech.de>
> > > +
> > > +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.
> > > +
> > > + Power domains contained within power-controller node are generic power domain
> > > + providers documented in Documentation/devicetree/bindings/power/power-domain.yaml.
> > > +
> > > + IP cores belonging to a power domain should contain a 'power-domains'
> > > + property that is a phandle for the power domain node representing the domain.
> > > +
> > > +properties:
> > > + $nodename:
> > > + const: power-controller
> > > +
> > > + compatible:
> > > + enum:
> > > + - rockchip,px30-power-controller
> > > + - rockchip,rk3036-power-controller
> > > + - rockchip,rk3066-power-controller
> > > + - 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
> > > +
> > > + '#power-domain-cells':
> > > + const: 1
> > > +
> > > + '#address-cells':
> > > + const: 1
> > > +
> > > + '#size-cells':
> > > + const: 0
> > > +
> > > +patternProperties:
> > > + "^power-domain@[0-9]+$":
> >
> > unit-addresses are hex.
> >
> > > + type: object
> > > + description: |
> > > + Represents the power domains within the power controller node as documented
> > > + in Documentation/devicetree/bindings/power/power-domain.yaml.
> > > +
> > > + properties:
> > > +
> > > + '#power-domain-cells':
> > > + description:
> > > + Must be 0 for nodes representing a single PM domain and 1 for nodes
> > > + providing multiple PM domains.
> > > +
> > > + '#address-cells':
> > > + const: 1
> > > +
> > > + '#size-cells':
> > > + const: 0
> > > +
> > > + reg:
> > > + description: |
> > > + Power domain index. Valid values are defined 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.
> > > + maxItems: 1
> >
> > Range of values?
> >
> > > +
> > > + clocks:
> > > + description: |
> > > + A number of phandles to clocks that need to be enabled while power domain
> > > + switches state.
> >
> > Can you at least put a range of how many clocks?
> >
> > > +
> > > + pm_qos:
> > > + description: |
> > > + A number of phandles to qos blocks which need to be saved and restored
> > > + while power domain switches state.
> >
> > And here.
> >
> > > +
> > > + required:
> > > + - reg
> >
> > additionalProperties: false
> >
> > 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]+$'
> >
>
> When I tried this I got the following error:
>
> rockchip,power-controller.yaml:
> patternProperties:^power-domain@[0-9a-f]+$:patternProperties:^power-domain@[0-9a-f]+$:$ref:
> '#/patternProperties/^power-domain@[0-9a-f]+$' is not a
> 'uri-reference'
>
> Not sure if is my environment or I am still doing something silly, can
> you confirm that this works for you? It doesn't seem to be any binding
> doing this actually.
I think the regex would have to be escaped to be a valid URI:
$ref: '%23/patternProperties/%5Epower-domain@%5B0-9a-f%5D+%24'
That's not the most readable nor am I sure it would get translated
back to the right path, so it's probably going to be best to just
define the child nodes even if duplicated.
Rob
_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH v3] dt-bindings: power: rockchip: Convert to json-schema
2020-10-08 19:47 ` Rob Herring
(?)
@ 2020-10-11 9:01 ` Enric Balletbo i Serra
-1 siblings, 0 replies; 21+ messages in thread
From: Enric Balletbo i Serra @ 2020-10-11 9:01 UTC (permalink / raw)
To: Rob Herring, Enric Balletbo Serra
Cc: devicetree, Heiko Stübner, linux-kernel, Doug Anderson,
open list:ARM/Rockchip SoC...,
Collabora Kernel ML, Linux ARM, Caesar Wang
Hi Rob,
On 8/10/20 21:47, Rob Herring wrote:
> On Wed, Oct 7, 2020 at 3:57 PM Enric Balletbo Serra <eballetbo@gmail.com> wrote:
>>
>> Hi Rob,
>>
>> Missatge de Rob Herring <robh@kernel.org> del dia dc., 7 d’oct. 2020 a
>> les 17:12:
>>>
>>> On Mon, Sep 21, 2020 at 11:29:51AM +0200, Enric Balletbo i Serra wrote:
>>>> Convert the soc/rockchip/power_domain.txt binding document to json-schema
>>>> and move to the power bindings directory.
>>>>
>>>> Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
>>>> ---
>>>>
>>>> Changes in v3:
>>>> - Fixed tab errors found by bot
>>>>
>>>> Changes in v2:
>>>> - Fixed a warning that says that 'syscon' should not be used alone.
>>>> - Use patternProperties to define a new level for power-domains.
>>>> - Add const values for power-domain-cells, address-cells, etc.
>>>>
>>>> .../power/rockchip,power-controller.yaml | 207 ++++++++++++++++++
>>>> .../bindings/soc/rockchip/power_domain.txt | 136 ------------
>>>> 2 files changed, 207 insertions(+), 136 deletions(-)
>>>> create mode 100644 Documentation/devicetree/bindings/power/rockchip,power-controller.yaml
>>>> delete mode 100644 Documentation/devicetree/bindings/soc/rockchip/power_domain.txt
>>>>
>>>> diff --git a/Documentation/devicetree/bindings/power/rockchip,power-controller.yaml b/Documentation/devicetree/bindings/power/rockchip,power-controller.yaml
>>>> new file mode 100644
>>>> index 000000000000..b23ea37e2a08
>>>> --- /dev/null
>>>> +++ b/Documentation/devicetree/bindings/power/rockchip,power-controller.yaml
>>>> @@ -0,0 +1,207 @@
>>>> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
>>>> +%YAML 1.2
>>>> +---
>>>> +$id: http://devicetree.org/schemas/power/rockchip,power-controller.yaml#
>>>> +$schema: http://devicetree.org/meta-schemas/core.yaml#
>>>> +
>>>> +title: Rockchip Power Domains
>>>> +
>>>> +maintainers:
>>>> + - Caesar Wang <wxt@rock-chips.com>
>>>> + - Heiko Stuebner <heiko@sntech.de>
>>>> +
>>>> +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.
>>>> +
>>>> + Power domains contained within power-controller node are generic power domain
>>>> + providers documented in Documentation/devicetree/bindings/power/power-domain.yaml.
>>>> +
>>>> + IP cores belonging to a power domain should contain a 'power-domains'
>>>> + property that is a phandle for the power domain node representing the domain.
>>>> +
>>>> +properties:
>>>> + $nodename:
>>>> + const: power-controller
>>>> +
>>>> + compatible:
>>>> + enum:
>>>> + - rockchip,px30-power-controller
>>>> + - rockchip,rk3036-power-controller
>>>> + - rockchip,rk3066-power-controller
>>>> + - 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
>>>> +
>>>> + '#power-domain-cells':
>>>> + const: 1
>>>> +
>>>> + '#address-cells':
>>>> + const: 1
>>>> +
>>>> + '#size-cells':
>>>> + const: 0
>>>> +
>>>> +patternProperties:
>>>> + "^power-domain@[0-9]+$":
>>>
>>> unit-addresses are hex.
>>>
>>>> + type: object
>>>> + description: |
>>>> + Represents the power domains within the power controller node as documented
>>>> + in Documentation/devicetree/bindings/power/power-domain.yaml.
>>>> +
>>>> + properties:
>>>> +
>>>> + '#power-domain-cells':
>>>> + description:
>>>> + Must be 0 for nodes representing a single PM domain and 1 for nodes
>>>> + providing multiple PM domains.
>>>> +
>>>> + '#address-cells':
>>>> + const: 1
>>>> +
>>>> + '#size-cells':
>>>> + const: 0
>>>> +
>>>> + reg:
>>>> + description: |
>>>> + Power domain index. Valid values are defined 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.
>>>> + maxItems: 1
>>>
>>> Range of values?
>>>
>>>> +
>>>> + clocks:
>>>> + description: |
>>>> + A number of phandles to clocks that need to be enabled while power domain
>>>> + switches state.
>>>
>>> Can you at least put a range of how many clocks?
>>>
>>>> +
>>>> + pm_qos:
>>>> + description: |
>>>> + A number of phandles to qos blocks which need to be saved and restored
>>>> + while power domain switches state.
>>>
>>> And here.
>>>
>>>> +
>>>> + required:
>>>> + - reg
>>>
>>> additionalProperties: false
>>>
>>> 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]+$'
>>>
>>
>> When I tried this I got the following error:
>>
>> rockchip,power-controller.yaml:
>> patternProperties:^power-domain@[0-9a-f]+$:patternProperties:^power-domain@[0-9a-f]+$:$ref:
>> '#/patternProperties/^power-domain@[0-9a-f]+$' is not a
>> 'uri-reference'
>>
>> Not sure if is my environment or I am still doing something silly, can
>> you confirm that this works for you? It doesn't seem to be any binding
>> doing this actually.
>
> I think the regex would have to be escaped to be a valid URI:
>
> $ref: '%23/patternProperties/%5Epower-domain@%5B0-9a-f%5D+%24'
>
> That's not the most readable nor am I sure it would get translated
> back to the right path, so it's probably going to be best to just
> define the child nodes even if duplicated.
>
Ok, I'll define the child node then. Thank you for your support.
Cheers,
Enric
> Rob
>
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH v3] dt-bindings: power: rockchip: Convert to json-schema
@ 2020-10-11 9:01 ` Enric Balletbo i Serra
0 siblings, 0 replies; 21+ messages in thread
From: Enric Balletbo i Serra @ 2020-10-11 9:01 UTC (permalink / raw)
To: Rob Herring, Enric Balletbo Serra
Cc: devicetree, Heiko Stübner, Doug Anderson, linux-kernel,
open list:ARM/Rockchip SoC...,
Collabora Kernel ML, Linux ARM, Caesar Wang
Hi Rob,
On 8/10/20 21:47, Rob Herring wrote:
> On Wed, Oct 7, 2020 at 3:57 PM Enric Balletbo Serra <eballetbo@gmail.com> wrote:
>>
>> Hi Rob,
>>
>> Missatge de Rob Herring <robh@kernel.org> del dia dc., 7 d’oct. 2020 a
>> les 17:12:
>>>
>>> On Mon, Sep 21, 2020 at 11:29:51AM +0200, Enric Balletbo i Serra wrote:
>>>> Convert the soc/rockchip/power_domain.txt binding document to json-schema
>>>> and move to the power bindings directory.
>>>>
>>>> Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
>>>> ---
>>>>
>>>> Changes in v3:
>>>> - Fixed tab errors found by bot
>>>>
>>>> Changes in v2:
>>>> - Fixed a warning that says that 'syscon' should not be used alone.
>>>> - Use patternProperties to define a new level for power-domains.
>>>> - Add const values for power-domain-cells, address-cells, etc.
>>>>
>>>> .../power/rockchip,power-controller.yaml | 207 ++++++++++++++++++
>>>> .../bindings/soc/rockchip/power_domain.txt | 136 ------------
>>>> 2 files changed, 207 insertions(+), 136 deletions(-)
>>>> create mode 100644 Documentation/devicetree/bindings/power/rockchip,power-controller.yaml
>>>> delete mode 100644 Documentation/devicetree/bindings/soc/rockchip/power_domain.txt
>>>>
>>>> diff --git a/Documentation/devicetree/bindings/power/rockchip,power-controller.yaml b/Documentation/devicetree/bindings/power/rockchip,power-controller.yaml
>>>> new file mode 100644
>>>> index 000000000000..b23ea37e2a08
>>>> --- /dev/null
>>>> +++ b/Documentation/devicetree/bindings/power/rockchip,power-controller.yaml
>>>> @@ -0,0 +1,207 @@
>>>> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
>>>> +%YAML 1.2
>>>> +---
>>>> +$id: http://devicetree.org/schemas/power/rockchip,power-controller.yaml#
>>>> +$schema: http://devicetree.org/meta-schemas/core.yaml#
>>>> +
>>>> +title: Rockchip Power Domains
>>>> +
>>>> +maintainers:
>>>> + - Caesar Wang <wxt@rock-chips.com>
>>>> + - Heiko Stuebner <heiko@sntech.de>
>>>> +
>>>> +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.
>>>> +
>>>> + Power domains contained within power-controller node are generic power domain
>>>> + providers documented in Documentation/devicetree/bindings/power/power-domain.yaml.
>>>> +
>>>> + IP cores belonging to a power domain should contain a 'power-domains'
>>>> + property that is a phandle for the power domain node representing the domain.
>>>> +
>>>> +properties:
>>>> + $nodename:
>>>> + const: power-controller
>>>> +
>>>> + compatible:
>>>> + enum:
>>>> + - rockchip,px30-power-controller
>>>> + - rockchip,rk3036-power-controller
>>>> + - rockchip,rk3066-power-controller
>>>> + - 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
>>>> +
>>>> + '#power-domain-cells':
>>>> + const: 1
>>>> +
>>>> + '#address-cells':
>>>> + const: 1
>>>> +
>>>> + '#size-cells':
>>>> + const: 0
>>>> +
>>>> +patternProperties:
>>>> + "^power-domain@[0-9]+$":
>>>
>>> unit-addresses are hex.
>>>
>>>> + type: object
>>>> + description: |
>>>> + Represents the power domains within the power controller node as documented
>>>> + in Documentation/devicetree/bindings/power/power-domain.yaml.
>>>> +
>>>> + properties:
>>>> +
>>>> + '#power-domain-cells':
>>>> + description:
>>>> + Must be 0 for nodes representing a single PM domain and 1 for nodes
>>>> + providing multiple PM domains.
>>>> +
>>>> + '#address-cells':
>>>> + const: 1
>>>> +
>>>> + '#size-cells':
>>>> + const: 0
>>>> +
>>>> + reg:
>>>> + description: |
>>>> + Power domain index. Valid values are defined 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.
>>>> + maxItems: 1
>>>
>>> Range of values?
>>>
>>>> +
>>>> + clocks:
>>>> + description: |
>>>> + A number of phandles to clocks that need to be enabled while power domain
>>>> + switches state.
>>>
>>> Can you at least put a range of how many clocks?
>>>
>>>> +
>>>> + pm_qos:
>>>> + description: |
>>>> + A number of phandles to qos blocks which need to be saved and restored
>>>> + while power domain switches state.
>>>
>>> And here.
>>>
>>>> +
>>>> + required:
>>>> + - reg
>>>
>>> additionalProperties: false
>>>
>>> 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]+$'
>>>
>>
>> When I tried this I got the following error:
>>
>> rockchip,power-controller.yaml:
>> patternProperties:^power-domain@[0-9a-f]+$:patternProperties:^power-domain@[0-9a-f]+$:$ref:
>> '#/patternProperties/^power-domain@[0-9a-f]+$' is not a
>> 'uri-reference'
>>
>> Not sure if is my environment or I am still doing something silly, can
>> you confirm that this works for you? It doesn't seem to be any binding
>> doing this actually.
>
> I think the regex would have to be escaped to be a valid URI:
>
> $ref: '%23/patternProperties/%5Epower-domain@%5B0-9a-f%5D+%24'
>
> That's not the most readable nor am I sure it would get translated
> back to the right path, so it's probably going to be best to just
> define the child nodes even if duplicated.
>
Ok, I'll define the child node then. Thank you for your support.
Cheers,
Enric
> Rob
>
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH v3] dt-bindings: power: rockchip: Convert to json-schema
@ 2020-10-11 9:01 ` Enric Balletbo i Serra
0 siblings, 0 replies; 21+ messages in thread
From: Enric Balletbo i Serra @ 2020-10-11 9:01 UTC (permalink / raw)
To: Rob Herring, Enric Balletbo Serra
Cc: devicetree, Heiko Stübner, Doug Anderson, linux-kernel,
open list:ARM/Rockchip SoC...,
Collabora Kernel ML, Linux ARM, Caesar Wang
Hi Rob,
On 8/10/20 21:47, Rob Herring wrote:
> On Wed, Oct 7, 2020 at 3:57 PM Enric Balletbo Serra <eballetbo@gmail.com> wrote:
>>
>> Hi Rob,
>>
>> Missatge de Rob Herring <robh@kernel.org> del dia dc., 7 d’oct. 2020 a
>> les 17:12:
>>>
>>> On Mon, Sep 21, 2020 at 11:29:51AM +0200, Enric Balletbo i Serra wrote:
>>>> Convert the soc/rockchip/power_domain.txt binding document to json-schema
>>>> and move to the power bindings directory.
>>>>
>>>> Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
>>>> ---
>>>>
>>>> Changes in v3:
>>>> - Fixed tab errors found by bot
>>>>
>>>> Changes in v2:
>>>> - Fixed a warning that says that 'syscon' should not be used alone.
>>>> - Use patternProperties to define a new level for power-domains.
>>>> - Add const values for power-domain-cells, address-cells, etc.
>>>>
>>>> .../power/rockchip,power-controller.yaml | 207 ++++++++++++++++++
>>>> .../bindings/soc/rockchip/power_domain.txt | 136 ------------
>>>> 2 files changed, 207 insertions(+), 136 deletions(-)
>>>> create mode 100644 Documentation/devicetree/bindings/power/rockchip,power-controller.yaml
>>>> delete mode 100644 Documentation/devicetree/bindings/soc/rockchip/power_domain.txt
>>>>
>>>> diff --git a/Documentation/devicetree/bindings/power/rockchip,power-controller.yaml b/Documentation/devicetree/bindings/power/rockchip,power-controller.yaml
>>>> new file mode 100644
>>>> index 000000000000..b23ea37e2a08
>>>> --- /dev/null
>>>> +++ b/Documentation/devicetree/bindings/power/rockchip,power-controller.yaml
>>>> @@ -0,0 +1,207 @@
>>>> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
>>>> +%YAML 1.2
>>>> +---
>>>> +$id: http://devicetree.org/schemas/power/rockchip,power-controller.yaml#
>>>> +$schema: http://devicetree.org/meta-schemas/core.yaml#
>>>> +
>>>> +title: Rockchip Power Domains
>>>> +
>>>> +maintainers:
>>>> + - Caesar Wang <wxt@rock-chips.com>
>>>> + - Heiko Stuebner <heiko@sntech.de>
>>>> +
>>>> +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.
>>>> +
>>>> + Power domains contained within power-controller node are generic power domain
>>>> + providers documented in Documentation/devicetree/bindings/power/power-domain.yaml.
>>>> +
>>>> + IP cores belonging to a power domain should contain a 'power-domains'
>>>> + property that is a phandle for the power domain node representing the domain.
>>>> +
>>>> +properties:
>>>> + $nodename:
>>>> + const: power-controller
>>>> +
>>>> + compatible:
>>>> + enum:
>>>> + - rockchip,px30-power-controller
>>>> + - rockchip,rk3036-power-controller
>>>> + - rockchip,rk3066-power-controller
>>>> + - 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
>>>> +
>>>> + '#power-domain-cells':
>>>> + const: 1
>>>> +
>>>> + '#address-cells':
>>>> + const: 1
>>>> +
>>>> + '#size-cells':
>>>> + const: 0
>>>> +
>>>> +patternProperties:
>>>> + "^power-domain@[0-9]+$":
>>>
>>> unit-addresses are hex.
>>>
>>>> + type: object
>>>> + description: |
>>>> + Represents the power domains within the power controller node as documented
>>>> + in Documentation/devicetree/bindings/power/power-domain.yaml.
>>>> +
>>>> + properties:
>>>> +
>>>> + '#power-domain-cells':
>>>> + description:
>>>> + Must be 0 for nodes representing a single PM domain and 1 for nodes
>>>> + providing multiple PM domains.
>>>> +
>>>> + '#address-cells':
>>>> + const: 1
>>>> +
>>>> + '#size-cells':
>>>> + const: 0
>>>> +
>>>> + reg:
>>>> + description: |
>>>> + Power domain index. Valid values are defined 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.
>>>> + maxItems: 1
>>>
>>> Range of values?
>>>
>>>> +
>>>> + clocks:
>>>> + description: |
>>>> + A number of phandles to clocks that need to be enabled while power domain
>>>> + switches state.
>>>
>>> Can you at least put a range of how many clocks?
>>>
>>>> +
>>>> + pm_qos:
>>>> + description: |
>>>> + A number of phandles to qos blocks which need to be saved and restored
>>>> + while power domain switches state.
>>>
>>> And here.
>>>
>>>> +
>>>> + required:
>>>> + - reg
>>>
>>> additionalProperties: false
>>>
>>> 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]+$'
>>>
>>
>> When I tried this I got the following error:
>>
>> rockchip,power-controller.yaml:
>> patternProperties:^power-domain@[0-9a-f]+$:patternProperties:^power-domain@[0-9a-f]+$:$ref:
>> '#/patternProperties/^power-domain@[0-9a-f]+$' is not a
>> 'uri-reference'
>>
>> Not sure if is my environment or I am still doing something silly, can
>> you confirm that this works for you? It doesn't seem to be any binding
>> doing this actually.
>
> I think the regex would have to be escaped to be a valid URI:
>
> $ref: '%23/patternProperties/%5Epower-domain@%5B0-9a-f%5D+%24'
>
> That's not the most readable nor am I sure it would get translated
> back to the right path, so it's probably going to be best to just
> define the child nodes even if duplicated.
>
Ok, I'll define the child node then. Thank you for your support.
Cheers,
Enric
> Rob
>
_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH v3] dt-bindings: power: rockchip: Convert to json-schema
2020-10-07 15:11 ` Rob Herring
(?)
@ 2020-10-11 9:56 ` Enric Balletbo i Serra
-1 siblings, 0 replies; 21+ messages in thread
From: Enric Balletbo i Serra @ 2020-10-11 9:56 UTC (permalink / raw)
To: Rob Herring
Cc: linux-kernel, dianders, heiko, Collabora Kernel ML, Caesar Wang,
devicetree, linux-arm-kernel, linux-rockchip
Hi Rob,
Many thanks for your comments, some questions below.
On 7/10/20 17:11, Rob Herring wrote:
> On Mon, Sep 21, 2020 at 11:29:51AM +0200, Enric Balletbo i Serra wrote:
>> Convert the soc/rockchip/power_domain.txt binding document to json-schema
>> and move to the power bindings directory.
>>
>> Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
>> ---
>>
>> Changes in v3:
>> - Fixed tab errors found by bot
>>
>> Changes in v2:
>> - Fixed a warning that says that 'syscon' should not be used alone.
>> - Use patternProperties to define a new level for power-domains.
>> - Add const values for power-domain-cells, address-cells, etc.
>>
>> .../power/rockchip,power-controller.yaml | 207 ++++++++++++++++++
>> .../bindings/soc/rockchip/power_domain.txt | 136 ------------
>> 2 files changed, 207 insertions(+), 136 deletions(-)
>> create mode 100644 Documentation/devicetree/bindings/power/rockchip,power-controller.yaml
>> delete mode 100644 Documentation/devicetree/bindings/soc/rockchip/power_domain.txt
>>
>> diff --git a/Documentation/devicetree/bindings/power/rockchip,power-controller.yaml b/Documentation/devicetree/bindings/power/rockchip,power-controller.yaml
>> new file mode 100644
>> index 000000000000..b23ea37e2a08
>> --- /dev/null
>> +++ b/Documentation/devicetree/bindings/power/rockchip,power-controller.yaml
>> @@ -0,0 +1,207 @@
>> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
>> +%YAML 1.2
>> +---
>> +$id: http://devicetree.org/schemas/power/rockchip,power-controller.yaml#
>> +$schema: http://devicetree.org/meta-schemas/core.yaml#
>> +
>> +title: Rockchip Power Domains
>> +
>> +maintainers:
>> + - Caesar Wang <wxt@rock-chips.com>
>> + - Heiko Stuebner <heiko@sntech.de>
>> +
>> +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.
>> +
>> + Power domains contained within power-controller node are generic power domain
>> + providers documented in Documentation/devicetree/bindings/power/power-domain.yaml.
>> +
>> + IP cores belonging to a power domain should contain a 'power-domains'
>> + property that is a phandle for the power domain node representing the domain.
>> +
>> +properties:
>> + $nodename:
>> + const: power-controller
>> +
>> + compatible:
>> + enum:
>> + - rockchip,px30-power-controller
>> + - rockchip,rk3036-power-controller
>> + - rockchip,rk3066-power-controller
>> + - 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
>> +
>> + '#power-domain-cells':
>> + const: 1
>> +
>> + '#address-cells':
>> + const: 1
>> +
>> + '#size-cells':
>> + const: 0
>> +
>> +patternProperties:
>> + "^power-domain@[0-9]+$":
>
> unit-addresses are hex.
>
As explained in the description of 'reg' is more a power domain index than a
hexadecimal address. Same as done in
Documentation/devicetree/bindings/power/fsl,imx-gpcv2.yaml
Use hex pattern will give a lot of errors, i.e 'pd_edp@25' and many others will
not match the regexes '^power-domain@[0-9a-f]+$'
Is the hex notation a must here? In that case, I assume I should change all the
power/rk3*power.h includes to use that notation.
>> + type: object
>> + description: |
>> + Represents the power domains within the power controller node as documented
>> + in Documentation/devicetree/bindings/power/power-domain.yaml.
>> +
>> + properties:
>> +
>> + '#power-domain-cells':
>> + description:
>> + Must be 0 for nodes representing a single PM domain and 1 for nodes
>> + providing multiple PM domains.
>> +
>> + '#address-cells':
>> + const: 1
>> +
>> + '#size-cells':
>> + const: 0
>> +
>> + reg:
>> + description: |
>> + Power domain index. Valid values are defined 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.
>> + maxItems: 1
>
> Range of values?
>
>> +
>> + clocks:
>> + description: |
>> + A number of phandles to clocks that need to be enabled while power domain
>> + switches state.
>
> Can you at least put a range of how many clocks?
>
minItems could be 0, but from the datasheet, I am not sure if I am able to
define a maxItems, I think I can do two things, or define a maxItems based on
current definitions (with the risk that if a new SoC is supported we should
change that number) or use a finger in the air "safe" value. Should any of these
solutions be acceptable for you?
>> +
>> + pm_qos:
>> + description: |
>> + A number of phandles to qos blocks which need to be saved and restored
>> + while power domain switches state.
>
> And here.
>
The same as clocks here.
>> +
>> + required:
>> + - reg
>
> additionalProperties: false
>
> 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]+$'
>
>> +
>> +required:
>> + - compatible
>> + - '#power-domain-cells'
>> +
>> +additionalProperties: false
>> +
>> +examples:
>> + - |
>> + #include <dt-bindings/clock/rk3399-cru.h>
>> + #include <dt-bindings/power/rk3399-power.h>
>> +
>> + soc {
>> + #address-cells = <2>;
>> + #size-cells = <2>;
>> +
>> + qos_hdcp: qos@ffa90000 {
>> + compatible = "rockchip,rk3399-qos","syscon";
>
> space ^
>
>> + reg = <0x0 0xffa90000 0x0 0x20>;
>> + };
>> +
>> + qos_iep: qos@ffa98000 {
>> + compatible = "rk3399-qos","syscon";
>> + reg = <0x0 0xffa98000 0x0 0x20>;
>> + };
>> +
>> + qos_rga_r: qos@ffab0000 {
>> + compatible = "rk3399-qos","syscon";
>> + reg = <0x0 0xffab0000 0x0 0x20>;
>> + };
>> +
>> + qos_rga_w: qos@ffab0080 {
>> + compatible = "rk3399-qos","syscon";
>> + reg = <0x0 0xffab0080 0x0 0x20>;
>> + };
>> +
>> + qos_video_m0: qos@ffab8000 {
>> + compatible = "rk3399-qos","syscon";
>> + reg = <0x0 0xffab8000 0x0 0x20>;
>> + };
>> +
>> + qos_video_m1_r: qos@ffac0000 {
>> + compatible = "rk3399-qos","syscon";
>> + reg = <0x0 0xffac0000 0x0 0x20>;
>> + };
>> +
>> + qos_video_m1_w: qos@ffac0080 {
>> + compatible = "rk3399-qos","syscon";
>> + reg = <0x0 0xffac0080 0x0 0x20>;
>> + };
>> +
>> + power-management@ff310000 {
>> + compatible = "rockchip,rk3399-pmu", "syscon", "simple-mfd";
>> + reg = <0x0 0xff310000 0x0 0x1000>;
>> +
>> + power-controller {
>> + compatible = "rockchip,rk3399-power-controller";
>> + #power-domain-cells = <1>;
>> + #address-cells = <1>;
>> + #size-cells = <0>;
>> +
>> + /* These power domains are grouped by VD_CENTER */
>> + power-domain@RK3399_PD_IEP {
>> + reg = <RK3399_PD_IEP>;
>> + clocks = <&cru ACLK_IEP>,
>> + <&cru HCLK_IEP>;
>> + pm_qos = <&qos_iep>;
>> + #power-domain-cells = <0>;
>> + };
>> + power-domain@RK3399_PD_RGA {
>> + reg = <RK3399_PD_RGA>;
>> + clocks = <&cru ACLK_RGA>,
>> + <&cru HCLK_RGA>;
>> + pm_qos = <&qos_rga_r>,
>> + <&qos_rga_w>;
>> + #power-domain-cells = <0>;
>> + };
>> + power-domain@RK3399_PD_VCODEC {
>> + reg = <RK3399_PD_VCODEC>;
>> + clocks = <&cru ACLK_VCODEC>,
>> + <&cru HCLK_VCODEC>;
>> + pm_qos = <&qos_video_m0>;
>> + #power-domain-cells = <0>;
>> + };
>> + power-domain@RK3399_PD_VDU {
>> + reg = <RK3399_PD_VDU>;
>> + clocks = <&cru ACLK_VDU>,
>> + <&cru HCLK_VDU>;
>> + pm_qos = <&qos_video_m1_r>,
>> + <&qos_video_m1_w>;
>> + #power-domain-cells = <0>;
>> + };
>> + power-domain@RK3399_PD_VIO {
>> + reg = <RK3399_PD_VIO>;
>> + #power-domain-cells = <1>;
>> + #address-cells = <1>;
>> + #size-cells = <0>;
>> +
>> + power-domain@RK3399_PD_HDCP {
>> + reg = <RK3399_PD_HDCP>;
>> + clocks = <&cru ACLK_HDCP>,
>> + <&cru HCLK_HDCP>,
>> + <&cru PCLK_HDCP>;
>> + pm_qos = <&qos_hdcp>;
>> + #power-domain-cells = <0>;
>> + };
>> + };
>> + };
>> + };
>> + };
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH v3] dt-bindings: power: rockchip: Convert to json-schema
@ 2020-10-11 9:56 ` Enric Balletbo i Serra
0 siblings, 0 replies; 21+ messages in thread
From: Enric Balletbo i Serra @ 2020-10-11 9:56 UTC (permalink / raw)
To: Rob Herring
Cc: devicetree, heiko, linux-kernel, dianders, linux-rockchip,
Collabora Kernel ML, linux-arm-kernel, Caesar Wang
Hi Rob,
Many thanks for your comments, some questions below.
On 7/10/20 17:11, Rob Herring wrote:
> On Mon, Sep 21, 2020 at 11:29:51AM +0200, Enric Balletbo i Serra wrote:
>> Convert the soc/rockchip/power_domain.txt binding document to json-schema
>> and move to the power bindings directory.
>>
>> Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
>> ---
>>
>> Changes in v3:
>> - Fixed tab errors found by bot
>>
>> Changes in v2:
>> - Fixed a warning that says that 'syscon' should not be used alone.
>> - Use patternProperties to define a new level for power-domains.
>> - Add const values for power-domain-cells, address-cells, etc.
>>
>> .../power/rockchip,power-controller.yaml | 207 ++++++++++++++++++
>> .../bindings/soc/rockchip/power_domain.txt | 136 ------------
>> 2 files changed, 207 insertions(+), 136 deletions(-)
>> create mode 100644 Documentation/devicetree/bindings/power/rockchip,power-controller.yaml
>> delete mode 100644 Documentation/devicetree/bindings/soc/rockchip/power_domain.txt
>>
>> diff --git a/Documentation/devicetree/bindings/power/rockchip,power-controller.yaml b/Documentation/devicetree/bindings/power/rockchip,power-controller.yaml
>> new file mode 100644
>> index 000000000000..b23ea37e2a08
>> --- /dev/null
>> +++ b/Documentation/devicetree/bindings/power/rockchip,power-controller.yaml
>> @@ -0,0 +1,207 @@
>> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
>> +%YAML 1.2
>> +---
>> +$id: http://devicetree.org/schemas/power/rockchip,power-controller.yaml#
>> +$schema: http://devicetree.org/meta-schemas/core.yaml#
>> +
>> +title: Rockchip Power Domains
>> +
>> +maintainers:
>> + - Caesar Wang <wxt@rock-chips.com>
>> + - Heiko Stuebner <heiko@sntech.de>
>> +
>> +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.
>> +
>> + Power domains contained within power-controller node are generic power domain
>> + providers documented in Documentation/devicetree/bindings/power/power-domain.yaml.
>> +
>> + IP cores belonging to a power domain should contain a 'power-domains'
>> + property that is a phandle for the power domain node representing the domain.
>> +
>> +properties:
>> + $nodename:
>> + const: power-controller
>> +
>> + compatible:
>> + enum:
>> + - rockchip,px30-power-controller
>> + - rockchip,rk3036-power-controller
>> + - rockchip,rk3066-power-controller
>> + - 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
>> +
>> + '#power-domain-cells':
>> + const: 1
>> +
>> + '#address-cells':
>> + const: 1
>> +
>> + '#size-cells':
>> + const: 0
>> +
>> +patternProperties:
>> + "^power-domain@[0-9]+$":
>
> unit-addresses are hex.
>
As explained in the description of 'reg' is more a power domain index than a
hexadecimal address. Same as done in
Documentation/devicetree/bindings/power/fsl,imx-gpcv2.yaml
Use hex pattern will give a lot of errors, i.e 'pd_edp@25' and many others will
not match the regexes '^power-domain@[0-9a-f]+$'
Is the hex notation a must here? In that case, I assume I should change all the
power/rk3*power.h includes to use that notation.
>> + type: object
>> + description: |
>> + Represents the power domains within the power controller node as documented
>> + in Documentation/devicetree/bindings/power/power-domain.yaml.
>> +
>> + properties:
>> +
>> + '#power-domain-cells':
>> + description:
>> + Must be 0 for nodes representing a single PM domain and 1 for nodes
>> + providing multiple PM domains.
>> +
>> + '#address-cells':
>> + const: 1
>> +
>> + '#size-cells':
>> + const: 0
>> +
>> + reg:
>> + description: |
>> + Power domain index. Valid values are defined 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.
>> + maxItems: 1
>
> Range of values?
>
>> +
>> + clocks:
>> + description: |
>> + A number of phandles to clocks that need to be enabled while power domain
>> + switches state.
>
> Can you at least put a range of how many clocks?
>
minItems could be 0, but from the datasheet, I am not sure if I am able to
define a maxItems, I think I can do two things, or define a maxItems based on
current definitions (with the risk that if a new SoC is supported we should
change that number) or use a finger in the air "safe" value. Should any of these
solutions be acceptable for you?
>> +
>> + pm_qos:
>> + description: |
>> + A number of phandles to qos blocks which need to be saved and restored
>> + while power domain switches state.
>
> And here.
>
The same as clocks here.
>> +
>> + required:
>> + - reg
>
> additionalProperties: false
>
> 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]+$'
>
>> +
>> +required:
>> + - compatible
>> + - '#power-domain-cells'
>> +
>> +additionalProperties: false
>> +
>> +examples:
>> + - |
>> + #include <dt-bindings/clock/rk3399-cru.h>
>> + #include <dt-bindings/power/rk3399-power.h>
>> +
>> + soc {
>> + #address-cells = <2>;
>> + #size-cells = <2>;
>> +
>> + qos_hdcp: qos@ffa90000 {
>> + compatible = "rockchip,rk3399-qos","syscon";
>
> space ^
>
>> + reg = <0x0 0xffa90000 0x0 0x20>;
>> + };
>> +
>> + qos_iep: qos@ffa98000 {
>> + compatible = "rk3399-qos","syscon";
>> + reg = <0x0 0xffa98000 0x0 0x20>;
>> + };
>> +
>> + qos_rga_r: qos@ffab0000 {
>> + compatible = "rk3399-qos","syscon";
>> + reg = <0x0 0xffab0000 0x0 0x20>;
>> + };
>> +
>> + qos_rga_w: qos@ffab0080 {
>> + compatible = "rk3399-qos","syscon";
>> + reg = <0x0 0xffab0080 0x0 0x20>;
>> + };
>> +
>> + qos_video_m0: qos@ffab8000 {
>> + compatible = "rk3399-qos","syscon";
>> + reg = <0x0 0xffab8000 0x0 0x20>;
>> + };
>> +
>> + qos_video_m1_r: qos@ffac0000 {
>> + compatible = "rk3399-qos","syscon";
>> + reg = <0x0 0xffac0000 0x0 0x20>;
>> + };
>> +
>> + qos_video_m1_w: qos@ffac0080 {
>> + compatible = "rk3399-qos","syscon";
>> + reg = <0x0 0xffac0080 0x0 0x20>;
>> + };
>> +
>> + power-management@ff310000 {
>> + compatible = "rockchip,rk3399-pmu", "syscon", "simple-mfd";
>> + reg = <0x0 0xff310000 0x0 0x1000>;
>> +
>> + power-controller {
>> + compatible = "rockchip,rk3399-power-controller";
>> + #power-domain-cells = <1>;
>> + #address-cells = <1>;
>> + #size-cells = <0>;
>> +
>> + /* These power domains are grouped by VD_CENTER */
>> + power-domain@RK3399_PD_IEP {
>> + reg = <RK3399_PD_IEP>;
>> + clocks = <&cru ACLK_IEP>,
>> + <&cru HCLK_IEP>;
>> + pm_qos = <&qos_iep>;
>> + #power-domain-cells = <0>;
>> + };
>> + power-domain@RK3399_PD_RGA {
>> + reg = <RK3399_PD_RGA>;
>> + clocks = <&cru ACLK_RGA>,
>> + <&cru HCLK_RGA>;
>> + pm_qos = <&qos_rga_r>,
>> + <&qos_rga_w>;
>> + #power-domain-cells = <0>;
>> + };
>> + power-domain@RK3399_PD_VCODEC {
>> + reg = <RK3399_PD_VCODEC>;
>> + clocks = <&cru ACLK_VCODEC>,
>> + <&cru HCLK_VCODEC>;
>> + pm_qos = <&qos_video_m0>;
>> + #power-domain-cells = <0>;
>> + };
>> + power-domain@RK3399_PD_VDU {
>> + reg = <RK3399_PD_VDU>;
>> + clocks = <&cru ACLK_VDU>,
>> + <&cru HCLK_VDU>;
>> + pm_qos = <&qos_video_m1_r>,
>> + <&qos_video_m1_w>;
>> + #power-domain-cells = <0>;
>> + };
>> + power-domain@RK3399_PD_VIO {
>> + reg = <RK3399_PD_VIO>;
>> + #power-domain-cells = <1>;
>> + #address-cells = <1>;
>> + #size-cells = <0>;
>> +
>> + power-domain@RK3399_PD_HDCP {
>> + reg = <RK3399_PD_HDCP>;
>> + clocks = <&cru ACLK_HDCP>,
>> + <&cru HCLK_HDCP>,
>> + <&cru PCLK_HDCP>;
>> + pm_qos = <&qos_hdcp>;
>> + #power-domain-cells = <0>;
>> + };
>> + };
>> + };
>> + };
>> + };
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH v3] dt-bindings: power: rockchip: Convert to json-schema
@ 2020-10-11 9:56 ` Enric Balletbo i Serra
0 siblings, 0 replies; 21+ messages in thread
From: Enric Balletbo i Serra @ 2020-10-11 9:56 UTC (permalink / raw)
To: Rob Herring
Cc: devicetree, heiko, linux-kernel, dianders, linux-rockchip,
Collabora Kernel ML, linux-arm-kernel, Caesar Wang
Hi Rob,
Many thanks for your comments, some questions below.
On 7/10/20 17:11, Rob Herring wrote:
> On Mon, Sep 21, 2020 at 11:29:51AM +0200, Enric Balletbo i Serra wrote:
>> Convert the soc/rockchip/power_domain.txt binding document to json-schema
>> and move to the power bindings directory.
>>
>> Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
>> ---
>>
>> Changes in v3:
>> - Fixed tab errors found by bot
>>
>> Changes in v2:
>> - Fixed a warning that says that 'syscon' should not be used alone.
>> - Use patternProperties to define a new level for power-domains.
>> - Add const values for power-domain-cells, address-cells, etc.
>>
>> .../power/rockchip,power-controller.yaml | 207 ++++++++++++++++++
>> .../bindings/soc/rockchip/power_domain.txt | 136 ------------
>> 2 files changed, 207 insertions(+), 136 deletions(-)
>> create mode 100644 Documentation/devicetree/bindings/power/rockchip,power-controller.yaml
>> delete mode 100644 Documentation/devicetree/bindings/soc/rockchip/power_domain.txt
>>
>> diff --git a/Documentation/devicetree/bindings/power/rockchip,power-controller.yaml b/Documentation/devicetree/bindings/power/rockchip,power-controller.yaml
>> new file mode 100644
>> index 000000000000..b23ea37e2a08
>> --- /dev/null
>> +++ b/Documentation/devicetree/bindings/power/rockchip,power-controller.yaml
>> @@ -0,0 +1,207 @@
>> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
>> +%YAML 1.2
>> +---
>> +$id: http://devicetree.org/schemas/power/rockchip,power-controller.yaml#
>> +$schema: http://devicetree.org/meta-schemas/core.yaml#
>> +
>> +title: Rockchip Power Domains
>> +
>> +maintainers:
>> + - Caesar Wang <wxt@rock-chips.com>
>> + - Heiko Stuebner <heiko@sntech.de>
>> +
>> +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.
>> +
>> + Power domains contained within power-controller node are generic power domain
>> + providers documented in Documentation/devicetree/bindings/power/power-domain.yaml.
>> +
>> + IP cores belonging to a power domain should contain a 'power-domains'
>> + property that is a phandle for the power domain node representing the domain.
>> +
>> +properties:
>> + $nodename:
>> + const: power-controller
>> +
>> + compatible:
>> + enum:
>> + - rockchip,px30-power-controller
>> + - rockchip,rk3036-power-controller
>> + - rockchip,rk3066-power-controller
>> + - 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
>> +
>> + '#power-domain-cells':
>> + const: 1
>> +
>> + '#address-cells':
>> + const: 1
>> +
>> + '#size-cells':
>> + const: 0
>> +
>> +patternProperties:
>> + "^power-domain@[0-9]+$":
>
> unit-addresses are hex.
>
As explained in the description of 'reg' is more a power domain index than a
hexadecimal address. Same as done in
Documentation/devicetree/bindings/power/fsl,imx-gpcv2.yaml
Use hex pattern will give a lot of errors, i.e 'pd_edp@25' and many others will
not match the regexes '^power-domain@[0-9a-f]+$'
Is the hex notation a must here? In that case, I assume I should change all the
power/rk3*power.h includes to use that notation.
>> + type: object
>> + description: |
>> + Represents the power domains within the power controller node as documented
>> + in Documentation/devicetree/bindings/power/power-domain.yaml.
>> +
>> + properties:
>> +
>> + '#power-domain-cells':
>> + description:
>> + Must be 0 for nodes representing a single PM domain and 1 for nodes
>> + providing multiple PM domains.
>> +
>> + '#address-cells':
>> + const: 1
>> +
>> + '#size-cells':
>> + const: 0
>> +
>> + reg:
>> + description: |
>> + Power domain index. Valid values are defined 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.
>> + maxItems: 1
>
> Range of values?
>
>> +
>> + clocks:
>> + description: |
>> + A number of phandles to clocks that need to be enabled while power domain
>> + switches state.
>
> Can you at least put a range of how many clocks?
>
minItems could be 0, but from the datasheet, I am not sure if I am able to
define a maxItems, I think I can do two things, or define a maxItems based on
current definitions (with the risk that if a new SoC is supported we should
change that number) or use a finger in the air "safe" value. Should any of these
solutions be acceptable for you?
>> +
>> + pm_qos:
>> + description: |
>> + A number of phandles to qos blocks which need to be saved and restored
>> + while power domain switches state.
>
> And here.
>
The same as clocks here.
>> +
>> + required:
>> + - reg
>
> additionalProperties: false
>
> 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]+$'
>
>> +
>> +required:
>> + - compatible
>> + - '#power-domain-cells'
>> +
>> +additionalProperties: false
>> +
>> +examples:
>> + - |
>> + #include <dt-bindings/clock/rk3399-cru.h>
>> + #include <dt-bindings/power/rk3399-power.h>
>> +
>> + soc {
>> + #address-cells = <2>;
>> + #size-cells = <2>;
>> +
>> + qos_hdcp: qos@ffa90000 {
>> + compatible = "rockchip,rk3399-qos","syscon";
>
> space ^
>
>> + reg = <0x0 0xffa90000 0x0 0x20>;
>> + };
>> +
>> + qos_iep: qos@ffa98000 {
>> + compatible = "rk3399-qos","syscon";
>> + reg = <0x0 0xffa98000 0x0 0x20>;
>> + };
>> +
>> + qos_rga_r: qos@ffab0000 {
>> + compatible = "rk3399-qos","syscon";
>> + reg = <0x0 0xffab0000 0x0 0x20>;
>> + };
>> +
>> + qos_rga_w: qos@ffab0080 {
>> + compatible = "rk3399-qos","syscon";
>> + reg = <0x0 0xffab0080 0x0 0x20>;
>> + };
>> +
>> + qos_video_m0: qos@ffab8000 {
>> + compatible = "rk3399-qos","syscon";
>> + reg = <0x0 0xffab8000 0x0 0x20>;
>> + };
>> +
>> + qos_video_m1_r: qos@ffac0000 {
>> + compatible = "rk3399-qos","syscon";
>> + reg = <0x0 0xffac0000 0x0 0x20>;
>> + };
>> +
>> + qos_video_m1_w: qos@ffac0080 {
>> + compatible = "rk3399-qos","syscon";
>> + reg = <0x0 0xffac0080 0x0 0x20>;
>> + };
>> +
>> + power-management@ff310000 {
>> + compatible = "rockchip,rk3399-pmu", "syscon", "simple-mfd";
>> + reg = <0x0 0xff310000 0x0 0x1000>;
>> +
>> + power-controller {
>> + compatible = "rockchip,rk3399-power-controller";
>> + #power-domain-cells = <1>;
>> + #address-cells = <1>;
>> + #size-cells = <0>;
>> +
>> + /* These power domains are grouped by VD_CENTER */
>> + power-domain@RK3399_PD_IEP {
>> + reg = <RK3399_PD_IEP>;
>> + clocks = <&cru ACLK_IEP>,
>> + <&cru HCLK_IEP>;
>> + pm_qos = <&qos_iep>;
>> + #power-domain-cells = <0>;
>> + };
>> + power-domain@RK3399_PD_RGA {
>> + reg = <RK3399_PD_RGA>;
>> + clocks = <&cru ACLK_RGA>,
>> + <&cru HCLK_RGA>;
>> + pm_qos = <&qos_rga_r>,
>> + <&qos_rga_w>;
>> + #power-domain-cells = <0>;
>> + };
>> + power-domain@RK3399_PD_VCODEC {
>> + reg = <RK3399_PD_VCODEC>;
>> + clocks = <&cru ACLK_VCODEC>,
>> + <&cru HCLK_VCODEC>;
>> + pm_qos = <&qos_video_m0>;
>> + #power-domain-cells = <0>;
>> + };
>> + power-domain@RK3399_PD_VDU {
>> + reg = <RK3399_PD_VDU>;
>> + clocks = <&cru ACLK_VDU>,
>> + <&cru HCLK_VDU>;
>> + pm_qos = <&qos_video_m1_r>,
>> + <&qos_video_m1_w>;
>> + #power-domain-cells = <0>;
>> + };
>> + power-domain@RK3399_PD_VIO {
>> + reg = <RK3399_PD_VIO>;
>> + #power-domain-cells = <1>;
>> + #address-cells = <1>;
>> + #size-cells = <0>;
>> +
>> + power-domain@RK3399_PD_HDCP {
>> + reg = <RK3399_PD_HDCP>;
>> + clocks = <&cru ACLK_HDCP>,
>> + <&cru HCLK_HDCP>,
>> + <&cru PCLK_HDCP>;
>> + pm_qos = <&qos_hdcp>;
>> + #power-domain-cells = <0>;
>> + };
>> + };
>> + };
>> + };
>> + };
_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH v3] dt-bindings: power: rockchip: Convert to json-schema
2020-10-11 9:56 ` Enric Balletbo i Serra
(?)
@ 2020-10-11 10:03 ` Enric Balletbo i Serra
-1 siblings, 0 replies; 21+ messages in thread
From: Enric Balletbo i Serra @ 2020-10-11 10:03 UTC (permalink / raw)
To: Rob Herring
Cc: linux-kernel, dianders, heiko, Collabora Kernel ML, Caesar Wang,
devicetree, linux-arm-kernel, linux-rockchip
On 11/10/20 11:56, Enric Balletbo i Serra wrote:
> Hi Rob,
>
> Many thanks for your comments, some questions below.
>
> On 7/10/20 17:11, Rob Herring wrote:
>> On Mon, Sep 21, 2020 at 11:29:51AM +0200, Enric Balletbo i Serra wrote:
>>> Convert the soc/rockchip/power_domain.txt binding document to json-schema
>>> and move to the power bindings directory.
>>>
>>> Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
>>> ---
>>>
>>> Changes in v3:
>>> - Fixed tab errors found by bot
>>>
>>> Changes in v2:
>>> - Fixed a warning that says that 'syscon' should not be used alone.
>>> - Use patternProperties to define a new level for power-domains.
>>> - Add const values for power-domain-cells, address-cells, etc.
>>>
>>> .../power/rockchip,power-controller.yaml | 207 ++++++++++++++++++
>>> .../bindings/soc/rockchip/power_domain.txt | 136 ------------
>>> 2 files changed, 207 insertions(+), 136 deletions(-)
>>> create mode 100644 Documentation/devicetree/bindings/power/rockchip,power-controller.yaml
>>> delete mode 100644 Documentation/devicetree/bindings/soc/rockchip/power_domain.txt
>>>
>>> diff --git a/Documentation/devicetree/bindings/power/rockchip,power-controller.yaml b/Documentation/devicetree/bindings/power/rockchip,power-controller.yaml
>>> new file mode 100644
>>> index 000000000000..b23ea37e2a08
>>> --- /dev/null
>>> +++ b/Documentation/devicetree/bindings/power/rockchip,power-controller.yaml
>>> @@ -0,0 +1,207 @@
>>> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
>>> +%YAML 1.2
>>> +---
>>> +$id: http://devicetree.org/schemas/power/rockchip,power-controller.yaml#
>>> +$schema: http://devicetree.org/meta-schemas/core.yaml#
>>> +
>>> +title: Rockchip Power Domains
>>> +
>>> +maintainers:
>>> + - Caesar Wang <wxt@rock-chips.com>
>>> + - Heiko Stuebner <heiko@sntech.de>
>>> +
>>> +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.
>>> +
>>> + Power domains contained within power-controller node are generic power domain
>>> + providers documented in Documentation/devicetree/bindings/power/power-domain.yaml.
>>> +
>>> + IP cores belonging to a power domain should contain a 'power-domains'
>>> + property that is a phandle for the power domain node representing the domain.
>>> +
>>> +properties:
>>> + $nodename:
>>> + const: power-controller
>>> +
>>> + compatible:
>>> + enum:
>>> + - rockchip,px30-power-controller
>>> + - rockchip,rk3036-power-controller
>>> + - rockchip,rk3066-power-controller
>>> + - 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
>>> +
>>> + '#power-domain-cells':
>>> + const: 1
>>> +
>>> + '#address-cells':
>>> + const: 1
>>> +
>>> + '#size-cells':
>>> + const: 0
>>> +
>>> +patternProperties:
>>> + "^power-domain@[0-9]+$":
>>
>> unit-addresses are hex.
>>
>
> As explained in the description of 'reg' is more a power domain index than a
> hexadecimal address. Same as done in
> Documentation/devicetree/bindings/power/fsl,imx-gpcv2.yaml
>
> Use hex pattern will give a lot of errors, i.e 'pd_edp@25' and many others will
> not match the regexes '^power-domain@[0-9a-f]+$'
>
> Is the hex notation a must here? In that case, I assume I should change all the
> power/rk3*power.h includes to use that notation.
>
Oops, forget about this part, not enough caffeine this morning, I was confused,
sorry.
[snip]
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH v3] dt-bindings: power: rockchip: Convert to json-schema
@ 2020-10-11 10:03 ` Enric Balletbo i Serra
0 siblings, 0 replies; 21+ messages in thread
From: Enric Balletbo i Serra @ 2020-10-11 10:03 UTC (permalink / raw)
To: Rob Herring
Cc: devicetree, heiko, linux-kernel, dianders, linux-rockchip,
Collabora Kernel ML, linux-arm-kernel, Caesar Wang
On 11/10/20 11:56, Enric Balletbo i Serra wrote:
> Hi Rob,
>
> Many thanks for your comments, some questions below.
>
> On 7/10/20 17:11, Rob Herring wrote:
>> On Mon, Sep 21, 2020 at 11:29:51AM +0200, Enric Balletbo i Serra wrote:
>>> Convert the soc/rockchip/power_domain.txt binding document to json-schema
>>> and move to the power bindings directory.
>>>
>>> Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
>>> ---
>>>
>>> Changes in v3:
>>> - Fixed tab errors found by bot
>>>
>>> Changes in v2:
>>> - Fixed a warning that says that 'syscon' should not be used alone.
>>> - Use patternProperties to define a new level for power-domains.
>>> - Add const values for power-domain-cells, address-cells, etc.
>>>
>>> .../power/rockchip,power-controller.yaml | 207 ++++++++++++++++++
>>> .../bindings/soc/rockchip/power_domain.txt | 136 ------------
>>> 2 files changed, 207 insertions(+), 136 deletions(-)
>>> create mode 100644 Documentation/devicetree/bindings/power/rockchip,power-controller.yaml
>>> delete mode 100644 Documentation/devicetree/bindings/soc/rockchip/power_domain.txt
>>>
>>> diff --git a/Documentation/devicetree/bindings/power/rockchip,power-controller.yaml b/Documentation/devicetree/bindings/power/rockchip,power-controller.yaml
>>> new file mode 100644
>>> index 000000000000..b23ea37e2a08
>>> --- /dev/null
>>> +++ b/Documentation/devicetree/bindings/power/rockchip,power-controller.yaml
>>> @@ -0,0 +1,207 @@
>>> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
>>> +%YAML 1.2
>>> +---
>>> +$id: http://devicetree.org/schemas/power/rockchip,power-controller.yaml#
>>> +$schema: http://devicetree.org/meta-schemas/core.yaml#
>>> +
>>> +title: Rockchip Power Domains
>>> +
>>> +maintainers:
>>> + - Caesar Wang <wxt@rock-chips.com>
>>> + - Heiko Stuebner <heiko@sntech.de>
>>> +
>>> +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.
>>> +
>>> + Power domains contained within power-controller node are generic power domain
>>> + providers documented in Documentation/devicetree/bindings/power/power-domain.yaml.
>>> +
>>> + IP cores belonging to a power domain should contain a 'power-domains'
>>> + property that is a phandle for the power domain node representing the domain.
>>> +
>>> +properties:
>>> + $nodename:
>>> + const: power-controller
>>> +
>>> + compatible:
>>> + enum:
>>> + - rockchip,px30-power-controller
>>> + - rockchip,rk3036-power-controller
>>> + - rockchip,rk3066-power-controller
>>> + - 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
>>> +
>>> + '#power-domain-cells':
>>> + const: 1
>>> +
>>> + '#address-cells':
>>> + const: 1
>>> +
>>> + '#size-cells':
>>> + const: 0
>>> +
>>> +patternProperties:
>>> + "^power-domain@[0-9]+$":
>>
>> unit-addresses are hex.
>>
>
> As explained in the description of 'reg' is more a power domain index than a
> hexadecimal address. Same as done in
> Documentation/devicetree/bindings/power/fsl,imx-gpcv2.yaml
>
> Use hex pattern will give a lot of errors, i.e 'pd_edp@25' and many others will
> not match the regexes '^power-domain@[0-9a-f]+$'
>
> Is the hex notation a must here? In that case, I assume I should change all the
> power/rk3*power.h includes to use that notation.
>
Oops, forget about this part, not enough caffeine this morning, I was confused,
sorry.
[snip]
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH v3] dt-bindings: power: rockchip: Convert to json-schema
@ 2020-10-11 10:03 ` Enric Balletbo i Serra
0 siblings, 0 replies; 21+ messages in thread
From: Enric Balletbo i Serra @ 2020-10-11 10:03 UTC (permalink / raw)
To: Rob Herring
Cc: devicetree, heiko, linux-kernel, dianders, linux-rockchip,
Collabora Kernel ML, linux-arm-kernel, Caesar Wang
On 11/10/20 11:56, Enric Balletbo i Serra wrote:
> Hi Rob,
>
> Many thanks for your comments, some questions below.
>
> On 7/10/20 17:11, Rob Herring wrote:
>> On Mon, Sep 21, 2020 at 11:29:51AM +0200, Enric Balletbo i Serra wrote:
>>> Convert the soc/rockchip/power_domain.txt binding document to json-schema
>>> and move to the power bindings directory.
>>>
>>> Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
>>> ---
>>>
>>> Changes in v3:
>>> - Fixed tab errors found by bot
>>>
>>> Changes in v2:
>>> - Fixed a warning that says that 'syscon' should not be used alone.
>>> - Use patternProperties to define a new level for power-domains.
>>> - Add const values for power-domain-cells, address-cells, etc.
>>>
>>> .../power/rockchip,power-controller.yaml | 207 ++++++++++++++++++
>>> .../bindings/soc/rockchip/power_domain.txt | 136 ------------
>>> 2 files changed, 207 insertions(+), 136 deletions(-)
>>> create mode 100644 Documentation/devicetree/bindings/power/rockchip,power-controller.yaml
>>> delete mode 100644 Documentation/devicetree/bindings/soc/rockchip/power_domain.txt
>>>
>>> diff --git a/Documentation/devicetree/bindings/power/rockchip,power-controller.yaml b/Documentation/devicetree/bindings/power/rockchip,power-controller.yaml
>>> new file mode 100644
>>> index 000000000000..b23ea37e2a08
>>> --- /dev/null
>>> +++ b/Documentation/devicetree/bindings/power/rockchip,power-controller.yaml
>>> @@ -0,0 +1,207 @@
>>> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
>>> +%YAML 1.2
>>> +---
>>> +$id: http://devicetree.org/schemas/power/rockchip,power-controller.yaml#
>>> +$schema: http://devicetree.org/meta-schemas/core.yaml#
>>> +
>>> +title: Rockchip Power Domains
>>> +
>>> +maintainers:
>>> + - Caesar Wang <wxt@rock-chips.com>
>>> + - Heiko Stuebner <heiko@sntech.de>
>>> +
>>> +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.
>>> +
>>> + Power domains contained within power-controller node are generic power domain
>>> + providers documented in Documentation/devicetree/bindings/power/power-domain.yaml.
>>> +
>>> + IP cores belonging to a power domain should contain a 'power-domains'
>>> + property that is a phandle for the power domain node representing the domain.
>>> +
>>> +properties:
>>> + $nodename:
>>> + const: power-controller
>>> +
>>> + compatible:
>>> + enum:
>>> + - rockchip,px30-power-controller
>>> + - rockchip,rk3036-power-controller
>>> + - rockchip,rk3066-power-controller
>>> + - 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
>>> +
>>> + '#power-domain-cells':
>>> + const: 1
>>> +
>>> + '#address-cells':
>>> + const: 1
>>> +
>>> + '#size-cells':
>>> + const: 0
>>> +
>>> +patternProperties:
>>> + "^power-domain@[0-9]+$":
>>
>> unit-addresses are hex.
>>
>
> As explained in the description of 'reg' is more a power domain index than a
> hexadecimal address. Same as done in
> Documentation/devicetree/bindings/power/fsl,imx-gpcv2.yaml
>
> Use hex pattern will give a lot of errors, i.e 'pd_edp@25' and many others will
> not match the regexes '^power-domain@[0-9a-f]+$'
>
> Is the hex notation a must here? In that case, I assume I should change all the
> power/rk3*power.h includes to use that notation.
>
Oops, forget about this part, not enough caffeine this morning, I was confused,
sorry.
[snip]
_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip
^ permalink raw reply [flat|nested] 21+ messages in thread