Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp1826361ybt; Mon, 15 Jun 2020 10:20:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwDGvgjS6iEphdukNgRgh0SyC4dYmkUQEb5YyH1BnKdiMcXRTpmE2jiR+YIYXcnzadSMAp5 X-Received: by 2002:a50:9f27:: with SMTP id b36mr23903423edf.211.1592241631646; Mon, 15 Jun 2020 10:20:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592241631; cv=none; d=google.com; s=arc-20160816; b=p1IncFcvO0yMfsbcWryLRyUlF0Agdd69ITmsitLbuD6YSnvWIha+Kdlno/jUbBtYu/ rJOSLefXj6hr9t4pexoWXzOB6ujfyB66s2NEYp+z9TyIfJB9wPkWV3+/7psY2MDbRGmP f8ErV+9ch6VANvvboEK2FhP2dmBe78MGTbEe3vgGIyzqYPiVlBRm0ncSg2vUmLoaZYcU uwVjFtpyKrmiiFaNXc4coApzvT8jw8OXpQJU9/g0yUU1seh88fISH+GCpf/7xjnHYKhL CC3KQkEiHd2+cipVkdqII1Mo0givQZURRyndPxifGiRStj7EMAX2v1ILO0ACdcQoMefe O6ng== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=hiOijoD53LX37YRMIwEiw00dAjUSx8soGvrpBh7UCNk=; b=Pn5hDoIVtv4UDj/QLWZIEMGm9Q1HpD1ObTUQLBpTy0f2LPBjrlvmbIQTxuRVGr+vBw g/z49JQhnv4KqK7TTRufkVW5mUSoggufurHvq738FfaYXxeVb8wcSTAy8knpTCyFGuwz L9iJF1QQb+YwOuLHQot0UOObaMK+HvTq2n/H6Jo9mrjcKEBkR1tHESZMX0K/dPDGBVnE Nadp5roQgjM6aJFaFxUTNwkPIkL3usUrbY/7Z0ZY5bvQnak57e+gcDGeSwL2Gr3401JP c/g08oeBt1sC8HBsrW24VgkX1a5DtyDamEuAMM9Gvxa4jgX2lASyC4N7qx9mqA0R4usJ olCw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id si8si10067706ejb.7.2020.06.15.10.20.09; Mon, 15 Jun 2020 10:20:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S1731121AbgFOROq (ORCPT + 99 others); Mon, 15 Jun 2020 13:14:46 -0400 Received: from mail-io1-f65.google.com ([209.85.166.65]:45940 "EHLO mail-io1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729354AbgFOROp (ORCPT ); Mon, 15 Jun 2020 13:14:45 -0400 Received: by mail-io1-f65.google.com with SMTP id y5so18680975iob.12; Mon, 15 Jun 2020 10:14:44 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=hiOijoD53LX37YRMIwEiw00dAjUSx8soGvrpBh7UCNk=; b=Qp9t/KukYyFxOiVzLy05euwvk2eHpu3iUN54O56gdnqMdhs2oFTtUmSgr4OIRQjalN jXMkicbQ4ftOaaksx7gMLuIc3GhsFBoXB2aZGezpjzQeKaMSlrMz73L31/4eiPwL5tBz /5YHxy7eu6z22XXhs8l7pTRL0G/QBzRJaMUTpiYtNBCM4XI/uVysscsjv0GjSS5R5eLn X/G8UJjcxLdni/NPuaRrZiHgM9EgvKETQe+VQgxCHc1MDSJtI8yS//l3Eox9bZwEk8bt ilYdm1Fq0tW4DduMvS+ERjovuHRWvAGo2WCsz2aMvM8+2ng1nj+GEMPmAzwpQpuySFn9 R3FA== X-Gm-Message-State: AOAM530pGKBUdNU2LvGx9W34hCV31XdZccl4eENEIq0xY1ixgBBSdL3w nb9zQ1tGiSkmPgchUoKczQ== X-Received: by 2002:a02:7f4d:: with SMTP id r74mr21951710jac.51.1592241283969; Mon, 15 Jun 2020 10:14:43 -0700 (PDT) Received: from xps15 ([64.188.179.251]) by smtp.gmail.com with ESMTPSA id v11sm8354642ile.61.2020.06.15.10.14.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Jun 2020 10:14:43 -0700 (PDT) Received: (nullmailer pid 1974668 invoked by uid 1000); Mon, 15 Jun 2020 17:14:41 -0000 Date: Mon, 15 Jun 2020 11:14:41 -0600 From: Rob Herring To: Anson Huang Cc: broonie@kernel.org, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, marex@denx.de, linux-spi@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Linux-imx@nxp.com Subject: Re: [PATCH V2 2/3] dt-bindings: spi: Convert imx cspi to json-schema Message-ID: <20200615171441.GA1971091@bogus> References: <1591235731-15673-1-git-send-email-Anson.Huang@nxp.com> <1591235731-15673-3-git-send-email-Anson.Huang@nxp.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1591235731-15673-3-git-send-email-Anson.Huang@nxp.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jun 04, 2020 at 09:55:30AM +0800, Anson Huang wrote: > Convert the i.MX CSPI binding to DT schema format using json-schema, > update compatible, remove obsolete properties "fsl,spi-num-chipselects" > and update the example based on latest DT file. > > Signed-off-by: Anson Huang > --- > Changes since V1: > - add "unevaluatedProperties: false". > --- > .../devicetree/bindings/spi/fsl-imx-cspi.txt | 56 ------------ > .../devicetree/bindings/spi/fsl-imx-cspi.yaml | 99 ++++++++++++++++++++++ > 2 files changed, 99 insertions(+), 56 deletions(-) > delete mode 100644 Documentation/devicetree/bindings/spi/fsl-imx-cspi.txt > create mode 100644 Documentation/devicetree/bindings/spi/fsl-imx-cspi.yaml > > diff --git a/Documentation/devicetree/bindings/spi/fsl-imx-cspi.txt b/Documentation/devicetree/bindings/spi/fsl-imx-cspi.txt > deleted file mode 100644 > index 33bc58f..0000000 > --- a/Documentation/devicetree/bindings/spi/fsl-imx-cspi.txt > +++ /dev/null > @@ -1,56 +0,0 @@ > -* Freescale (Enhanced) Configurable Serial Peripheral Interface > - (CSPI/eCSPI) for i.MX > - > -Required properties: > -- compatible : > - - "fsl,imx1-cspi" for SPI compatible with the one integrated on i.MX1 > - - "fsl,imx21-cspi" for SPI compatible with the one integrated on i.MX21 > - - "fsl,imx27-cspi" for SPI compatible with the one integrated on i.MX27 > - - "fsl,imx31-cspi" for SPI compatible with the one integrated on i.MX31 > - - "fsl,imx35-cspi" for SPI compatible with the one integrated on i.MX35 > - - "fsl,imx51-ecspi" for SPI compatible with the one integrated on i.MX51 > - - "fsl,imx53-ecspi" for SPI compatible with the one integrated on i.MX53 and later Soc > - - "fsl,imx8mq-ecspi" for SPI compatible with the one integrated on i.MX8MQ > - - "fsl,imx8mm-ecspi" for SPI compatible with the one integrated on i.MX8MM > - - "fsl,imx8mn-ecspi" for SPI compatible with the one integrated on i.MX8MN > - - "fsl,imx8mp-ecspi" for SPI compatible with the one integrated on i.MX8MP > -- reg : Offset and length of the register set for the device > -- interrupts : Should contain CSPI/eCSPI interrupt > -- clocks : Clock specifiers for both ipg and per clocks. > -- clock-names : Clock names should include both "ipg" and "per" > -See the clock consumer binding, > - Documentation/devicetree/bindings/clock/clock-bindings.txt > - > -Recommended properties: > -- cs-gpios : GPIOs to use as chip selects, see spi-bus.txt. While the native chip > -select lines can be used, they appear to always generate a pulse between each > -word of a transfer. Most use cases will require GPIO based chip selects to > -generate a valid transaction. > - > -Optional properties: > -- num-cs : Number of total chip selects, see spi-bus.txt. > -- dmas: DMA specifiers for tx and rx dma. See the DMA client binding, > -Documentation/devicetree/bindings/dma/dma.txt. > -- dma-names: DMA request names, if present, should include "tx" and "rx". > -- fsl,spi-rdy-drctl: Integer, representing the value of DRCTL, the register > -controlling the SPI_READY handling. Note that to enable the DRCTL consideration, > -the SPI_READY mode-flag needs to be set too. > -Valid values are: 0 (disabled), 1 (edge-triggered burst) and 2 (level-triggered burst). > - > -Obsolete properties: > -- fsl,spi-num-chipselects : Contains the number of the chipselect > - > -Example: > - > -ecspi@70010000 { > - #address-cells = <1>; > - #size-cells = <0>; > - compatible = "fsl,imx51-ecspi"; > - reg = <0x70010000 0x4000>; > - interrupts = <36>; > - cs-gpios = <&gpio3 24 0>, /* GPIO3_24 */ > - <&gpio3 25 0>; /* GPIO3_25 */ > - dmas = <&sdma 3 7 1>, <&sdma 4 7 2>; > - dma-names = "rx", "tx"; > - fsl,spi-rdy-drctl = <1>; > -}; > diff --git a/Documentation/devicetree/bindings/spi/fsl-imx-cspi.yaml b/Documentation/devicetree/bindings/spi/fsl-imx-cspi.yaml > new file mode 100644 > index 0000000..606af7d > --- /dev/null > +++ b/Documentation/devicetree/bindings/spi/fsl-imx-cspi.yaml > @@ -0,0 +1,99 @@ > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) > +%YAML 1.2 > +--- > +$id: http://devicetree.org/schemas/spi/fsl-imx-cspi.yaml# > +$schema: http://devicetree.org/meta-schemas/core.yaml# > + > +title: Freescale (Enhanced) Configurable Serial Peripheral Interface (CSPI/eCSPI) for i.MX > + > +maintainers: > + - Shawn Guo > + > +allOf: > + - $ref: "/schemas/spi/spi-controller.yaml#" > + > +properties: > + compatible: > + oneOf: > + - const: fsl,imx1-cspi > + - const: fsl,imx21-cspi > + - const: fsl,imx27-cspi > + - const: fsl,imx31-cspi > + - const: fsl,imx35-cspi > + - const: fsl,imx51-ecspi > + - const: fsl,imx53-ecspi > + - items: > + - enum: > + - fsl,imx50-ecspi > + - fsl,imx6q-ecspi > + - fsl,imx6sx-ecspi > + - fsl,imx6sl-ecspi > + - fsl,imx6sll-ecspi > + - fsl,imx6ul-ecspi > + - fsl,imx7d-ecspi > + - fsl,imx8mq-ecspi > + - fsl,imx8mm-ecspi > + - fsl,imx8mn-ecspi > + - fsl,imx8mp-ecspi > + - const: fsl,imx51-ecspi > + > + reg: > + maxItems: 1 > + > + interrupts: > + maxItems: 1 > + > + clocks: > + items: > + - description: SoC SPI ipg clock > + - description: SoC SPI per clock > + maxItems: 2 Can drop 'maxItems', it is redundant here. > + > + clock-names: > + items: > + - const: ipg > + - const: per > + maxItems: 2 And here. > + > + dmas: > + items: > + - description: DMA controller phandle and request line for RX > + - description: DMA controller phandle and request line for TX > + > + dma-names: > + items: > + - const: rx > + - const: tx > + > + fsl,spi-rdy-drctl: > + $ref: /schemas/types.yaml#/definitions/uint32 > + description: | > + Integer, representing the value of DRCTL, the register controlling > + the SPI_READY handling. Note that to enable the DRCTL consideration, > + the SPI_READY mode-flag needs to be set too. > + Valid values are: 0 (disabled), 1 (edge-triggered burst) and 2 (level-triggered burst). > + enum: [0, 1, 2] > + > +required: > + - compatible > + - reg > + - interrupts > + - clocks > + - clock-names > + > +unevaluatedProperties: false > + > +examples: > + - | > + #include > + > + spi@70010000 { > + #address-cells = <1>; > + #size-cells = <0>; > + compatible = "fsl,imx51-ecspi"; > + reg = <0x70010000 0x4000>; > + interrupts = <36>; > + clocks = <&clks IMX5_CLK_ECSPI1_IPG_GATE>, > + <&clks IMX5_CLK_ECSPI1_PER_GATE>; > + clock-names = "ipg", "per"; > + }; > -- > 2.7.4 >