devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Rob Herring <robh+dt@kernel.org>
To: Johan Jonker <jbx6244@gmail.com>
Cc: "heiko@sntech.de" <heiko@sntech.de>,
	devicetree@vger.kernel.org,
	"moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE" 
	<linux-arm-kernel@lists.infradead.org>,
	"open list:ARM/Rockchip SoC..."
	<linux-rockchip@lists.infradead.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [RFC PATCH 1/2] dt-bindings: sram: convert rockchip-pmu-sram bindings to yaml
Date: Wed, 18 Mar 2020 16:55:20 -0600	[thread overview]
Message-ID: <CAL_Jsq+0M1n7M1EjnJhum9Sn30FEb3ux4agJSa1KhNwUxv4THg@mail.gmail.com> (raw)
In-Reply-To: <20200317163555.18107-1-jbx6244@gmail.com>

On Tue, Mar 17, 2020 at 10:36 AM Johan Jonker <jbx6244@gmail.com> wrote:
>
> Current dts files with 'rockchip-pmu-sram' compatible nodes
> are manually verified. In order to automate this process
> rockchip-pmu-sram.txt has to be converted to yaml.
>
> A check with the command below gives for example this error:
>
> arch/arm/boot/dts/rk3288-evb-act8846.dt.yaml: sram@ff700000:
> compatible:0:
> 'rockchip,rk3288-pmu-sram' was expected
> arch/arm/boot/dts/rk3288-evb-act8846.dt.yaml: sram@ff700000:
> compatible:
> ['mmio-sram'] is too short
>
> Fix this error by adding an extra 'mmio-sram' compatible and
> 'if then' structure to filter yaml warnings.

Seems to me you should fix the .dts file. If we adjust schemas to make
dts files pass, then what is the point of the schemas?

> make ARCH=arm dtbs_check
> DT_SCHEMA_FILES=Documentation/devicetree/bindings/sram/
> rockchip-pmu-sram.yaml

Until recent changes in linux-next now, this is not sufficient as all
examples are not checked against all schemas.

> Signed-off-by: Johan Jonker <jbx6244@gmail.com>
> ---
>  .../devicetree/bindings/sram/rockchip-pmu-sram.txt | 16 --------
>  .../bindings/sram/rockchip-pmu-sram.yaml           | 46 ++++++++++++++++++++++
>  2 files changed, 46 insertions(+), 16 deletions(-)
>  delete mode 100644 Documentation/devicetree/bindings/sram/rockchip-pmu-sram.txt
>  create mode 100644 Documentation/devicetree/bindings/sram/rockchip-pmu-sram.yaml
>
> diff --git a/Documentation/devicetree/bindings/sram/rockchip-pmu-sram.txt b/Documentation/devicetree/bindings/sram/rockchip-pmu-sram.txt
> deleted file mode 100644
> index 6b42fda30..000000000
> --- a/Documentation/devicetree/bindings/sram/rockchip-pmu-sram.txt
> +++ /dev/null
> @@ -1,16 +0,0 @@
> -Rockchip SRAM for pmu:
> -------------------------------
> -
> -The sram of pmu is used to store the function of resume from maskrom(the 1st
> -level loader). This is a common use of the "pmu-sram" because it keeps power
> -even in low power states in the system.
> -
> -Required node properties:
> -- compatible : should be "rockchip,rk3288-pmu-sram"
> -- reg : physical base address and the size of the registers window
> -
> -Example:
> -       sram@ff720000 {
> -               compatible = "rockchip,rk3288-pmu-sram", "mmio-sram";
> -               reg = <0xff720000 0x1000>;
> -       };
> diff --git a/Documentation/devicetree/bindings/sram/rockchip-pmu-sram.yaml b/Documentation/devicetree/bindings/sram/rockchip-pmu-sram.yaml
> new file mode 100644
> index 000000000..bb72e4f53
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/sram/rockchip-pmu-sram.yaml
> @@ -0,0 +1,46 @@
> +# SPDX-License-Identifier: GPL-2.0
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/sram/rockchip-pmu-sram.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Rockchip SRAM for pmu
> +
> +description:
> +  The sram of pmu is used to store the function of resume from maskrom(the 1st
> +  level loader). This is a common use of the "pmu-sram" because it keeps power
> +  even in low power states in the system.
> +
> +maintainers:
> +  - Heiko Stuebner <heiko@sntech.de>
> +
> +# The extra 'mmio-sram' compatible and 'if then' structure is needed
> +# to filter yaml warnings.
> +properties:
> +  compatible:
> +    oneOf:
> +      - const: mmio-sram
> +      - items:
> +        - const: rockchip,rk3288-pmu-sram

We've been just adding the compatibles to the common sram.yaml for the
simple cases like this.


> +        - const: mmio-sram
> +
> +  reg:
> +    maxItems: 1
> +
> +if:
> +  properties:
> +    compatible:
> +      contains:
> +        const: rockchip,rk3288-pmu-sram
> +
> +then:
> +  required:
> +    - compatible
> +    - reg
> +
> +examples:
> +  - |
> +    pmu_sram: sram@ff720000 {
> +      compatible = "rockchip,rk3288-pmu-sram", "mmio-sram";
> +      reg = <0xff720000 0x1000>;
> +    };
> --
> 2.11.0
>

      parent reply	other threads:[~2020-03-18 22:55 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-17 16:35 [RFC PATCH 1/2] dt-bindings: sram: convert rockchip-pmu-sram bindings to yaml Johan Jonker
2020-03-17 16:35 ` [RFC PATCH 2/2] dt-bindings: sram: fix yaml warnings for rk3288-pmu-sram compatible nodes Johan Jonker
2020-03-18 22:43 ` [RFC PATCH 1/2] dt-bindings: sram: convert rockchip-pmu-sram bindings to yaml Rob Herring
2020-03-18 22:55 ` Rob Herring [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAL_Jsq+0M1n7M1EjnJhum9Sn30FEb3ux4agJSa1KhNwUxv4THg@mail.gmail.com \
    --to=robh+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=heiko@sntech.de \
    --cc=jbx6244@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rockchip@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).