Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp6601251ybe; Wed, 18 Sep 2019 06:14:02 -0700 (PDT) X-Google-Smtp-Source: APXvYqwBsE3aCt5sffLEbpUZafEA0fD9kESdeUOas22rrPaO+fhJT1H3v7c7O+63oridp71HPMqo X-Received: by 2002:a50:ab49:: with SMTP id t9mr10130442edc.301.1568812442363; Wed, 18 Sep 2019 06:14:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568812442; cv=none; d=google.com; s=arc-20160816; b=Z1w1Xfk8aFZeIuUt57sXVR/g20MEcjKgzybq76J2dtwm3f1oYJSphK9Yw3f59xJE3g 4PZUsW2Mif/VXZohQqbJxOd7vL3+3U/NU//jLXLFNq/nq7wafcgph+swAv5WsoJYP3Xc jonpOEzWDpfMRL5JK9IUS/LQaPjRCaeJ3z7gF5zbWsehJncprbWTYS1ccHazg+Zhz7wO yYdUgh8wCi4hcJe0S/qTQ6byDe5WsnGuon17H8vPmzWAgN/3rAaWcd87x3n3LntQkF/3 49qEMScgvxz1IeHhTwom9P5Y7dCGsoYMFbZqBfaLEJo7RTO5RPN8+cWehvFT/DlkuzeX FGQQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=TIBonrAou/kqYBGJ3D/jipopO+euPWjTtxCKgGWeHV4=; b=lGwrREEctbwCd/CNHYntxcNi6LmqN63f2g6wpDuS2H2qzWbjVZay0oZC4a2T3I3ZPL hXGCYUksUE1fK/FQ8BZCXsTnKq4ndyZipcvGLkqb8qz6mynJkbm9sXHcCdWPyrwG0BXs +nQWvkAYPdBsZfYY4+4Vq68TPk8eB8eOrGEkH0ld6jZxXSCaR54QqZYczJxIlpL8P2Nh XXEHxdZthyrpZDqb1/9jv6GopBqZDTF+UUZCMkuKi7slxufZF97T3rGtyt1YhXwYFJ5Y y3hntu9wnxlVfkuEIcUFfq/+fKxEmxG0wGHkzOsO3BF19mBPIJAMSiDBdUgln3mKCF+R qgUw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sifive.com header.s=google header.b=nDUBvcRN; 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 z19si954582edr.403.2019.09.18.06.13.38; Wed, 18 Sep 2019 06:14:02 -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=nDUBvcRN; 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 S1729915AbfIRLKB (ORCPT + 99 others); Wed, 18 Sep 2019 07:10:01 -0400 Received: from mail-pf1-f193.google.com ([209.85.210.193]:41983 "EHLO mail-pf1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727456AbfIRLKB (ORCPT ); Wed, 18 Sep 2019 07:10:01 -0400 Received: by mail-pf1-f193.google.com with SMTP id q7so4199029pfh.8 for ; Wed, 18 Sep 2019 04:10:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sifive.com; s=google; h=from:to:cc:subject:date:message-id; bh=TIBonrAou/kqYBGJ3D/jipopO+euPWjTtxCKgGWeHV4=; b=nDUBvcRNoOHsnq/ANJ7DlJa95TZhwrU9I/02wwIaxgLKbyXRG4SlfJFWJ/mjhv1zZE F0fnFmn4Yh/fhCYdDKT9XsHtPqttwIZDKfXRUZFcCtQKOie+yCKHdPHPblvL8AgUYOjb TBmG6nLD1nyykmFcficCKja40OqTpsxenET3AJS2x2S1+6SR3M9v/TpKDNiKF6nfYhAQ 7lNzvt4Jj6jXzDndcArdYASBwXVQl7ATPvE+3eH7NyB765cP+0tUkT4/BzC0jSmD72va TxL8rVFWScalSq3PX8BIcxAFBkBV640HuYdY7+sdff5WmSLk7odwR0X9lWNoNHaXOKXF q47g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=TIBonrAou/kqYBGJ3D/jipopO+euPWjTtxCKgGWeHV4=; b=DQiQb6OjEIdC0tNNor5UrSW4NqpeWi5T9M1VwF/WLyxWVOHjrQwdoZI1wveEUFSoQP ziqL1x+kuxNB/mDH0cWijG5JSHR3I0WXrHMRJNW47GrKUPsT8yLCLVg+efydHI5xukF8 okZuEDXwdqorDIHH9LIDYTopRqVK3yFFnQsxz1UyvE5kBEyobPzhe1zwla4lgS6uDMQ0 i6diJ/cxFOlfBB+/kzdvUHicgloERBP9N8OY4sXsIafOQ+aKawnaNkM+mKY/U0L6wrhJ gF2l0w8Mo3OSg3sFf0xBfi390GbYZtlFJxKOkBB8VSPL+h/tsoJTH+qKebR0SCqRtG1S GprA== X-Gm-Message-State: APjAAAX02dwESZWOlqA5cBsL4AAyZxilzdCA1way/4qpedTS7qZgQee0 gH4EJxP9yxeWbrQuk3nLwHZRFA== X-Received: by 2002:a65:648b:: with SMTP id e11mr3257766pgv.2.1568804999960; Wed, 18 Sep 2019 04:09:59 -0700 (PDT) Received: from pragneshp.open-silicon.com ([114.143.65.226]) by smtp.gmail.com with ESMTPSA id x125sm7256738pfb.93.2019.09.18.04.09.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 18 Sep 2019 04:09:59 -0700 (PDT) From: Pragnesh Patel To: palmer@sifive.com, paul.walmsley@sifive.com Cc: Pragnesh Patel , Mark Brown , Rob Herring , Mark Rutland , linux-spi@vger.kernel.org, devicetree@vger.kernel.org, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v2] spi: dt-bindings: Convert spi-sifive binding to json-schema Date: Wed, 18 Sep 2019 16:38:39 +0530 Message-Id: <1568804927-13565-1-git-send-email-pragnesh.patel@sifive.com> X-Mailer: git-send-email 2.7.4 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Convert the spi-sifive binding to DT schema format. Signed-off-by: Pragnesh Patel --- Changes in v2: - Remove address-cells and size-cells property - Added valid values for sifive,fifo-depth and sifive,max-bits-per-word property .../devicetree/bindings/spi/spi-sifive.txt | 37 ---------- .../devicetree/bindings/spi/spi-sifive.yaml | 86 ++++++++++++++++++++++ 2 files changed, 86 insertions(+), 37 deletions(-) delete mode 100644 Documentation/devicetree/bindings/spi/spi-sifive.txt create mode 100644 Documentation/devicetree/bindings/spi/spi-sifive.yaml diff --git a/Documentation/devicetree/bindings/spi/spi-sifive.txt b/Documentation/devicetree/bindings/spi/spi-sifive.txt deleted file mode 100644 index 3f5c6e4..0000000 --- a/Documentation/devicetree/bindings/spi/spi-sifive.txt +++ /dev/null @@ -1,37 +0,0 @@ -SiFive SPI controller Device Tree Bindings ------------------------------------------- - -Required properties: -- compatible : Should be "sifive,-spi" and "sifive,spi". - Supported compatible strings are: - "sifive,fu540-c000-spi" for the SiFive SPI v0 as integrated - onto the SiFive FU540 chip, and "sifive,spi0" for the SiFive - SPI v0 IP block with no chip integration tweaks. - Please refer to sifive-blocks-ip-versioning.txt for details -- reg : Physical base address and size of SPI registers map - A second (optional) range can indicate memory mapped flash -- interrupts : Must contain one entry -- interrupt-parent : Must be core interrupt controller -- clocks : Must reference the frequency given to the controller -- #address-cells : Must be '1', indicating which CS to use -- #size-cells : Must be '0' - -Optional properties: -- sifive,fifo-depth : Depth of hardware queues; defaults to 8 -- sifive,max-bits-per-word : Maximum bits per word; defaults to 8 - -SPI RTL that corresponds to the IP block version numbers can be found here: -https://github.com/sifive/sifive-blocks/tree/master/src/main/scala/devices/spi - -Example: - spi: spi@10040000 { - compatible = "sifive,fu540-c000-spi", "sifive,spi0"; - reg = <0x0 0x10040000 0x0 0x1000 0x0 0x20000000 0x0 0x10000000>; - interrupt-parent = <&plic>; - interrupts = <51>; - clocks = <&tlclk>; - #address-cells = <1>; - #size-cells = <0>; - sifive,fifo-depth = <8>; - sifive,max-bits-per-word = <8>; - }; diff --git a/Documentation/devicetree/bindings/spi/spi-sifive.yaml b/Documentation/devicetree/bindings/spi/spi-sifive.yaml new file mode 100644 index 0000000..140e435 --- /dev/null +++ b/Documentation/devicetree/bindings/spi/spi-sifive.yaml @@ -0,0 +1,86 @@ +# SPDX-License-Identifier: GPL-2.0 +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/spi/spi-sifive.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: SiFive SPI controller + +maintainers: + - Pragnesh Patel + - Paul Walmsley + - Palmer Dabbelt + +allOf: + - $ref: "spi-controller.yaml#" + +properties: + compatible: + items: + - const: sifive,fu540-c000-spi + - const: sifive,spi0 + + description: + Should be "sifive,-spi" and "sifive,spi". + Supported compatible strings are - + "sifive,fu540-c000-spi" for the SiFive SPI v0 as integrated + onto the SiFive FU540 chip, and "sifive,spi0" for the SiFive + SPI v0 IP block with no chip integration tweaks. + Please refer to sifive-blocks-ip-versioning.txt for details + + SPI RTL that corresponds to the IP block version numbers can be found here - + https://github.com/sifive/sifive-blocks/tree/master/src/main/scala/devices/spi + + reg: + maxItems: 1 + + description: + Physical base address and size of SPI registers map + A second (optional) range can indicate memory mapped flash + + interrupts: + maxItems: 1 + + clocks: + maxItems: 1 + + description: + Must reference the frequency given to the controller + + sifive,fifo-depth: + description: + Depth of hardware queues; defaults to 8 + allOf: + - $ref: "/schemas/types.yaml#/definitions/uint32" + - enum: [ 8 ] + - default: 8 + + sifive,max-bits-per-word: + description: + Maximum bits per word; defaults to 8 + allOf: + - $ref: "/schemas/types.yaml#/definitions/uint32" + - enum: [ 0, 1, 2, 3, 4, 5, 6, 7, 8 ] + - default: 8 + +required: + - compatible + - reg + - interrupts + - clocks + +examples: + - | + spi: spi@10040000 { + compatible = "sifive,fu540-c000-spi", "sifive,spi0"; + reg = <0x0 0x10040000 0x0 0x1000 0x0 0x20000000 0x0 0x10000000>; + interrupt-parent = <&plic>; + interrupts = <51>; + clocks = <&tlclk>; + #address-cells = <1>; + #size-cells = <0>; + sifive,fifo-depth = <8>; + sifive,max-bits-per-word = <8>; + }; + +... -- 2.7.4