Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp1571724ybe; Mon, 2 Sep 2019 23:54:53 -0700 (PDT) X-Google-Smtp-Source: APXvYqx78ktxrkCJjiPbxdzqb4sKMEJ/FKNXHIljB/qbEI/Gg8VvXkX9FZKIOHnWA0O0jaGeVkb2 X-Received: by 2002:a17:90a:ff04:: with SMTP id ce4mr7586193pjb.121.1567493693752; Mon, 02 Sep 2019 23:54:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567493693; cv=none; d=google.com; s=arc-20160816; b=K/uBSnrx1oHmQ4Q+fxPha1GKYDwgOnMPIWWhc7Y365p4EFpUATsbKChbrF4BNr3Qy+ gIwndrDzq8acVriw8VFUkpqskFTjetzW1GnzwereE/Vx7AgrYyp1VyLKL448gGZt529D x5rf7lolFs9znNg25XalMK0wZaYltSEXb81ODNrfpo8BZPVhrjFPmuZ6XH+/uuyxh8p3 yaF+vsmMyL8PfhtkeKmcwuIcDuQKtfCXtgBvukLmKaKJKiu9zcocOv4gk0Tceuj8E15S wopOBJlH+ymMGhMOI+R9uyEabZICK9MrGdjr4AaqQWl+KFyB5kyIqfKSwoBgtoxega1h 9CRQ== 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=0F9dHVWqGS8pUXJgoGylFO0BRrE92SZVgNyvb5o+ce8=; b=X/VnE4/77VvYQR9vqWQ67anu/IsDQwjhKPm+DxjeeH2ksd/WO+LoMr9vy2uxsp/1qh Ws8Ifl7sunrRI8J3ropU306zrhwygvznD+6o375fAYVmieGo16UPlEkWsu9AGo0UkSV6 4wZ/3QHp0pScAtv2L0qhDyv2wmA5mg2NtVDTGvGlhVCUNDt66vUTfqPygwPOH65l7GVO FJMu7SHBGBw4iCD5gb1XqFaBn8/D0d+iWed7oJX9I1q0qBOnaq1HTGO5eCU574N5dnnT enUbUj094+Q3NECNDzpDTYtVFMuaRcQokjjClYWvViGKGRnz+2diksRF7lgEtx2M4dLK OroQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sifive.com header.s=google header.b=Rb9snEpQ; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k12si2976747pjb.87.2019.09.02.23.54.37; Mon, 02 Sep 2019 23:54:53 -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=@sifive.com header.s=google header.b=Rb9snEpQ; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727428AbfICGwE (ORCPT + 99 others); Tue, 3 Sep 2019 02:52:04 -0400 Received: from mail-io1-f66.google.com ([209.85.166.66]:46962 "EHLO mail-io1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727381AbfICGwD (ORCPT ); Tue, 3 Sep 2019 02:52:03 -0400 Received: by mail-io1-f66.google.com with SMTP id x4so33373644iog.13 for ; Mon, 02 Sep 2019 23:52:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sifive.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=0F9dHVWqGS8pUXJgoGylFO0BRrE92SZVgNyvb5o+ce8=; b=Rb9snEpQ7SvC+b9oG9ag30UFSjulOK5Q7VYo24KhNE4ndEiW127L6VDsWso4nAaiWY Gkmfx96iNGy+MKCfw6VvEhxFwrr1QHd4XQeFucutBfqo4UILDU3OmUmAhDxk5yU9nIIM 1RSCyjZ3XOQMS7iJvz6jt7lqYUb53ha+HBQZByisz3YcwKICC4WvXDU0LNciP2gzO3KC OfW57Z5IQyE5YThgotILbUkKItoVs7SYt/j6LEFDvAupjI0oy4lM5jfm28uHSvgseKJk FwHvsQHQEEOa34V+jVhrdQgAAJ1zN/2rJcruvgq8wjr4kSk7rA6Bk8Rfx2/6WazDBypQ LL/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=0F9dHVWqGS8pUXJgoGylFO0BRrE92SZVgNyvb5o+ce8=; b=WyoFpb8ZZL4cE7Ph319/PJwB9NMXn6CCMFqenE8VX3oHuO1SB/gXqkv12SPr9JBe6/ bMpwvWO5aXGgvxr/QE8Zozxz1TWaaqKFCQLeJLmWjKIUZ7zID7ioRlWkKBTKrfo2cmuB Z6PAklrXo3tcVL50qD2FFHUaBGgVXCWBHOX2Bj8wKOzMYolRPmZQOGqBGXCprSAB8Fxz HI5a6pZsV1tPlxW1xbHE30iTAKYZGWtWzn52fTdk0fW78q+7pEO0oobO63Z0gBnXn4RF DCbf+inGHL73Fkih2go4KEGY5UGG3RoaztRfitVXamYS+QirfmIryyrkbi0dlPfhP1cO IEgA== X-Gm-Message-State: APjAAAXr1HLtl4g/ECq+e3U4SDZrz/2HwiONhNOEAkCwgQgB7jkAC+OR CAQo/tHdst5mSwWgjRiGXmNBgviHs3fIThom70ybjQ== X-Received: by 2002:a6b:b714:: with SMTP id h20mr1071770iof.302.1567493522612; Mon, 02 Sep 2019 23:52:02 -0700 (PDT) MIME-Version: 1.0 References: <1567321765-3738-1-git-send-email-pragnesh.patel@sifive.com> <5d6d1b81.1c69fb81.7eabb.cabd@mx.google.com> In-Reply-To: <5d6d1b81.1c69fb81.7eabb.cabd@mx.google.com> From: Pragnesh Patel Date: Tue, 3 Sep 2019 12:21:51 +0530 Message-ID: Subject: Re: [PATCH] dt-bindings: serial: Convert riscv,sifive-serial to json-schema To: Rob Herring Cc: Palmer Dabbelt , Paul Walmsley , Greg Kroah-Hartman , Mark Rutland , Albert Ou , linux-serial@vger.kernel.org, devicetree@vger.kernel.org, linux-riscv@lists.infradead.org, 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 Mon, Sep 2, 2019 at 7:09 PM Rob Herring wrote: > > On Sun, Sep 01, 2019 at 12:39:21PM +0530, Pragnesh Patel wrote: > > Convert the riscv,sifive-serial binding to DT schema using json-schema. > > > > Signed-off-by: Pragnesh Patel > > --- > > .../devicetree/bindings/serial/sifive-serial.txt | 33 ------------ > > .../devicetree/bindings/serial/sifive-serial.yaml | 62 ++++++++++++++++++++++ > > 2 files changed, 62 insertions(+), 33 deletions(-) > > delete mode 100644 Documentation/devicetree/bindings/serial/sifive-serial.txt > > create mode 100644 Documentation/devicetree/bindings/serial/sifive-serial.yaml > > > > diff --git a/Documentation/devicetree/bindings/serial/sifive-serial.txt b/Documentation/devicetree/bindings/serial/sifive-serial.txt > > deleted file mode 100644 > > index c86b1e5..0000000 > > --- a/Documentation/devicetree/bindings/serial/sifive-serial.txt > > +++ /dev/null > > @@ -1,33 +0,0 @@ > > -SiFive asynchronous serial interface (UART) > > - > > -Required properties: > > - > > -- compatible: should be something similar to > > - "sifive,-uart" for the UART as integrated > > - on a particular chip, and "sifive,uart" for the > > - general UART IP block programming model. Supported > > - compatible strings as of the date of this writing are: > > - "sifive,fu540-c000-uart" for the SiFive UART v0 as > > - integrated onto the SiFive FU540 chip, or "sifive,uart0" > > - for the SiFive UART v0 IP block with no chip integration > > - tweaks (if any) > > -- reg: address and length of the register space > > -- interrupts: Should contain the UART interrupt identifier > > -- clocks: Should contain a clock identifier for the UART's parent clock > > - > > - > > -UART HDL that corresponds to the IP block version numbers can be found > > -here: > > - > > -https://github.com/sifive/sifive-blocks/tree/master/src/main/scala/devices/uart > > - > > - > > -Example: > > - > > -uart0: serial@10010000 { > > - compatible = "sifive,fu540-c000-uart", "sifive,uart0"; > > - interrupt-parent = <&plic0>; > > - interrupts = <80>; > > - reg = <0x0 0x10010000 0x0 0x1000>; > > - clocks = <&prci PRCI_CLK_TLCLK>; > > -}; > > diff --git a/Documentation/devicetree/bindings/serial/sifive-serial.yaml b/Documentation/devicetree/bindings/serial/sifive-serial.yaml > > new file mode 100644 > > index 0000000..56fa935 > > --- /dev/null > > +++ b/Documentation/devicetree/bindings/serial/sifive-serial.yaml > > @@ -0,0 +1,62 @@ > > +# SPDX-License-Identifier: GPL-2.0 > > +%YAML 1.2 > > +--- > > +$id: http://devicetree.org/schemas/serial/sifive-serial.yaml# > > +$schema: http://devicetree.org/meta-schemas/core.yaml# > > + > > +title: SiFive asynchronous serial interface (UART) > > + > > +maintainers: > > + - Pragnesh Patel > > + - Paul Walmsley > > + - Palmer Dabbelt > > + > > +allOf: > > + - $ref: /schemas/serial.yaml# > > + > > +properties: > > + compatible: > > + enum: > > + - sifive,fu540-c000-uart > > + - sifive,uart0 > > This is wrong and should have warned if you tested this on 5.3. > > items: > - const: sifive,fu540-c000-uart > - const: sifive,uart0 > Thanks for the correction, i will update this in v2 patch. I haven't got any warnings due to my patch. For your reference, following is the list of warnings when i did "make dtbs_check" (kernel version - 5.3.0-rc7) /home/pragneshp/opensource/linux/Documentation/devicetree/bindings/riscv/cpus.example.dt.yaml: cpu@0: compatible:0: 'riscv' is not one of ['sifive,rocket0', 'sifive,e5', 'sifive,e51', 'sifive,u54-mc', 'sifive,u54', 'sifive,u5'] /home/pragneshp/opensource/linux/Documentation/devicetree/bindings/riscv/cpus.example.dt.yaml: cpu@0: compatible: ['riscv'] is too short /home/pragneshp/opensource/linux/Documentation/devicetree/bindings/riscv/cpus.example.dt.yaml: cpu@0: 'timebase-frequency' is a required property /home/pragneshp/opensource/linux/Documentation/devicetree/bindings/riscv/cpus.example.dt.yaml: cpu@0: 'timebase-frequency' is a required property /home/pragneshp/opensource/linux/Documentation/devicetree/bindings/riscv/cpus.example.dt.yaml: cpu@1: 'timebase-frequency' is a required property /home/pragneshp/opensource/linux/arch/riscv/boot/dts/sifive/hifive-unleashed-a00.dt.yaml: /: compatible: ['sifive,hifive-unleashed-a00', 'sifive,fu540-c000'] is too short /home/pragneshp/opensource/linux/arch/riscv/boot/dts/sifive/hifive-unleashed-a00.dt.yaml: cpu@3: 'timebase-frequency' is a required property /home/pragneshp/opensource/linux/arch/riscv/boot/dts/sifive/hifive-unleashed-a00.dt.yaml: cpu@3: compatible: Additional items are not allowed ('riscv' was unexpected) /home/pragneshp/opensource/linux/arch/riscv/boot/dts/sifive/hifive-unleashed-a00.dt.yaml: cpu@3: compatible:1: 'riscv' was expected /home/pragneshp/opensource/linux/arch/riscv/boot/dts/sifive/hifive-unleashed-a00.dt.yaml: cpu@3: compatible: ['sifive,u54-mc', 'sifive,rocket0', 'riscv'] is too long /home/pragneshp/opensource/linux/arch/riscv/boot/dts/sifive/hifive-unleashed-a00.dt.yaml: cpu@1: 'timebase-frequency' is a required property /home/pragneshp/opensource/linux/arch/riscv/boot/dts/sifive/hifive-unleashed-a00.dt.yaml: cpu@1: compatible: Additional items are not allowed ('riscv' was unexpected) /home/pragneshp/opensource/linux/arch/riscv/boot/dts/sifive/hifive-unleashed-a00.dt.yaml: cpu@1: compatible:1: 'riscv' was expected /home/pragneshp/opensource/linux/arch/riscv/boot/dts/sifive/hifive-unleashed-a00.dt.yaml: cpu@1: compatible: ['sifive,u54-mc', 'sifive,rocket0', 'riscv'] is too long /home/pragneshp/opensource/linux/arch/riscv/boot/dts/sifive/hifive-unleashed-a00.dt.yaml: cpu@4: 'timebase-frequency' is a required property /home/pragneshp/opensource/linux/arch/riscv/boot/dts/sifive/hifive-unleashed-a00.dt.yaml: cpu@4: compatible: Additional items are not allowed ('riscv' was unexpected) /home/pragneshp/opensource/linux/arch/riscv/boot/dts/sifive/hifive-unleashed-a00.dt.yaml: cpu@4: compatible:1: 'riscv' was expected /home/pragneshp/opensource/linux/arch/riscv/boot/dts/sifive/hifive-unleashed-a00.dt.yaml: cpu@4: compatible: ['sifive,u54-mc', 'sifive,rocket0', 'riscv'] is too long /home/pragneshp/opensource/linux/arch/riscv/boot/dts/sifive/hifive-unleashed-a00.dt.yaml: cpu@2: 'timebase-frequency' is a required property /home/pragneshp/opensource/linux/arch/riscv/boot/dts/sifive/hifive-unleashed-a00.dt.yaml: cpu@2: compatible: Additional items are not allowed ('riscv' was unexpected) /home/pragneshp/opensource/linux/arch/riscv/boot/dts/sifive/hifive-unleashed-a00.dt.yaml: cpu@2: compatible:1: 'riscv' was expected /home/pragneshp/opensource/linux/arch/riscv/boot/dts/sifive/hifive-unleashed-a00.dt.yaml: cpu@2: compatible: ['sifive,u54-mc', 'sifive,rocket0', 'riscv'] is too long /home/pragneshp/opensource/linux/arch/riscv/boot/dts/sifive/hifive-unleashed-a00.dt.yaml: cpu@0: compatible: Additional items are not allowed ('riscv' was unexpected) /home/pragneshp/opensource/linux/arch/riscv/boot/dts/sifive/hifive-unleashed-a00.dt.yaml: cpu@0: compatible:1: 'riscv' was expected /home/pragneshp/opensource/linux/arch/riscv/boot/dts/sifive/hifive-unleashed-a00.dt.yaml: cpu@0: compatible: ['sifive,e51', 'sifive,rocket0', 'riscv'] is too long /home/pragneshp/opensource/linux/arch/riscv/boot/dts/sifive/hifive-unleashed-a00.dt.yaml: soc: compatible:0: 'sifive,fu540-c000' is not one of ['sifive,hifive-unleashed-a00'] /home/pragneshp/opensource/linux/arch/riscv/boot/dts/sifive/hifive-unleashed-a00.dt.yaml: soc: compatible:1: 'sifive,fu540-c000' was expected /home/pragneshp/opensource/linux/arch/riscv/boot/dts/sifive/hifive-unleashed-a00.dt.yaml: soc: compatible:2: 'sifive,fu540' was expected /home/pragneshp/opensource/linux/arch/riscv/boot/dts/sifive/hifive-unleashed-a00.dt.yaml: soc: $nodename:0: '/' was expected /home/pragneshp/opensource/linux/arch/riscv/boot/dts/sifive/hifive-unleashed-a00.dt.yaml: soc: spi@10041000:reg:0: [0, 268701696, 0, 4096, 0, 805306368, 0, 268435456] is too long /home/pragneshp/opensource/linux/arch/riscv/boot/dts/sifive/hifive-unleashed-a00.dt.yaml: soc: ethernet@10090000:reg:0: [0, 269025280, 0, 8192, 0, 269090816, 0, 4096] is too long /home/pragneshp/opensource/linux/arch/riscv/boot/dts/sifive/hifive-unleashed-a00.dt.yaml: soc: spi@10040000:reg:0: [0, 268697600, 0, 4096, 0, 536870912, 0, 268435456] is too long > > > + > > + description: > > + Should be something similar to "sifive,-uart" > > + for the UART as integrated on a particular chip, > > + and "sifive,uart" for the general UART IP > > + block programming model. > > + > > + UART HDL that corresponds to the IP block version > > + numbers can be found here - > > + > > + https://github.com/sifive/sifive-blocks/tree/master/src/main/scala/devices/uart > > + > > + reg: > > + maxItems: 1 > > + > > + interrupts: > > + maxItems: 1 > > + > > + clocks: > > + maxItems: 1 > > + > > +required: > > + - compatible > > + - reg > > + - interrupts > > + - clocks > > + > > +additionalProperties: false > > + > > +examples: > > + - | > > + #include > > + serial@10010000 { > > + compatible = "sifive,fu540-c000-uart", "sifive,uart0"; > > + interrupt-parent = <&plic0>; > > + interrupts = <80>; > > + reg = <0x0 0x10010000 0x0 0x1000>; > > + clocks = <&prci PRCI_CLK_TLCLK>; > > + }; > > + > > +... > > -- > > 2.7.4 > > >