Skip to content

Commit 53b6445

Browse files
Jakob Unterwurzachermmind
authored andcommitted
arm64: dts: rockchip: use cs-gpios for spi1 on ringneck
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: c484cf9 ("arm64: dts: rockchip: add PX30-µQ7 (Ringneck) SoM with Haikou baseboard") Cc: [email protected] Reviewed-by: Quentin Schulz <[email protected]> Signed-off-by: Jakob Unterwurzacher <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Heiko Stuebner <[email protected]>
1 parent c76bcc7 commit 53b6445

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

arch/arm64/boot/dts/rockchip/px30-ringneck.dtsi

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -379,6 +379,18 @@
379379
<0 RK_PA7 RK_FUNC_GPIO &pcfg_pull_up>;
380380
};
381381
};
382+
383+
spi1 {
384+
spi1_csn0_gpio_pin: spi1-csn0-gpio-pin {
385+
rockchip,pins =
386+
<3 RK_PB1 RK_FUNC_GPIO &pcfg_pull_up_4ma>;
387+
};
388+
389+
spi1_csn1_gpio_pin: spi1-csn1-gpio-pin {
390+
rockchip,pins =
391+
<3 RK_PB2 RK_FUNC_GPIO &pcfg_pull_up_4ma>;
392+
};
393+
};
382394
};
383395

384396
&pmu_io_domains {
@@ -396,6 +408,17 @@
396408
vqmmc-supply = <&vccio_sd>;
397409
};
398410

411+
&spi1 {
412+
/*
413+
* Hardware CS has a very slow rise time of about 6us,
414+
* causing transmission errors.
415+
* With cs-gpios we have a rise time of about 20ns.
416+
*/
417+
cs-gpios = <&gpio3 RK_PB1 GPIO_ACTIVE_LOW>, <&gpio3 RK_PB2 GPIO_ACTIVE_LOW>;
418+
pinctrl-names = "default";
419+
pinctrl-0 = <&spi1_clk &spi1_csn0_gpio_pin &spi1_csn1_gpio_pin &spi1_miso &spi1_mosi>;
420+
};
421+
399422
&tsadc {
400423
status = "okay";
401424
};

0 commit comments

Comments
 (0)