Message ID | 20221004-up-aml-fix-spi-v4-0-0342d8e10c49@baylibre.com |
---|---|
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4242:0:0:0:0:0 with SMTP id s2csp705683wrr; Fri, 21 Oct 2022 06:44:55 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7w8nnWWtnGh4IEXIvdp7gXR1M+M9vjRsLluHFVUvTehMdYl2Uk6EuFnUUIT56Jk1m0dBxE X-Received: by 2002:a17:90b:1c8c:b0:203:89fb:ba79 with SMTP id oo12-20020a17090b1c8c00b0020389fbba79mr58027316pjb.92.1666359894984; Fri, 21 Oct 2022 06:44:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666359894; cv=none; d=google.com; s=arc-20160816; b=Il3lB8GGpnRswnsOWdzKt02Rcyu4HN7EOCa3U1W2L+gl7youx6vSAPziEHRwDocQPC Mfvjs4b/0ojOzMU/Ba605OcRO9tFDBcOf2ABCBm4njFVi/yo9p4Kh1vXHPVThUFQxXQO UOLsLSmm01HWrUhf1VUwwIbP70+jz2aJuPJPlNulqdRk0yq+iiHuhsb0zdP4g7XBT7xP T8QJ4QkAagV7XaT2VZgViJdTMkCC46sR1BCHNDev21X24Vt4ALCtFiRdNT4wRkACCSm/ 0XJevOn93+37Djyowreha6gnGxUhsT9TpLyMHwik4iSxSCj9dI/abOH/QOEEnd4zKoF8 Z7Ow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:message-id:date:from :content-transfer-encoding:mime-version:subject:dkim-signature; bh=i1C8rgUAGHf+jLqpE/CuMvEaAQwxa6V5+hxBqPwgUl4=; b=oOIiLsma+bPNn71eFfit6TVmGwzCHTb3wOFfdcLLXIqVPXn2DOGPCj8tL4gnVYNvKe 2ZTGq9j6JZ3AN8GYf3jYtbTSAu15nByZIhIcYFcdU+v4Ok52pHSFZFxqTaC5ZobkXA9T 8VF/lVZRWbisFd8xDVILSSC4KY1JXobEFslflkYY68X/S2wA5kSYWEF1b+K2EyTtx2aQ EBeJ+HRMFfg+vwpzTK+piZJ6mUCZA7rV5chzhYwgysEIA2CxdE+IgJWryykfEE0yvG8D ArlXQVJglMpa7ZvomeHoDzDE4MGpMhp8H/eWI9d6cKLM+s690wLk5Svs+X/fBzGShfEY dg+Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20210112.gappssmtp.com header.s=20210112 header.b=VT5D5asW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b1-20020a056a000a8100b0052ee88f59c4si26727740pfl.372.2022.10.21.06.44.42; Fri, 21 Oct 2022 06:44:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@baylibre-com.20210112.gappssmtp.com header.s=20210112 header.b=VT5D5asW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230523AbiJUNbs (ORCPT <rfc822;pwkd43@gmail.com> + 99 others); Fri, 21 Oct 2022 09:31:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44898 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230252AbiJUNbm (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Fri, 21 Oct 2022 09:31:42 -0400 Received: from mail-wr1-x434.google.com (mail-wr1-x434.google.com [IPv6:2a00:1450:4864:20::434]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 11BB42639DF for <linux-kernel@vger.kernel.org>; Fri, 21 Oct 2022 06:31:38 -0700 (PDT) Received: by mail-wr1-x434.google.com with SMTP id bp11so4539963wrb.9 for <linux-kernel@vger.kernel.org>; Fri, 21 Oct 2022 06:31:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20210112.gappssmtp.com; s=20210112; h=cc:to:message-id:date:from:content-transfer-encoding:mime-version :subject:from:to:cc:subject:date:message-id:reply-to; bh=i1C8rgUAGHf+jLqpE/CuMvEaAQwxa6V5+hxBqPwgUl4=; b=VT5D5asWne9UXufhJlAhGa0EmSt5P0Hw6devsJJzR8+iofV3cA2BWJNKGMuFsN4Fqm IcxrUgNFDdlniCIrLtHcj2X/aWeccarjVBhWGNRF3+ZiX7UCWzjuHQyC02aq8LPYOsjf ZGE5hxa5G71mBHwZUBvVV25OqgTXv3Yl7zKW1SvuSkCQkS8PDUL2OHPIPe0rSDBHGiPW O1dVAsqXIH9brG0AsAHQtaPtvqepSVJIynaIH37rTakT/6U2fYRn8zm/EVqYCqt5dvsy siz+j4NbG8YUcKTzJjdaKZy4VDS/2VZdm7wyi+JVA7TSqXvRln6ioq+sJKYjgN+DqxRi h3bQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:message-id:date:from:content-transfer-encoding:mime-version :subject:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=i1C8rgUAGHf+jLqpE/CuMvEaAQwxa6V5+hxBqPwgUl4=; b=od05JDWm3sxvG744k5GWbDs479tWUPtBbdq9bdVHc5s90z9XPwTJw3+XPVwOn2nUYr VvmjCHTLjD98eDUlXncOBGBJa3dwZeFaxe7OwuMnDbhTOlFdFruIuBDgrRWbO2yDaH1C /4JxBmXk9DYd0HYtr4mcF+g9ONe+jG+0+Y7OBzpdg9GkXZgViPkAp8DXQkaWNsvSMv8k LGSVmuwn+j8U5C0VWXuVTO9gjtYUBRZ/fYUG3vuAgmLRN47Rsv6sU8rBqeUyw7peIjtw XKjaPTlwvcePD/KDMF/05sRoi24SnlxU0HFnk71M+ZeVieIQoremtRZNVAaOnS9tmwj1 ox9Q== X-Gm-Message-State: ACrzQf37BDQvHbxL7pDNBYl4UZXa05sTnCWP+uqA/5ZNwkbqonAcqFVj +2BqPuZhboyZlmWj/eBTENLaZw== X-Received: by 2002:a5d:5983:0:b0:22e:bb12:7041 with SMTP id n3-20020a5d5983000000b0022ebb127041mr12385502wri.645.1666359096510; Fri, 21 Oct 2022 06:31:36 -0700 (PDT) Received: from [127.0.1.1] (210.145.15.109.rev.sfr.net. [109.15.145.210]) by smtp.googlemail.com with ESMTPSA id j8-20020a05600c1c0800b003c6b7f5567csm10325280wms.0.2022.10.21.06.31.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Oct 2022 06:31:35 -0700 (PDT) Subject: [PATCH v4 0/4] spi: amlogic: meson-spicc: Use pinctrl to drive CLK line when idle MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit X-b4-tracking: H4sIACyfUmMC/33NTQrCMBAF4KuUrB1JJrU/rryHuEjSqR2IbUlssJTe3eBS0NXwHrxvNhEpMEVxLj YRKHHkacyhPBTCDWa8E3CXs0CJqKQsYZnBPDz0/II4Mzi0tqa6oUpqkUfWRAIbzOiGPBsX73M5cHxO Yf08SZjP9aeXECRoagy1yqgWTxdrVs820NFND3HLWtL/BZ2Fpu1IYdV3qtJfwr7vb0sgc/P2AAAA From: Amjad Ouled-Ameur <aouledameur@baylibre.com> Date: Fri, 21 Oct 2022 15:31:24 +0200 Message-Id: <20221004-up-aml-fix-spi-v4-0-0342d8e10c49@baylibre.com> To: Kevin Hilman <khilman@baylibre.com>, Jerome Brunet <jbrunet@baylibre.com>, Rob Herring <robh+dt@kernel.org>, Martin Blumenstingl <martin.blumenstingl@googlemail.com>, Neil Armstrong <neil.armstrong@linaro.org>, Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>, Mark Brown <broonie@kernel.org> Cc: linux-amlogic@lists.infradead.org, Neil Armstrong <neil.armstrong@linaro.org>, Amjad Ouled-Ameur <aouledameur@baylibre.com>, Da Xue <da@libre.computer>, linux-spi@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org X-Mailer: b4 0.10.1 X-Developer-Signature: v=1; a=ed25519-sha256; t=1666359095; l=1850; i=aouledameur@baylibre.com; s=20220920; h=from:subject:message-id; bh=uh9b1V5lppXzVxalMWZveFXtfZNKXVHWr9osZJQJmd8=; b=0swTXrE+WS10AzArr7fM6CGstAbhVRX7nQSIOVPrQrbIfFk9podLHQ5iJt+C/00Nj7XVBVPwvjaG BSHMkaSkDAQUMKq8yDVgWMXnURoaBsPi/EI1jLcB/9/tmwrPLfas X-Developer-Key: i=aouledameur@baylibre.com; a=ed25519; pk=HgYWawSL4qLGPx+RzJ+Cuu+V8Pi/KQnDDm1wjWPMOFE= X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747304993077257156?= X-GMAIL-MSGID: =?utf-8?q?1747304993077257156?= |
Series |
spi: amlogic: meson-spicc: Use pinctrl to drive CLK line when idle
|
|
Message
Amjad Ouled-Ameur
Oct. 21, 2022, 1:31 p.m. UTC
Between SPI transactions, all SPI pins are in HiZ state. When using the SS
signal from the SPICC controller it's not an issue because when the
transaction resumes all pins come back to the right state at the same time
as SS.
The problem is when we use CS as a GPIO. In fact, between the GPIO CS
state change and SPI pins state change from idle, you can have a missing or
spurious clock transition.
Set a bias on the clock depending on the clock polarity requested before CS
goes active, by passing a special "idle-low" and "idle-high" pinctrl state
and setting the right state at a start of a message.
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>
---
Changes in v4:
- Fixed documentation by defining pinctrl-x.
- Link to v3: https://lore.kernel.org/r/20221004-up-aml-fix-spi-v3-0-89de126fd163@baylibre.com
Changes in v3:
- Fixed documentation by removing pinctrl states as they are not mandatory.
- Link to v2: https://lore.kernel.org/r/20221004-up-aml-fix-spi-v2-0-3e8ae91a1925@baylibre.com
---
Amjad Ouled-Ameur (4):
spi: dt-bindings: amlogic, meson-gx-spicc: Add pinctrl names for SPI signal states
spi: meson-spicc: Use pinctrl to drive CLK line when idle
arm64: dts: meson-gxl: add SPI pinctrl nodes for CLK
arm64: dts: meson-gxbb: add SPI pinctrl nodes for CLK
.../bindings/spi/amlogic,meson-gx-spicc.yaml | 75 ++++++++++++++--------
arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi | 14 ++++
arch/arm64/boot/dts/amlogic/meson-gxl.dtsi | 14 ++++
drivers/spi/spi-meson-spicc.c | 39 ++++++++++-
4 files changed, 113 insertions(+), 29 deletions(-)
---
base-commit: e35184f321518acadb681928a016da21a9a20c13
change-id: 20221004-up-aml-fix-spi-c2bb7e78e603
Best regards,
Comments
On Fri, 21 Oct 2022 15:31:24 +0200, Amjad Ouled-Ameur wrote: > Between SPI transactions, all SPI pins are in HiZ state. When using the SS > signal from the SPICC controller it's not an issue because when the > transaction resumes all pins come back to the right state at the same time > as SS. > > The problem is when we use CS as a GPIO. In fact, between the GPIO CS > state change and SPI pins state change from idle, you can have a missing or > spurious clock transition. > > [...] Applied to https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git for-next Thanks! [1/4] spi: dt-bindings: amlogic, meson-gx-spicc: Add pinctrl names for SPI signal states commit: 031837826886e254fefff7d8b849dc63b6a7e2b9 [2/4] spi: meson-spicc: Use pinctrl to drive CLK line when idle commit: f4567b28fdd4bede7cab0810200d567a1f03ec5e All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted. You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed. If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced. Please add any relevant lists and maintainers to the CCs when replying to this mail. Thanks, Mark
Hi, On Fri, 21 Oct 2022 15:31:24 +0200, Amjad Ouled-Ameur wrote: > Between SPI transactions, all SPI pins are in HiZ state. When using the SS > signal from the SPICC controller it's not an issue because when the > transaction resumes all pins come back to the right state at the same time > as SS. > > The problem is when we use CS as a GPIO. In fact, between the GPIO CS > state change and SPI pins state change from idle, you can have a missing or > spurious clock transition. > > [...] Thanks, Applied to https://git.kernel.org/pub/scm/linux/kernel/git/amlogic/linux.git (v6.2/arm64-dt) [3/4] arm64: dts: meson-gxl: add SPI pinctrl nodes for CLK https://git.kernel.org/amlogic/c/2ba370bb98b53b7565493083699d82da5ef2cec8 [4/4] arm64: dts: meson-gxbb: add SPI pinctrl nodes for CLK https://git.kernel.org/amlogic/c/ce759829b8fffac891780611b54a6be26a2d5a5f These changes has been applied on the intermediate git tree [1]. The v6.2/arm64-dt branch will then be sent via a formal Pull Request to the Linux SoC maintainers for inclusion in their intermediate git branches in order to be sent to Linus during the next merge window, or sooner if it's a set of fixes. In the cases of fixes, those will be merged in the current release candidate kernel and as soon they appear on the Linux master branch they will be backported to the previous Stable and Long-Stable kernels [2]. The intermediate git branches are merged daily in the linux-next tree [3], people are encouraged testing these pre-release kernels and report issues on the relevant mailing-lists. If problems are discovered on those changes, please submit a signed-off-by revert patch followed by a corrective changeset. [1] https://git.kernel.org/pub/scm/linux/kernel/git/amlogic/linux.git [2] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git [3] https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git