From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pj1-f42.google.com (mail-pj1-f42.google.com [209.85.216.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 005A3146D5A for ; Sat, 15 Aug 2026 21:50:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.42 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786830635; cv=none; b=b/HnNqclBJIVz1ByESxOCjKUaO+CCSa/7IEL0zPc2e6qUcXn2h2P8UGSMMSr2Qly7iNM15ZJuaajsI3zIXCwTWBKWvcEqF7whGqF20ar304S0CbBEsAdYwxENzObmxnOaUM21upUxbLTcoiawRDhJWd2DwG/wFPB15gBaOQGpWA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786830635; c=relaxed/simple; bh=55tNRnilXGUpfBe40ZOG32nJPAfFrWCC6SLA0JdnEME=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=XcjbkhiYmfaOgg5Os7ST1JiPZHMQxOFoi7sOJuTODvt1quYTeyfOrS79EHj6tJyr+zKgKmpCwcXNYH1XS6Pf3gCdaIYPrdVlUA1bI8Rou7XPvgeTxfrgAlsP5iPJSkJrPZOh9vb2ZKCXT7WpjQpqSqlI2wkM3/euHhF7N0Od5Ck= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=grrEP04D; arc=none smtp.client-ip=209.85.216.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="grrEP04D" Received: by mail-pj1-f42.google.com with SMTP id 98e67ed59e1d1-38115bbb83dso222480a91.3 for ; Sat, 15 Aug 2026 14:50:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1786830631; x=1787435431; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=RRTi+2XfPP4e/3o2uPviWSe0YdqRzssbdRkwWqs+fb4=; b=grrEP04D0SFD/giFhldu8hCLxAocNWV4T10+xeB8xYPxfouz+CFVwWc5qiqZWcYrEv /cqnxXrZIfe1QVK0FAZ6Jd9NmWU7efCXF0TTFFjVcyKDeU+duWZCN3x7ZFi8nhS9IKM3 AnSQv7coxt35klB3d4aypI6VEhDE3Wq+5py51WXBcavfsmR3JB/TA3CxKJwYWkTd4xjE j7xRzDUL1TCcmznOQvnwlATrJ6VLCIUnei5L8mZ3kquhDqiA6XVOxrresGvWFogpnag6 TyPB+dia0hYLe0nANQcd7DpJozolOk8xBwLkC7k2wnjUDamrirSXgJtFrE8QS5XIklec WRGA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1786830631; x=1787435431; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=RRTi+2XfPP4e/3o2uPviWSe0YdqRzssbdRkwWqs+fb4=; b=ScowYAN72iFL5xsSsjwAAMIvsN3mNeKBUp7ztKSquuPNtbmGZ8PZ39HLL1Afcq9o8F NEyzqp8sU/UpCqym4uxO8+yI8ZTVo8SZbKMQ3FE2gpy+x6M1NIXVEoXhNkBQX1892KKT Q6LEwAoy2lLXs6iaoBDJMb5+q1D3+2NEaaIezBrrAajdDNxxwsHji9fQQKiHmlaC2+cu AmohuIr0vMMiv5gCaNHGPiZ4YE/HdUInaue37CdrV/aNUJmQLZMUktSCrpdk8VXzcfKo Mto+k3lbtlouiDc/SOMQvWOLKR6pXyg90vRCVlbj3ZfbWPZ9Ycr9UNTaXc77obNRxapR Zawg== X-Forwarded-Encrypted: i=1; AHgh+RrpivBskM60prULIZXjnIHF1MathMpK+9tBdqt7K7kbVbad1vTcQQ+rQBQOxRSYwJwaUzINQsI8KBN/@vger.kernel.org X-Gm-Message-State: AOJu0YzFEonFIpBwwMW/+muMxquJ/1IWRYlhRyZq9XoNOes3HWsqJuZi guy/PBUoOXPI1ODZcGJnK6W6pjqvTSloSFga9ra1EX1IwFLYU91Y7+JQ X-Gm-Gg: AR+sD12TXYcS9NLVpgwosfXcnVPexLFu7+/bVlzDfU+zm83Q5lQhIk+ZAGB5xvCERI2 ZVWGolRc5NX+wDzCfiabhlZ8dZgDQz8QXR7W1xyzHhKgtRXeD0i7J+aX9iDbz7busE1BkNPlgkQ +CnrQuYV2hbltpFRqHhvvTwmxTyThE2Ht1Zp3z08Kxf/SoQhqm3n0FTPA7Ym8Z8oT2Usuts8I8p M6/+ToMfQLxhTV3R1h6rNDZcj5BpiS4cuk/G/3bRx5LlmGCbFIhUYJw7+28qxbyzkYbcmng6zvw 27L7CWk63VIINIjZNLt7dUv9hTLb5SqjSU58XX/Jo3EfSywSKfmfAdM7dvsQCygOceYcpQeZVul v2iuBSDWhlrNAz1hHZBSMf26GWon9vpiFWe8+Q8/ve5f47z3DBDOcONPD6tk7R26kM4hpcg2rB4 c6H5HbLoua15IdPpz1mrOqki1z+TivSjMO7RZmXaFDAJYF4NPnkdEtARuUk+HRnRHrqPNvY4xLs GqcSdUC36gWY+hDQ0rE27w= X-Received: by 2002:a17:90b:4c87:b0:38e:549:9e04 with SMTP id 98e67ed59e1d1-3933b7d1d85mr11505275a91.1.1786830631002; Sat, 15 Aug 2026 14:50:31 -0700 (PDT) Received: from [10.112.173.252] ([2409:40c2:505d:7e1:7f19:edf4:38f3:dccf]) by smtp.gmail.com with ESMTPSA id a92af1059eb24-141388b2554sm33541829c88.14.2026.08.15.14.50.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 15 Aug 2026 14:50:30 -0700 (PDT) From: Bhargav Joshi Date: Sun, 16 Aug 2026 03:19:32 +0530 Subject: [PATCH 2/2] dt-bindings: spi: ti,davinci-spi: convert to DT schema Precedence: bulk X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20260816-ti-davinci-spi-v1-2-a7f57dfd5262@gmail.com> References: <20260816-ti-davinci-spi-v1-0-a7f57dfd5262@gmail.com> In-Reply-To: <20260816-ti-davinci-spi-v1-0-a7f57dfd5262@gmail.com> To: Mark Brown , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Bartosz Golaszewski , Nishanth Menon , Santosh Shilimkar Cc: linux-spi@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, goledhruva@gmail.com, m-chawdhry@ti.com, daniel.baluta@gmail.com, simona.toaca@nxp.com, j.bhargav.u@gmail.com X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1786830590; l=9738; i=j.bhargav.u@gmail.com; h=from:subject:message-id; bh=55tNRnilXGUpfBe40ZOG32nJPAfFrWCC6SLA0JdnEME=; b=Sm05bewC87sUqORgXy+/OaVlBGt+UhxbSF0u2lvPauwoxS1kKgyi5NuuxaP49AaoWlSYOImTA 1BbK5JtNUwrATY8dZsexV8fjm3BvFgMutbbu0Yousz6H6Zv3AJlvofF X-Developer-Key: i=j.bhargav.u@gmail.com; a=ed25519; pk=IqNDwUZKECEA+n8wXctFLBbYL9NhFstZNbOznm/nX1k= Convert the TI DaVinci/Keystone SPI controller binding from text format to DT schema. Changes during the conversion: - Create a separate ti,davinci-spi-peripheral-props.yaml schema to properly define the ti,spi-wdelay peripheral property. - Add missing dmas and dma-names properties. - Add constraints to ti,spi-wdelay based on the 6-bit width of the SPIFMTn.WDELAY hardware register field. - Add constraints to num-cs based on the maximum hardware chip selects available on the DA850 SoC. Signed-off-by: Bhargav Joshi --- .../devicetree/bindings/spi/spi-davinci.txt | 100 ----------------- .../bindings/spi/spi-peripheral-props.yaml | 1 + .../spi/ti,davinci-spi-peripheral-props.yaml | 25 +++++ .../devicetree/bindings/spi/ti,davinci-spi.yaml | 118 +++++++++++++++++++++ 4 files changed, 144 insertions(+), 100 deletions(-) diff --git a/Documentation/devicetree/bindings/spi/spi-davinci.txt b/Documentation/devicetree/bindings/spi/spi-davinci.txt deleted file mode 100644 index f012888656ec..000000000000 --- a/Documentation/devicetree/bindings/spi/spi-davinci.txt +++ /dev/null @@ -1,100 +0,0 @@ -Davinci SPI controller device bindings - -Links on DM: -Keystone 2 - https://www.ti.com/lit/ug/sprugp2a/sprugp2a.pdf -dm644x - https://www.ti.com/lit/ug/sprue32a/sprue32a.pdf -OMAP-L138/da830 - http://www.ti.com/lit/ug/spruh77a/spruh77a.pdf - -Required properties: -- #address-cells: number of cells required to define a chip select - address on the SPI bus. Should be set to 1. -- #size-cells: should be zero. -- compatible: - - "ti,dm6441-spi" for SPI used similar to that on DM644x SoC family - - "ti,da830-spi" for SPI used similar to that on DA8xx SoC family - - "ti,keystone-spi" for SPI used similar to that on Keystone2 SoC - family -- reg: Offset and length of SPI controller register space -- num-cs: Number of chip selects. This includes internal as well as - GPIO chip selects. -- ti,davinci-spi-intr-line: interrupt line used to connect the SPI - IP to the interrupt controller within the SoC. Possible values - are 0 and 1. Manual says one of the two possible interrupt - lines can be tied to the interrupt controller. Set this - based on a specific SoC configuration. -- interrupts: interrupt number mapped to CPU. -- clocks: spi clk phandle - For 66AK2G this property should be set per binding, - Documentation/devicetree/bindings/clock/ti,sci-clk.yaml - -SoC-specific Required Properties: - -The following are mandatory properties for Keystone 2 66AK2G SoCs only: - -- power-domains: Should contain a phandle to a PM domain provider node - and an args specifier containing the SPI device id - value. This property is as per the binding, - -Optional: -- cs-gpios: gpio chip selects - For example to have 3 internal CS and 2 GPIO CS, user could define - cs-gpios = <0>, <0>, <0>, <&gpio1 30 0>, <&gpio1 31 0>; - where first three are internal CS and last two are GPIO CS. - -Optional properties for slave devices: -SPI slave nodes can contain the following properties. -Not all SPI Peripherals from Texas Instruments support this. -Please check SPI peripheral documentation for a device before using these. - -- ti,spi-wdelay : delay between transmission of words - (SPIFMTn.WDELAY, SPIDAT1.WDEL) must be specified in number of SPI module - clock periods. - - delay = WDELAY * SPI_module_clock_period + 2 * SPI_module_clock_period - -Below is timing diagram which shows functional meaning of -"ti,spi-wdelay" parameter. - - +-+ +-+ +-+ +-+ +-+ +-+ +-+ +-+ -SPI_CLK | | | | | | | | | | | | | | | | - +----------+ +-+ +-+ +-+ +-+ +---------------------------+ +-+ +-+ +- - -SPI_SOMI/SIMO+-----------------+ +----------- - +----------+ word1 +---------------------------+word2 - +-----------------+ +----------- - WDELAY - <--------------------------> - -Example of a NOR flash slave device (n25q032) connected to DaVinci -SPI controller device over the SPI bus. - -spi0:spi@20bf0000 { - #address-cells = <1>; - #size-cells = <0>; - compatible = "ti,dm6446-spi"; - reg = <0x20BF0000 0x1000>; - num-cs = <4>; - ti,davinci-spi-intr-line = <0>; - interrupts = <338>; - clocks = <&clkspi>; - - flash: flash@0 { - #address-cells = <1>; - #size-cells = <1>; - compatible = "st,m25p32"; - spi-max-frequency = <25000000>; - reg = <0>; - ti,spi-wdelay = <8>; - - partition@0 { - label = "u-boot-spl"; - reg = <0x0 0x80000>; - read-only; - }; - - partition@1 { - label = "test"; - reg = <0x80000 0x380000>; - }; - }; -}; diff --git a/Documentation/devicetree/bindings/spi/spi-peripheral-props.yaml b/Documentation/devicetree/bindings/spi/spi-peripheral-props.yaml index 880a9f624566..cb5d608998e1 100644 --- a/Documentation/devicetree/bindings/spi/spi-peripheral-props.yaml +++ b/Documentation/devicetree/bindings/spi/spi-peripheral-props.yaml @@ -155,5 +155,6 @@ allOf: - $ref: fsl,dspi-peripheral-props.yaml# - $ref: samsung,spi-peripheral-props.yaml# - $ref: nvidia,tegra210-quad-peripheral-props.yaml# + - $ref: ti,davinci-spi-peripheral-props.yaml# additionalProperties: true diff --git a/Documentation/devicetree/bindings/spi/ti,davinci-spi-peripheral-props.yaml b/Documentation/devicetree/bindings/spi/ti,davinci-spi-peripheral-props.yaml new file mode 100644 index 000000000000..1060f176c6cb --- /dev/null +++ b/Documentation/devicetree/bindings/spi/ti,davinci-spi-peripheral-props.yaml @@ -0,0 +1,25 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/spi/ti,davinci-spi-peripheral-props.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: TI DaVinci/Keystone SPI Peripheral Properties + +maintainers: + - Bartosz Golaszewski + +description: + Peripheral-specific properties for SPI devices attached to a TI + DaVinci/Keystone SPI controller. + +properties: + ti,spi-wdelay: + $ref: /schemas/types.yaml#/definitions/uint32 + minimum: 0 + maximum: 63 + description: + delay between transmission of words (SPIFMTn.WDELAY, SPIDAT1.WDEL) + must be specified in number of SPI module clock periods. + +additionalProperties: true diff --git a/Documentation/devicetree/bindings/spi/ti,davinci-spi.yaml b/Documentation/devicetree/bindings/spi/ti,davinci-spi.yaml new file mode 100644 index 000000000000..81014e963909 --- /dev/null +++ b/Documentation/devicetree/bindings/spi/ti,davinci-spi.yaml @@ -0,0 +1,118 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/spi/ti,davinci-spi.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: TI DaVinci/Keystone SPI Controller + +maintainers: + - Bartosz Golaszewski + +properties: + compatible: + oneOf: + - enum: + - ti,da830-spi + - ti,keystone-spi + - items: + - const: ti,keystone-spi + - const: ti,dm6441-spi + + reg: + maxItems: 1 + + interrupts: + maxItems: 1 + + clocks: + maxItems: 1 + + power-domains: + maxItems: 1 + description: + Should contain a phandle to a PM domain provider node + and an args specifier containing the SPI device id + value. + + num-cs: + minimum: 1 + maximum: 6 + default: 1 + description: + Number of chip selects supported by the controller. This + includes both internal and GPIO chip selects. + + ti,davinci-spi-intr-line: + $ref: /schemas/types.yaml#/definitions/uint32 + enum: [0, 1] + description: + Interrupt line used to connect the SPI IP to the interrupt + controller within the SoC. The SPI peripheral can route its + interrupt output to one of two lines (INT0 or INT1). Set + this based on the SoC-specific wiring to the interrupt + controller. + + dmas: + items: + - description: RX DMA channel + - description: TX DMA channel + + dma-names: + items: + - const: rx + - const: tx + +required: + - compatible + - reg + - interrupts + - clocks + - ti,davinci-spi-intr-line + +allOf: + - $ref: spi-controller.yaml# + - if: + properties: + compatible: + const: ti,keystone-spi + then: + required: + - power-domains + +unevaluatedProperties: false + +examples: + - | + spi@20bf0000 { + compatible = "ti,keystone-spi","ti,dm6441-spi"; + reg = <0x20bf0000 0x1000>; + num-cs = <4>; + ti,davinci-spi-intr-line = <0>; + interrupts = <338>; + clocks = <&clkspi>; + #address-cells = <1>; + #size-cells = <0>; + + flash@0 { + compatible = "jedec,spi-nor"; + spi-max-frequency = <25000000>; + reg = <0>; + ti,spi-wdelay = <8>; + }; + }; + + - | + spi@41000 { + compatible = "ti,da830-spi"; + reg = <0x41000 0x1000>; + num-cs = <6>; + ti,davinci-spi-intr-line = <1>; + interrupts = <20>; + dmas = <&edma0 14 0>, <&edma0 15 0>; + dma-names = "rx", "tx"; + clocks = <&psc0 4>; + power-domains = <&psc0 4>; + #address-cells = <1>; + #size-cells = <0>; + }; -- 2.55.0