Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp206383pxf; Wed, 24 Mar 2021 03:11:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyB7gpw99S9go3bbuF1FxCYNq4XvcJn8lkJVwRFRkP3P8YkQFRA8D4TpYAeXbTLoxjWXRl4 X-Received: by 2002:a05:6402:2552:: with SMTP id l18mr2500774edb.71.1616580661319; Wed, 24 Mar 2021 03:11:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616580661; cv=none; d=google.com; s=arc-20160816; b=O9avsFR0yP3vhglMLIqt/eLUG34cPVk7ct+cp90Z1NfBmyC+AYYncGVb3VItOKxLaE m7Nwf17yMxRdVzZog6Mmlcemyk9UlROYT2Sm6NU+Mcx2H9NP/HOQEEYTSOjVxayjZYba DREZtpzkq+U7+W7bspbHofzJYiCLDoHMQJ4qaTSlFKsuw37qMCCGKMg49zJjczKcx2GL 5NnyM8+C43jRHYczIpZ/uBSqNFpudggrnFsOihvXZGmqNGKiU5FSbta5impa8Z3GdmzX w5Uec9OY/+7tOvRj4Z80wmKaQO0SB5H8N5lN9eOtOLoYul6jSBVV5rFHo+OjmmcTcxFC jBVw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=qnXO0y/HNHmykYrh0CriFM5BlHvIpYUoKJbxC7fpAPQ=; b=evZZio/kcgu+YudvRbQlKJbOWtaA/towSCbBx86igCS+e3NRCuwUwm0nLfARPOfJs/ P1z+xsAasLY9lWAvSqV1Vu0YZkbBUMmxYoXMPrv0pX/tlTgbBO3wuq+9E4YeHQcUJWRt PvpOKIeiUVL3w/qP66nt6ULmN/TMxbLASAK7U7ebPu3vr8wG3rGqnA71UhOYyIXJVml0 kR2+NlayTf9+D/P5KgFNdFr9buHQrh6nnUN1wBIlYiUWuH5PLW/HzCySy3Vh2T0pi0JU u4nsmo5lZiMNqCulWXc2EfchZoglpyhJ15IITNyVKXKMfoMeDVa6ITPkHEUbTi2KuFxu RSvw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=mATaBNAD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o7si1325417edr.131.2021.03.24.03.10.38; Wed, 24 Mar 2021 03:11:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=mATaBNAD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235548AbhCXGkI (ORCPT + 99 others); Wed, 24 Mar 2021 02:40:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60668 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230218AbhCXGjz (ORCPT ); Wed, 24 Mar 2021 02:39:55 -0400 Received: from mail-ed1-x52b.google.com (mail-ed1-x52b.google.com [IPv6:2a00:1450:4864:20::52b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9A480C061763; Tue, 23 Mar 2021 23:39:54 -0700 (PDT) Received: by mail-ed1-x52b.google.com with SMTP id e7so26241494edu.10; Tue, 23 Mar 2021 23:39:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=qnXO0y/HNHmykYrh0CriFM5BlHvIpYUoKJbxC7fpAPQ=; b=mATaBNAD6Sr+gMvDBmKIatADmDqSkE9vQeDO01HatLRQdA51z4DQZGwejnlyst/30v 2TjvveLtRScKqD5Ticy5vtAA5b5rSj0ZbH1I7kF+/oWt5ouP0l/bwpE8v9P7OpRUNdA9 SldwmAqibq7QOhO8MXBwn/GiHh/uBAyY5SgTbWLefp/PO6PtH9NhGJjvMBn0XCxg1z5m k/wtRl8hb+solvRl1XNIoPy+bfBi+Js5q4THefZIKmtgbkbHylD22ieknyA9iXzd4vQX D9XlcJH9eFgfV8FKw8kKDeEp9Uz+sMp/pygoYoBnQYezXFKCvbVoiKWOpf+CkyHb8SkI 1K/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=qnXO0y/HNHmykYrh0CriFM5BlHvIpYUoKJbxC7fpAPQ=; b=OvF78HR5CdxO3w/LfyStRsL5zAIOOlRNHRQND4+vRLmwQoU2RmhsgvUYUZjehYKmq2 Um+P+Sh0Ta7/xf3kHzsi0mPxXg8Niv/xoXw58JUCVLLHWE8PvS9V0jOEGaX5/YzrUT2a 4X6f4Yox0a/lrGOmzVKkr6zLm62GpxDh1io1M1PsArL8Mnvgy+XTkTWCIPGA82j4vfQ1 pEVYfar6t52PSBinuXByrxcXf9zlV0ZDwxyRtfnlRIfrIGRIBLd5kztLdFaz9O29oiDF GlE0gHjALjzfiAjAARaxjI6yZFtz6PIPVlCfteWFYtUNtSF8iYk2ZQSGj4ZRVgc63ijC M5Kg== X-Gm-Message-State: AOAM532zwmSTTcTLZD4cpPPcK+l3pfjnbDq4sHcjcu619n+/CdcPsLba Nd5RpcYCofMxJqNQJtJgl1g= X-Received: by 2002:a05:6402:b21:: with SMTP id bo1mr1724926edb.368.1616567993167; Tue, 23 Mar 2021 23:39:53 -0700 (PDT) Received: from [192.168.2.2] (81-204-249-205.fixed.kpn.net. [81.204.249.205]) by smtp.gmail.com with ESMTPSA id n6sm442935eji.37.2021.03.23.23.39.51 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 23 Mar 2021 23:39:52 -0700 (PDT) Subject: Re: [PATCH v3 2/3] dt-bindings: power: rockchip: Convert to json-schema and extend To: Elaine Zhang , robh+dt@kernel.org, heiko@sntech.de Cc: devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, cl@rock-chips.com, huangtao@rock-chips.com, kever.yang@rock-chips.com, tony.xie@rock-chips.com, finley.xiao@rock-chips.com, Enric Balletbo i Serra References: <20210324032308.6309-1-zhangqing@rock-chips.com> <20210324032308.6309-3-zhangqing@rock-chips.com> From: Johan Jonker Message-ID: Date: Wed, 24 Mar 2021 07:39:49 +0100 User-Agent: Mozilla/5.0 (X11; Linux i686; rv:68.0) Gecko/20100101 Thunderbird/68.11.0 MIME-Version: 1.0 In-Reply-To: <20210324032308.6309-3-zhangqing@rock-chips.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 3/24/21 4:23 AM, Elaine Zhang wrote: > Convert the soc/rockchip/power_domain.txt binding document to > json-schema and move to the power bindings directory. > Add RK3568 SoCs for rockchip power binding document. > > Signed-off-by: Enric Balletbo i Serra > Signed-off-by: Elaine Zhang > --- > .../power/rockchip,power-controller.yaml | 286 ++++++++++++++++++ > .../bindings/soc/rockchip/power_domain.txt | 136 --------- > 2 files changed, 286 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..0d6b8962d098 > --- /dev/null > +++ b/Documentation/devicetree/bindings/power/rockchip,power-controller.yaml > @@ -0,0 +1,286 @@ > +# SPDX-License-Identifier: GPL-2.0-only > +%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: > + - Elaine Zhang > + - Rob Herring > + - Heiko Stuebner > + > +description: | > + Rockchip processors include support for multiple power domains which can be > + powered up/down by software based on different application scenes to save power. scenes > scenarios ?? This is not a theater. ===== Scenes: 1. Something seen by a viewer; a view or prospect. 2. The place where an action or event occurs: the scene of the crime. ===== Scenarios: 1. An expected or supposed situation or sequence of events > + > + 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 > + - rockchip,rk3568-power-controller Use separate patches for a YAML conversion and adding new compatibility strings. One action per patch. > + > + '#power-domain-cells': > + const: 1 > + > + '#address-cells': > + const: 1 > + > + '#size-cells': > + const: 0 > + > +patternProperties: > + "^pd_[0-9a-z_]{2,10}@[0-9a-f]+$": Here you are using "", but elsewhere in this document '' is used. Change all to "". > + 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: > + maxItems: 1 > + description: | > + Power domain index. Valid values are defined in: remove ":" > + "include/dt-bindings/power/px30-power.h" > + "include/dt-bindings/power/rk3036-power.h" > + "include/dt-bindings/power/rk3066-power.h" > + "include/dt-bindings/power/rk3128-power.h" > + "include/dt-bindings/power/rk3188-power.h" > + "include/dt-bindings/power/rk3228-power.h" > + "include/dt-bindings/power/rk3288-power.h" > + "include/dt-bindings/power/rk3328-power.h" > + "include/dt-bindings/power/rk3366-power.h" > + "include/dt-bindings/power/rk3368-power.h" > + "include/dt-bindings/power/rk3399-power.h" > + "include/dt-bindings/power/rk3399-power.h" rk3399 > rk3568 "include/dt-bindings/power/rk3568-power.h" Use separate patches for a YAML conversion and adding new compatibility strings. One action per patch. > + > + clocks: > + description: | > + A number of phandles to clocks that need to be enabled while power domain > + switches state. > + > + pm_qos: > + description: | > + A number of phandles to qos blocks which need to be saved and restored > + while power domain switches state. > + > + patternProperties: > + "^pd_[0-9a-z_]{2,10}@[0-9a-f]+$": > + type: object > + description: | > + Represents a power domain child within a power domain parent node. > + > + 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: > + maxItems: 1 > + > + clocks: > + description: | > + A number of phandles to clocks that need to be enabled while power domain > + switches state. > + > + pm_qos: > + description: | > + A number of phandles to qos blocks which need to be saved and restored > + while power domain switches state. > + > + patternProperties: > + "^pd_[0-9a-z_]{2,10}@[0-9a-f]+$": > + type: object > + description: | > + Represents a power domain child within a power domain parent node. > + > + 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: > + maxItems: 1 > + > + clocks: > + description: | > + A number of phandles to clocks that need to be enabled while power domain > + switches state. > + > + pm_qos: > + description: | > + A number of phandles to qos blocks which need to be saved and restored > + while power domain switches state. > + > + required: > + - reg > + > + additionalProperties: false > + > + required: > + - reg > + > + additionalProperties: false > + > + required: > + - reg > + > + additionalProperties: false > + > +required: > + - compatible > + - '#power-domain-cells' > + > +additionalProperties: false > + > +examples: > + - | > + #include > + #include > + > + soc { > + #address-cells = <2>; > + #size-cells = <2>; > + > + qos_hdcp: qos@ffa90000 { > + compatible = "rockchip,rk3399-qos", "syscon"; > + reg = <0x0 0xffa90000 0x0 0x20>; > + }; > + > + qos_iep: qos@ffa98000 { > + compatible = "rockchip,rk3399-qos", "syscon"; > + reg = <0x0 0xffa98000 0x0 0x20>; > + }; > + > + qos_rga_r: qos@ffab0000 { > + compatible = "rockchip,rk3399-qos", "syscon"; > + reg = <0x0 0xffab0000 0x0 0x20>; > + }; > + > + qos_rga_w: qos@ffab0080 { > + compatible = "rockchip,rk3399-qos", "syscon"; > + reg = <0x0 0xffab0080 0x0 0x20>; > + }; > + > + qos_video_m0: qos@ffab8000 { > + compatible = "rockchip,rk3399-qos", "syscon"; > + reg = <0x0 0xffab8000 0x0 0x20>; > + }; > + > + qos_video_m1_r: qos@ffac0000 { > + compatible = "rockchip,rk3399-qos", "syscon"; > + reg = <0x0 0xffac0000 0x0 0x20>; > + }; > + > + qos_video_m1_w: qos@ffac0080 { > + compatible = "rockchip,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 */ > + pd_iep@RK3399_PD_IEP { > + reg = ; > + clocks = <&cru ACLK_IEP>, > + <&cru HCLK_IEP>; > + pm_qos = <&qos_iep>; > + #power-domain-cells = <0>; > + }; > + pd_rga@RK3399_PD_RGA { > + reg = ; > + clocks = <&cru ACLK_RGA>, > + <&cru HCLK_RGA>; > + pm_qos = <&qos_rga_r>, > + <&qos_rga_w>; > + #power-domain-cells = <0>; > + }; > + pd_vcodec@RK3399_PD_VCODEC { > + reg = ; > + clocks = <&cru ACLK_VCODEC>, > + <&cru HCLK_VCODEC>; > + pm_qos = <&qos_video_m0>; > + #power-domain-cells = <0>; > + }; > + pd_vdu@RK3399_PD_VDU { > + reg = ; > + clocks = <&cru ACLK_VDU>, > + <&cru HCLK_VDU>; > + pm_qos = <&qos_video_m1_r>, > + <&qos_video_m1_w>; > + #power-domain-cells = <0>; > + }; > + pd_vio@RK3399_PD_VIO { > + reg = ; > + #power-domain-cells = <1>; > + #address-cells = <1>; > + #size-cells = <0>; > + > + pd_hdcp@RK3399_PD_HDCP { > + reg = ; > + clocks = <&cru ACLK_HDCP>, > + <&cru HCLK_HDCP>, > + <&cru PCLK_HDCP>; > + pm_qos = <&qos_hdcp>; > + #power-domain-cells = <0>; > + }; > + }; > + }; > + }; > + }; > diff --git a/Documentation/devicetree/bindings/soc/rockchip/power_domain.txt b/Documentation/devicetree/bindings/soc/rockchip/power_domain.txt > deleted file mode 100644 > index 8304eceb62e4..000000000000 > --- a/Documentation/devicetree/bindings/soc/rockchip/power_domain.txt > +++ /dev/null > @@ -1,136 +0,0 @@ > -* Rockchip Power Domains > - > -Rockchip processors include support for multiple power domains which can be > -powered up/down by software based on different application scenes to save power. > - > -Required properties for power domain controller: > -- compatible: Should be one of the following. > - "rockchip,px30-power-controller" - for PX30 SoCs. > - "rockchip,rk3036-power-controller" - for RK3036 SoCs. > - "rockchip,rk3066-power-controller" - for RK3066 SoCs. > - "rockchip,rk3128-power-controller" - for RK3128 SoCs. > - "rockchip,rk3188-power-controller" - for RK3188 SoCs. > - "rockchip,rk3228-power-controller" - for RK3228 SoCs. > - "rockchip,rk3288-power-controller" - for RK3288 SoCs. > - "rockchip,rk3328-power-controller" - for RK3328 SoCs. > - "rockchip,rk3366-power-controller" - for RK3366 SoCs. > - "rockchip,rk3368-power-controller" - for RK3368 SoCs. > - "rockchip,rk3399-power-controller" - for RK3399 SoCs. > -- #power-domain-cells: Number of cells in a power-domain specifier. > - Should be 1 for multiple PM domains. > -- #address-cells: Should be 1. > -- #size-cells: Should be 0. > - > -Required properties for power domain sub nodes: > -- reg: index of the power domain, should use macros in: > - "include/dt-bindings/power/px30-power.h" - for PX30 type power domain. > - "include/dt-bindings/power/rk3036-power.h" - for RK3036 type power domain. > - "include/dt-bindings/power/rk3066-power.h" - for RK3066 type power domain. > - "include/dt-bindings/power/rk3128-power.h" - for RK3128 type power domain. > - "include/dt-bindings/power/rk3188-power.h" - for RK3188 type power domain. > - "include/dt-bindings/power/rk3228-power.h" - for RK3228 type power domain. > - "include/dt-bindings/power/rk3288-power.h" - for RK3288 type power domain. > - "include/dt-bindings/power/rk3328-power.h" - for RK3328 type power domain. > - "include/dt-bindings/power/rk3366-power.h" - for RK3366 type power domain. > - "include/dt-bindings/power/rk3368-power.h" - for RK3368 type power domain. > - "include/dt-bindings/power/rk3399-power.h" - for RK3399 type power domain. > -- clocks (optional): phandles to clocks which need to be enabled while power domain > - switches state. > -- pm_qos (optional): phandles to qos blocks which need to be saved and restored > - while power domain switches state. > - > -Qos Example: > - > - qos_gpu: qos_gpu@ffaf0000 { > - compatible ="syscon"; > - reg = <0x0 0xffaf0000 0x0 0x20>; > - }; > - > -Example: > - > - power: power-controller { > - compatible = "rockchip,rk3288-power-controller"; > - #power-domain-cells = <1>; > - #address-cells = <1>; > - #size-cells = <0>; > - > - pd_gpu { > - reg = ; > - clocks = <&cru ACLK_GPU>; > - pm_qos = <&qos_gpu>; > - }; > - }; > - > - power: power-controller { > - compatible = "rockchip,rk3368-power-controller"; > - #power-domain-cells = <1>; > - #address-cells = <1>; > - #size-cells = <0>; > - > - pd_gpu_1 { > - reg = ; > - clocks = <&cru ACLK_GPU_CFG>; > - }; > - }; > - > -Example 2: > - power: power-controller { > - compatible = "rockchip,rk3399-power-controller"; > - #power-domain-cells = <1>; > - #address-cells = <1>; > - #size-cells = <0>; > - > - pd_vio { > - #address-cells = <1>; > - #size-cells = <0>; > - reg = ; > - > - pd_vo { > - #address-cells = <1>; > - #size-cells = <0>; > - reg = ; > - > - pd_vopb { > - reg = ; > - }; > - > - pd_vopl { > - reg = ; > - }; > - }; > - }; > - }; > - > -Node of a device using power domains must have a power-domains property, > -containing a phandle to the power device node and an index specifying which > -power domain to use. > -The index should use macros in: > - "include/dt-bindings/power/px30-power.h" - for px30 type power domain. > - "include/dt-bindings/power/rk3036-power.h" - for rk3036 type power domain. > - "include/dt-bindings/power/rk3128-power.h" - for rk3128 type power domain. > - "include/dt-bindings/power/rk3128-power.h" - for rk3228 type power domain. > - "include/dt-bindings/power/rk3288-power.h" - for rk3288 type power domain. > - "include/dt-bindings/power/rk3328-power.h" - for rk3328 type power domain. > - "include/dt-bindings/power/rk3366-power.h" - for rk3366 type power domain. > - "include/dt-bindings/power/rk3368-power.h" - for rk3368 type power domain. > - "include/dt-bindings/power/rk3399-power.h" - for rk3399 type power domain. > - > -Example of the node using power domain: > - > - node { > - /* ... */ > - power-domains = <&power RK3288_PD_GPU>; > - /* ... */ > - }; > - > - node { > - /* ... */ > - power-domains = <&power RK3368_PD_GPU_1>; > - /* ... */ > - }; > - > - node { > - /* ... */ > - power-domains = <&power RK3399_PD_VOPB>; > - /* ... */ > - }; >