Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp2812343imm; Sun, 7 Oct 2018 12:21:35 -0700 (PDT) X-Google-Smtp-Source: ACcGV631z9oBeRJNdJKMq9owwXsKYxmwpU0eFjMe1qM6BthCAtMzrPUrl6/L5Hbv4FqX9+H/PFGP X-Received: by 2002:a17:902:5e3:: with SMTP id f90-v6mr21567084plf.286.1538940095171; Sun, 07 Oct 2018 12:21:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538940095; cv=none; d=google.com; s=arc-20160816; b=UNl2BEPIA5MV+XtKCfEXJ+V8K953HEZbbwM9NxOORYHzRC0VSFVpQ5wwcCPVFhrLJ4 onMDfBtvgKYBEfnu6akcYWuhwFeNmRETgEUH8Sw/DLEZckBgfaBfzKDfv7yVhPOWl7IA 2bZkAZozm4S9Qsbp3JC2ne5M15vOspWKeojjCVUVk5Z4J4duyVNK2una/m6I65X/Gchp VK7FDCvGZR7h4dIyHXojgKbC6D7rN/Ljgp3HH5h5djwspPXaADa1Rvjpbvwat8YydtsI 9ZjE2TlAbdH2xyhQL2/760hSao9IxocL/iKyBCrY3Zfgqujx4pX/z3bJ05L3IyPoLXk0 OT8w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=pHyNGf4sdQAYj8TCDds3UpmTqO71WAdp6tLM0UtlRr8=; b=jbbiF+tnFPofsmpSWJXNlhY8pDqWNZG7wbIrnGZn9Y3tOSmCaWVch+PHDxuWGZsLSr GLBB63HPAl6SW2ZaGl1msdo9cby43DR/mtVXjF3nP9EqU7rtQf2/4GsCWFyWGuWjSgPi sxnlrVqt3sGisvwsprQa68xJ73Hz1FSCop83eSAsSA0JVaXtTfwuf+b5l6qKseNEJA5r TPr3NH5QMRR8B2fteyx8i1ONEqL6ytwJdAro90NZxtsFyKgsxwoJ11eoQOKfH33BwoYp 21zHjYelu0QHx9Xc086eGiDpaBU/VgI+MkN2C+Cr4dqP/I9Y7V5POX1sTOab8/ZeSmYH gWNw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=JnntvaDA; 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 r1-v6si15600742plo.165.2018.10.07.12.20.36; Sun, 07 Oct 2018 12:21:35 -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=JnntvaDA; 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 S1728437AbeJHC2o (ORCPT + 99 others); Sun, 7 Oct 2018 22:28:44 -0400 Received: from mail.kernel.org ([198.145.29.99]:56232 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726976AbeJHC2n (ORCPT ); Sun, 7 Oct 2018 22:28:43 -0400 Received: from mail-qk1-f182.google.com (mail-qk1-f182.google.com [209.85.222.182]) (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 718A62089D; Sun, 7 Oct 2018 19:20:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1538940025; bh=q2hcIl/I/0R/umsZvda+xirHhaeeNaaYy23YsfrIp4A=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=JnntvaDAKqilcGFoZOpH7KOXZkO9HjLbDBl0LUe3pSWtCy9/4vYXwonRR5RX9dY1Q x0+KsmxsgE68hA4sDEE2qN/w6pEOXWlYJpns7ttRTwD/hSmXjAmjiv/G0aZuhBltm2 377gm0KpYa9RkGKP18UhEKkFmTTsZtWwfMWuVk14= Received: by mail-qk1-f182.google.com with SMTP id q5-v6so10908383qki.6; Sun, 07 Oct 2018 12:20:25 -0700 (PDT) X-Gm-Message-State: ABuFfohkrlL5QW7TbUgneUSmlbMweUhVCe3TG1VKjjmnSBzbTG+tR1XM QNghS5/inJllJArEfvxfXz1hh23f+i3V1UFUig== X-Received: by 2002:a37:4dc5:: with SMTP id a188-v6mr16008551qkb.326.1538940024583; Sun, 07 Oct 2018 12:20:24 -0700 (PDT) MIME-Version: 1.0 References: <20181005165848.3474-1-robh@kernel.org> <20181005165848.3474-28-robh@kernel.org> <41eb7b19-dd26-16e2-bd80-b8b7d6f52f94@suse.de> In-Reply-To: <41eb7b19-dd26-16e2-bd80-b8b7d6f52f94@suse.de> From: Rob Herring Date: Sun, 7 Oct 2018 14:20:12 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 27/36] dt-bindings: arm: Convert Realtek board/soc bindings to json-schema To: =?UTF-8?Q?Andreas_F=C3=A4rber?= Cc: "linux-kernel@vger.kernel.org" , devicetree@vger.kernel.org, "moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE" , linuxppc-dev , Grant Likely , Kumar Gala , Frank Rowand , Mark Rutland , Linus Walleij , Olof Johansson , Arnd Bergmann , Mark Brown , Tom Rini , Pantelis Antoniou , Geert Uytterhoeven , Jonathan Cameron , Bjorn Andersson , Manivannan Sadhasivam Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Oct 6, 2018 at 5:54 AM Andreas F=C3=A4rber wrote= : > > Am 05.10.18 um 18:58 schrieb Rob Herring: > > Convert Realtek SoC bindings to DT schema format using json-schema. > > YAML (2x) ? > > Cc: "Andreas F=C3=A4rber" > > Cc: Mark Rutland > > Cc: linux-arm-kernel@lists.infradead.org > > Cc: devicetree@vger.kernel.org > > Signed-off-by: Rob Herring > > --- > > .../devicetree/bindings/arm/realtek.txt | 22 ---------------- > > .../devicetree/bindings/arm/realtek.yaml | 25 +++++++++++++++++++ > > 2 files changed, 25 insertions(+), 22 deletions(-) > > delete mode 100644 Documentation/devicetree/bindings/arm/realtek.txt > > create mode 100644 Documentation/devicetree/bindings/arm/realtek.yaml > > > > diff --git a/Documentation/devicetree/bindings/arm/realtek.txt b/Docume= ntation/devicetree/bindings/arm/realtek.txt > > deleted file mode 100644 > > index 95839e19ae92..000000000000 > > --- a/Documentation/devicetree/bindings/arm/realtek.txt > > +++ /dev/null > > @@ -1,22 +0,0 @@ > > -Realtek platforms device tree bindings > > --------------------------------------- > > - > > - > > -RTD1295 SoC > > -=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > > - > > -Required root node properties: > > - > > - - compatible : must contain "realtek,rtd1295" > > - > > - > > -Root node property compatible must contain, depending on board: > > - > > - - MeLE V9: "mele,v9" > > - - ProBox2 AVA: "probox2,ava" > > - - Zidoo X9S: "zidoo,x9s" > > - > > - > > -Example: > > - > > - compatible =3D "zidoo,x9s", "realtek,rtd1295"; > > diff --git a/Documentation/devicetree/bindings/arm/realtek.yaml b/Docum= entation/devicetree/bindings/arm/realtek.yaml > > new file mode 100644 > > index 000000000000..9e3bb3249c77 > > --- /dev/null > > +++ b/Documentation/devicetree/bindings/arm/realtek.yaml > > @@ -0,0 +1,25 @@ > > +# SPDX-License-Identifier: None > > What is the expected license for such bindings? Good question. I'd meant to figure something out for this placeholder. The default would be GPL-2 inheriting from the old doc. My preference would be to dual license these with BSD as they're not just kernel files, but I don't really want to track down copyright holders (also not explicitly declared) to do that. > You did not add such a line for actions.yaml. > > > +%YAML 1.2 > > +--- > > +$id: http://devicetree.org/schemas/bindings/arm/realtek.yaml# > > +$schema: http://devicetree.org/meta-schemas/core.yaml# > > + > > +title: Realtek platforms device tree bindings > > + > > +maintainers: > > + - Andreas F=C3=A4rber > > + > > +description: |+ > > "|+"? The '|' means a literal block. The '+' is a block chomping indicator: http://yaml.org/spec/1.2/spec.html#id2794534 This was all converted using my doc2yaml script and ruamel.yaml decided it needed the '+'. I'm not sure exactly why. It may be based on how many trailing newlines the text had. > > + RTD1295 SoC In this case, this isn't really useful and we should just remove description unless you want to add something. > > + > > +properties: > > + $nodename: > > + const: '/' > > + compatible: > > + items: > > + - enum: > > + - mele,v9 > > + - probox2,ava > > + - zidoo,x9s > > + - const: realtek,rtd1295 > > +... > > That does not look like a full "PATCH" yet? It also confuses me whether > or when leading dashes are necessary - for Actions Semi "items" had one. '...' is the end of YAML document marker. '-' means a list item (a YAML/JSON list, not to be confused with 'items' the json-schema keyword). Actions uses 'oneOf' (which is a list of schemas) because there are multiple SoCs. And also 'items' itself can be a list or dict, but we restrict it to lists for the DT meta-schema. > I have preparations on my GitHub staging tree for three more SoCs, so we > should prepare the structure to ease adding SoCs and avoid re-indenting > patches - adding SoCs was much easier in the original flat text format. > Please also consider for other vendors. Good point. One option is always use 'oneOf' even if just 1 item. The problem is that the use of oneOf/allOf/anyOf makes the error reporting pretty vague. Another option is to make each SoC a separate schema which could be either separate docs or multiple yaml docs within a file. The downside is just repeating all the top-level properties. > > Same comment as for Actions: We're losing a human description of the > enum values. I kept those as comments when there was meaningful information. I did not feel that "MeLE V9" as a description of "mele,v9" added any value. If you want to add 'model' schema that would be better than having just comments, but I'm not going to find all the values of model which aren't documented. Rob