From patchwork Wed Jun 9 11:17:06 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pratyush Yadav X-Patchwork-Id: 1489811 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=I3/AcP+i; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=ti.com header.i=@ti.com header.a=rsa-sha256 header.s=ti-com-17Q1 header.b=oF4XciaZ; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4G0Pjm1vlFz9sCD for ; Wed, 9 Jun 2021 21:18:15 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=qfN/EFqVSVf/eTk9hLsRvI/yTv9A7esWBoOdJEcE+Tc=; b=I3/AcP+icv7hlz adwFVGSVIUfna+rOhacMIm83D2bbax4lkWSjCiw49Mj01StWl+JrI65/WhMGP8Euia4b1E3BasSw1 9SQjgM8mBngaCaLgh0O1hbSuRcffTEaY8SoGH7wGc6p9EA8vj6HDFlLQbZzwVJFeMhNbsHLUPHSZn dN9UcVo4lgOkpGqndM36ZsiG3uJTqSFuaihYP0H6Vii2zr0P9ZgmYhtevZ1Sn0QNYBTpkLySrG7SJ N3/rFUuoCi8BARWLksZC3j2MxHrxj3v4A6Aa2FO/NQhDEx2wG4KDiyVVmwQwaIJuntKh78nNvNki3 kEZ5XzuysbWB437Y+JYA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lqwDI-00DGZy-0U; Wed, 09 Jun 2021 11:17:36 +0000 Received: from fllv0016.ext.ti.com ([198.47.19.142]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1lqwD2-00DGY6-50 for linux-mtd@lists.infradead.org; Wed, 09 Jun 2021 11:17:21 +0000 Received: from fllv0034.itg.ti.com ([10.64.40.246]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id 159BHGTB108420; Wed, 9 Jun 2021 06:17:16 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1623237436; bh=3uPifnd/TjX5LJYTJnzADUgj18fof4k8C1XjKHqNUT0=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=oF4XciaZ453+j+Co0+bcDymmfFExtz9kNjgOrR5LJq5HNvkZCOZQXdoVvd0PXsReJ GzStCgJbhp/gaTBfnRN8WYFkavljq7KrWahyDjLuuZTl2g2VWwDYmDxJ/m51P7Kb8e NDedsi2cnCR2coyuWrR4CsSsJGO1VKUfIC74nmTs= Received: from DFLE105.ent.ti.com (dfle105.ent.ti.com [10.64.6.26]) by fllv0034.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 159BHGoK085898 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 9 Jun 2021 06:17:16 -0500 Received: from DFLE113.ent.ti.com (10.64.6.34) by DFLE105.ent.ti.com (10.64.6.26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2176.2; Wed, 9 Jun 2021 06:17:15 -0500 Received: from lelv0327.itg.ti.com (10.180.67.183) by DFLE113.ent.ti.com (10.64.6.34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2176.2 via Frontend Transport; Wed, 9 Jun 2021 06:17:15 -0500 Received: from pratyush-OptiPlex-790.dhcp.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by lelv0327.itg.ti.com (8.15.2/8.15.2) with ESMTP id 159BH7uG073420; Wed, 9 Jun 2021 06:17:12 -0500 From: Pratyush Yadav To: Miquel Raynal , Richard Weinberger , Vignesh Raghavendra , Rob Herring , Mark Brown , Pratyush Yadav , , , , CC: Nishanth Menon , Michael Walle , Tudor Ambarus Subject: [PATCH 1/2] spi: dt-bindings: add schema listing slave-specific properties Date: Wed, 9 Jun 2021 16:47:06 +0530 Message-ID: <20210609111707.9555-2-p.yadav@ti.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210609111707.9555-1-p.yadav@ti.com> References: <20210609111707.9555-1-p.yadav@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210609_041720_304527_BFD30D79 X-CRM114-Status: GOOD ( 22.96 ) X-Spam-Score: -2.8 (--) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Many SPI controllers need to add properties to slave devices. This could be the delay in clock or data lines, etc. These properties are controller specific but need to be defined in the slave node bec [...] Content analysis details: (-2.8 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [198.47.19.142 listed in list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.3 DKIMWL_WL_HIGH DKIMwl.org - High trust sender X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-mtd" Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Many SPI controllers need to add properties to slave devices. This could be the delay in clock or data lines, etc. These properties are controller specific but need to be defined in the slave node because they are per-slave and there can be multiple slaves attached to a controller. If these properties are not added to the slave binding, then the dtbs check emits a warning. But these properties do not make much sense in the slave binding because they are controller-specific and they will just pollute every slave binding. So this binding is added to collect all such properties from all such controllers. Slave bindings should simply refer to this binding and they should be rid of the warnings. There are some limitations with this approach. Firstly, there is no way to specify required properties. The schema contains properties for all controllers and there is no way to know which controller is being used. Secondly, there is no way to restrict additional properties. Since this schema will be used with an allOf operator, additionalProperties needs to be true. In addition, the slave schema will have to set unevaluatedProperties: false. Despite these limitations, this appears to be the best solution to this problem that doesn't involve modifying existing tools or schema specs. Signed-off-by: Pratyush Yadav --- .../bindings/spi/cdns,qspi-nor.yaml | 33 ------------ .../bindings/spi/spi-slave-props.yaml | 52 +++++++++++++++++++ 2 files changed, 52 insertions(+), 33 deletions(-) create mode 100644 Documentation/devicetree/bindings/spi/spi-slave-props.yaml diff --git a/Documentation/devicetree/bindings/spi/cdns,qspi-nor.yaml b/Documentation/devicetree/bindings/spi/cdns,qspi-nor.yaml index 0e7087cc8bf9..0730e6a8dc4a 100644 --- a/Documentation/devicetree/bindings/spi/cdns,qspi-nor.yaml +++ b/Documentation/devicetree/bindings/spi/cdns,qspi-nor.yaml @@ -74,39 +74,6 @@ properties: items: enum: [ qspi, qspi-ocp ] -# subnode's properties -patternProperties: - "@[0-9a-f]+$": - type: object - description: - Flash device uses the below defined properties in the subnode. - - properties: - cdns,read-delay: - $ref: /schemas/types.yaml#/definitions/uint32 - description: - Delay for read capture logic, in clock cycles. - - cdns,tshsl-ns: - description: - Delay in nanoseconds for the length that the master mode chip select - outputs are de-asserted between transactions. - - cdns,tsd2d-ns: - description: - Delay in nanoseconds between one chip select being de-activated - and the activation of another. - - cdns,tchsh-ns: - description: - Delay in nanoseconds between last bit of current transaction and - deasserting the device chip select (qspi_n_ss_out). - - cdns,tslch-ns: - description: - Delay in nanoseconds between setting qspi_n_ss_out low and - first bit transfer. - required: - compatible - reg diff --git a/Documentation/devicetree/bindings/spi/spi-slave-props.yaml b/Documentation/devicetree/bindings/spi/spi-slave-props.yaml new file mode 100644 index 000000000000..b2248e01dc43 --- /dev/null +++ b/Documentation/devicetree/bindings/spi/spi-slave-props.yaml @@ -0,0 +1,52 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/spi/spi-slave-props.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Slave-specific properties for a SPI bus. + +description: | + Many SPI controllers need to add properties to slave devices. This could be + the delay in clock or data lines, etc. These properties are controller + specific but need to be defined in the slave node because they are per-slave + and there can be multiple slaves attached to a controller. + + If these properties are not added to the slave binding, then the dtbs check + emits a warning. But these properties do not make much sense in the slave + binding because they are controller-specific and they will just pollute every + slave binding. So this binding is added to collect all such properties from + all such controllers. Slave bindings should simply refer to this binding and + they should be rid of the warnings. + +maintainers: + - Pratyush Yadav + +properties: + # cdns,qspi-nor.yaml + cdns,read-delay: + $ref: /schemas/types.yaml#/definitions/uint32 + description: + Delay for read capture logic, in clock cycles. + + cdns,tshsl-ns: + description: + Delay in nanoseconds for the length that the master mode chip select + outputs are de-asserted between transactions. + + cdns,tsd2d-ns: + description: + Delay in nanoseconds between one chip select being de-activated + and the activation of another. + + cdns,tchsh-ns: + description: + Delay in nanoseconds between last bit of current transaction and + deasserting the device chip select (qspi_n_ss_out). + + cdns,tslch-ns: + description: + Delay in nanoseconds between setting qspi_n_ss_out low and + first bit transfer. + +additionalProperties: true From patchwork Wed Jun 9 11:17:07 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pratyush Yadav X-Patchwork-Id: 1489813 X-Patchwork-Delegate: tudor.ambarus@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=I4jtO7pG; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=ti.com header.i=@ti.com header.a=rsa-sha256 header.s=ti-com-17Q1 header.b=eiO3GUxB; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4G0Pjv2g5xz9sPf for ; Wed, 9 Jun 2021 21:18:27 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=yP+0q+zJJAoYrkkKLCkV3HgR1BB1pcGzkShvDzRPCMk=; b=I4jtO7pGakohuj RRka6R/U+jT6yvR4rMOrV+Ij9/SFItcNM+tAyeLuVvKqXAA4E9Vl8SArQOEMCE7B6byrioxBIVybn AOC5D8xfjZJh8QHX0dxV8gmOSo3+8C1SYNBYwGQaaXztl8njQFEO7Xre21B5ltAtCtV7tdT7xJNG5 lwPT3TMWJTyICQAG5qrRibGX99kOCqg0cF5W6Swfo2ZD5VP8H/4sm4IA0uoUx5MCfZwR/nIrCYDhW baUbGbhgStoOWUqjlqmqPubGkWTMY9YHIzcLxS8XlCAsyH8pe9NIBa95YB06l37L1I2Ban7Tx3nId sZGH3liq1qBr8fFCCL0w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lqwDV-00DGbi-GV; Wed, 09 Jun 2021 11:17:49 +0000 Received: from fllv0015.ext.ti.com ([198.47.19.141]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1lqwD6-00DGYv-9Q for linux-mtd@lists.infradead.org; Wed, 09 Jun 2021 11:17:25 +0000 Received: from fllv0034.itg.ti.com ([10.64.40.246]) by fllv0015.ext.ti.com (8.15.2/8.15.2) with ESMTP id 159BHKOM070200; Wed, 9 Jun 2021 06:17:20 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1623237440; bh=k+MYscYK157qqj9O9OVFOcOn5X9nPnm+nv8lFRPh3Fg=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=eiO3GUxBoaX4CZoZ8CSZP8nEJ2jbE8OZ1eM759a0fUqHRGwiuA/ZeSdvkuGvtT3pZ uKP+CBaQ+lTNVVAgh4hUqKMolYuyKuaNM2BtYU70Ef7jdpV5uK/Lo054u+8RO25oqk jopC6PKnT25tx3sMdhpfGPSZ+BWqQDZLLebtAQIU= Received: from DFLE105.ent.ti.com (dfle105.ent.ti.com [10.64.6.26]) by fllv0034.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 159BHKcj085970 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 9 Jun 2021 06:17:20 -0500 Received: from DFLE108.ent.ti.com (10.64.6.29) by DFLE105.ent.ti.com (10.64.6.26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2176.2; Wed, 9 Jun 2021 06:17:19 -0500 Received: from lelv0327.itg.ti.com (10.180.67.183) by DFLE108.ent.ti.com (10.64.6.29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2176.2 via Frontend Transport; Wed, 9 Jun 2021 06:17:19 -0500 Received: from pratyush-OptiPlex-790.dhcp.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by lelv0327.itg.ti.com (8.15.2/8.15.2) with ESMTP id 159BH7uH073420; Wed, 9 Jun 2021 06:17:16 -0500 From: Pratyush Yadav To: Miquel Raynal , Richard Weinberger , Vignesh Raghavendra , Rob Herring , Mark Brown , Pratyush Yadav , , , , CC: Nishanth Menon , Michael Walle , Tudor Ambarus Subject: [PATCH 2/2] dt-bindings: mtd: spi-nor: Add a reference to spi-slave-props.yaml Date: Wed, 9 Jun 2021 16:47:07 +0530 Message-ID: <20210609111707.9555-3-p.yadav@ti.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210609111707.9555-1-p.yadav@ti.com> References: <20210609111707.9555-1-p.yadav@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210609_041724_432818_F8991E62 X-CRM114-Status: GOOD ( 13.16 ) X-Spam-Score: -2.7 (--) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: The spi-slave-props.yaml schema contains slave-specific properties for SPI controllers that should be present in the slave node. Add a reference to that so its constraints are followed. additionalProperties: false cannot be used since it marks the controller properties as unknown. Use unevaluatedProperties: false instead. This has the side effect of allowing extra properties that are [...] Content analysis details: (-2.7 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [198.47.19.141 listed in list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 0.0 RCVD_IN_MSPIKE_H4 RBL: Very Good reputation (+4) [198.47.19.141 listed in wl.mailspike.net] -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.0 RCVD_IN_MSPIKE_WL Mailspike good senders -0.3 DKIMWL_WL_HIGH DKIMwl.org - High trust sender X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-mtd" Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org The spi-slave-props.yaml schema contains slave-specific properties for SPI controllers that should be present in the slave node. Add a reference to that so its constraints are followed. additionalProperties: false cannot be used since it marks the controller properties as unknown. Use unevaluatedProperties: false instead. This has the side effect of allowing extra properties that are not specified in the schema. The alternative is to list all the controller properties in this schema but that would mean every slave binding would have to repeat the same set of properties for each controller. Signed-off-by: Pratyush Yadav --- Documentation/devicetree/bindings/mtd/jedec,spi-nor.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/mtd/jedec,spi-nor.yaml b/Documentation/devicetree/bindings/mtd/jedec,spi-nor.yaml index ed590d7c6e37..e69a8fbb91f1 100644 --- a/Documentation/devicetree/bindings/mtd/jedec,spi-nor.yaml +++ b/Documentation/devicetree/bindings/mtd/jedec,spi-nor.yaml @@ -11,6 +11,7 @@ maintainers: allOf: - $ref: "mtd.yaml#" + - $ref: /schemas/spi/spi-slave-props.yaml# properties: compatible: @@ -88,7 +89,7 @@ patternProperties: "^otp(-[0-9]+)?$": type: object -additionalProperties: false +unevaluatedProperties: false examples: - |