From: Heiko Stuebner <heiko@sntech.de>
To: Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
Quentin Schulz <quentin.schulz@cherry.de>,
Jakob Unterwurzacher <jakob.unterwurzacher@cherry.de>,
Lukasz Czechowski <lukasz.czechowski@thaumatec.com>,
Dragan Simic <dsimic@manjaro.org>,
Diederik de Haas <didi.debian@cknow.org>,
Farouk Bouabid <farouk.bouabid@cherry.de>,
Johan Jonker <jbx6244@gmail.com>,
Jakob Unterwurzacher <jakobunt@gmail.com>
Cc: stable@vger.kernel.org, Heiko Stuebner <heiko.stuebner@cherry.de>,
devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] arm64: dts: rockchip: use cs-gpios for spi1 on ringneck
Date: Mon, 23 Jun 2025 11:49:26 +0200 [thread overview]
Message-ID: <1925003.tdWV9SEqCh@phil> (raw)
In-Reply-To: <20250620113549.2900285-1-jakob.unterwurzacher@cherry.de>
Hi Jakob,
Am Freitag, 20. Juni 2025, 13:35:46 Mitteleuropäische Sommerzeit schrieb Jakob Unterwurzacher:
> From: Jakob Unterwurzacher <jakob.unterwurzacher@cherry.de>
>
> Hardware CS has a very slow rise time of about 6us,
> causing transmission errors when CS does not reach
> high between transaction.
>
> It looks like it's not driven actively when transitioning
> from low to high but switched to input, so only the CPU
> pull-up pulls it high, slowly. Transitions from high to low
> are fast. On the oscilloscope, CS looks like an irregular sawtooth
> pattern like this:
> _____
> ^ / |
> ^ /| / |
> /| / | / |
> / | / | / |
> ___/ |___/ |_____/ |___
>
> With cs-gpios we have a CS rise time of about 20ns, as it should be,
> and CS looks rectangular.
>
> This fixes the data errors when running a flashcp loop against a
> m25p40 spi flash.
>
> With the Rockchip 6.1 kernel we see the same slow rise time, but
> for some reason CS is always high for long enough to reach a solid
> high.
>
> The RK3399 and RK3588 SoCs use the same SPI driver, so we also
> checked our "Puma" (RK3399) and "Tiger" (RK3588) boards.
> They do not have this problem. Hardware CS rise time is good.
>
> Fixes: c484cf93f61b ("arm64: dts: rockchip: add PX30-µQ7 (Ringneck) SoM with Haikou baseboard")
> Cc: stable@vger.kernel.org
> Reviewed-by: Quentin Schulz <quentin.schulz@cherry.de>
> Signed-off-by: Jakob Unterwurzacher <jakob.unterwurzacher@cherry.de>
> ---
> .../boot/dts/rockchip/px30-ringneck.dtsi | 22 +++++++++++++++++++
> 1 file changed, 22 insertions(+)
>
> diff --git a/arch/arm64/boot/dts/rockchip/px30-ringneck.dtsi b/arch/arm64/boot/dts/rockchip/px30-ringneck.dtsi
> index ab232e5c7ad6..dcc62dd9b894 100644
> --- a/arch/arm64/boot/dts/rockchip/px30-ringneck.dtsi
> +++ b/arch/arm64/boot/dts/rockchip/px30-ringneck.dtsi
> @@ -379,6 +379,18 @@ pmic_int: pmic-int {
> <0 RK_PA7 RK_FUNC_GPIO &pcfg_pull_up>;
> };
> };
> +
> + spi1 {
> + spi1_csn0_gpio: spi1-csn0-gpio {
> + rockchip,pins =
> + <3 RK_PB1 RK_FUNC_GPIO &pcfg_pull_up_4ma>;
> + };
> +
> + spi1_csn1_gpio: spi1-csn1-gpio {
naming the node -gpio trigger the bot, I guess a better name would
be something with -pin at the end instead.
> +&spi1 {
> + /*
> + * Hardware CS has a very slow rise time of about 6us,
> + * causing transmission errors.
> + * With cs-gpios we have a rise time of about 20ns.
> + */
> + cs-gpios = <&gpio3 RK_PB1 GPIO_ACTIVE_LOW>, <&gpio3 RK_PB2 GPIO_ACTIVE_LOW>;
please also provide a
pinctrl-names = "default"
here.
It feels more futur proof when overriding the pinctrl-0 entry
to also state we only expect that one.
> + pinctrl-0 = <&spi1_clk &spi1_csn0_gpio &spi1_csn1_gpio &spi1_miso &spi1_mosi>;
> +};
> +
> &tsadc {
> status = "okay";
> };
>
prev parent reply other threads:[~2025-06-23 9:49 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-20 11:35 [PATCH] arm64: dts: rockchip: use cs-gpios for spi1 on ringneck Jakob Unterwurzacher
2025-06-23 2:39 ` Rob Herring (Arm)
2025-06-23 9:49 ` Heiko Stuebner [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1925003.tdWV9SEqCh@phil \
--to=heiko@sntech.de \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=didi.debian@cknow.org \
--cc=dsimic@manjaro.org \
--cc=farouk.bouabid@cherry.de \
--cc=heiko.stuebner@cherry.de \
--cc=jakob.unterwurzacher@cherry.de \
--cc=jakobunt@gmail.com \
--cc=jbx6244@gmail.com \
--cc=krzk+dt@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rockchip@lists.infradead.org \
--cc=lukasz.czechowski@thaumatec.com \
--cc=quentin.schulz@cherry.de \
--cc=robh@kernel.org \
--cc=stable@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox