Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp1139515ybh; Wed, 18 Mar 2020 15:57:22 -0700 (PDT) X-Google-Smtp-Source: ADFU+vvqfp+H3ql0LH/Hg7gvehOJSy3ELE0NI9YA9TYqIRC1tjrJ7WokW7V7/kIMdiLpcaDf8DG3 X-Received: by 2002:a9d:949:: with SMTP id 67mr6056182otp.304.1584572242407; Wed, 18 Mar 2020 15:57:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584572242; cv=none; d=google.com; s=arc-20160816; b=KQwShvc4LG7lwZwRc+lb4pKJSShbyXBCfqbkL6Crsf4Ilfz/6ZfK83PDsPoc1Ec/Gd MW9gT2WznJCYmeteDy0f98tlmTZ4Q60jVAr+1WgfTrhRiR6ClmRkbCHJMlwxDXDdFQAI RfcuCLeIZXM7co92/7O7zHzfJZvCEeQ7JHj/nqunXhikDajWqByxIttsNQs35yE8eWXX HMQ3DNo2cyNj5IwGtRM74QytT/Lain7BrKCHDqN3qkDUoUecnYc+YVcSZca1Es5RzqmR RaPuVp9cD9YpUV6G71ANBGBuF7zwXKQCjfA7SksyX/oO7yV10PYVF/b8ftv6qNGH+ubd YkfQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=Rv2zwZRPwQirExmHMgJ/wokcf4tZ06XY64CRL+e6aN0=; b=eylkTUXdC9G8Tsw/33sTZzsCr+7JS5fDWVioWL01E6VDtVMUcDHdx7+VpkMXsStHX9 Bce6OUFs334EQlPA5IrVwzRE33qvdkSiw6I8EFeqaQH5z3xuoQGhEX4WwKzL5WIns9hU yrj74duz75eq9xGowF3COWM+xw05xtmwBl6ul70aG58R98yGdsHV+1DecYG8AjgBDANC LcEPZKHgd7pHYjibB2JaOkhx1wLIrrccIb/bBeZS6tKNMUNOGULse3ggjqoET/Na+pP0 Lp8tVuyRL+gZl9I/WcUxo8icvbil6+I7TdgaOF8Osn1QGkH4W7LjhHwu8WjxVZVaJTS1 aSpg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ro+4MZPj; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r17si205525otq.138.2020.03.18.15.57.08; Wed, 18 Mar 2020 15:57:22 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ro+4MZPj; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727268AbgCRWze (ORCPT + 99 others); Wed, 18 Mar 2020 18:55:34 -0400 Received: from mail.kernel.org ([198.145.29.99]:33200 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726704AbgCRWze (ORCPT ); Wed, 18 Mar 2020 18:55:34 -0400 Received: from mail-qk1-f172.google.com (mail-qk1-f172.google.com [209.85.222.172]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id DB16620767; Wed, 18 Mar 2020 22:55:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1584572133; bh=uTyNAhR02/lueaTrSpsEtzvYiAwF0pB5xc/FKKpl73o=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=ro+4MZPj8/lr9itNf5dBH8a0rGlg1/wfIPWd62qVHcJMz5O10Y3Mue4fJROANWR2M d9Id+B6QYs3dyhoYst2vuOUd2TWEt+ABTNjT89wpllcLEIOsJgqknKRgSJf4HGNAhX +I2/h5ahnh8tO9lM4ZKnPS35fNMJ5ZBu0SkyHzks= Received: by mail-qk1-f172.google.com with SMTP id z25so199267qkj.4; Wed, 18 Mar 2020 15:55:32 -0700 (PDT) X-Gm-Message-State: ANhLgQ36jYfueqEy5UxYViMD1YiHbousaFRN8I7EmfobmxjrBDQLcRoq i/P/Y9JyL1JbOjNlXKxd+DR+D2i3Fspg7glRmQ== X-Received: by 2002:a37:393:: with SMTP id 141mr196155qkd.393.1584572131923; Wed, 18 Mar 2020 15:55:31 -0700 (PDT) MIME-Version: 1.0 References: <20200317163555.18107-1-jbx6244@gmail.com> In-Reply-To: <20200317163555.18107-1-jbx6244@gmail.com> From: Rob Herring Date: Wed, 18 Mar 2020 16:55:20 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [RFC PATCH 1/2] dt-bindings: sram: convert rockchip-pmu-sram bindings to yaml To: Johan Jonker Cc: "heiko@sntech.de" , devicetree@vger.kernel.org, "moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE" , "open list:ARM/Rockchip SoC..." , "linux-kernel@vger.kernel.org" Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Mar 17, 2020 at 10:36 AM Johan Jonker 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 > --- > .../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 > + > +# 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 >