* [PATCH 0/2] arm64: dts: rockchip: NanoPi Zero2: enable PCIe, fix the microSD sample phase
@ 2026-12-05 21:45 ` Sylvain LE FLOCH via B4 Relay
0 siblings, 0 replies; 11+ messages in thread
From: Sylvain LE FLOCH via B4 Relay @ 2026-12-05 21:45 UTC (permalink / raw)
To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Heiko Stuebner,
Jonas Karlman
Cc: devicetree, linux-arm-kernel, linux-rockchip, linux-kernel,
Sylvain LE FLOCH
Two independent changes to the NanoPi Zero2's device tree. Both go in
rk3528-nanopi-zero2.dts rather than the shared rk3528-nanopi.dtsi: the
M.2 slot is the Zero2's own, and the sample phase depends on how the
board routes the microSD lines.
Patch 1 enables the PCIe controller for the M.2 Key-E slot.
Patch 2 sets the microSD's default sample phase to 270 degrees. When
tuning finds that every phase works, dw_mmc-rockchip falls back to the
default, 90 degrees from rk3528.dtsi, and at that phase reads fail on
this board.
Testing: two boards (RK3528A, 2 GB), one booting from microSD with an
empty M.2 slot, the other with an eMMC module and an RTL8822CE Wi-Fi
card in the slot, and two microSD cards (SanDisk Extreme and Samsung
EVO Plus, 32 GB). The tests ran on Linux 7.3.7 with the same nodes,
before the common NanoPi parts were split out. On for-next, the series
builds and passes CHECK_DTBS without a warning.
These patches were prepared with an AI coding assistant (Claude Code).
It read FriendlyElec's vendor device tree and the upstream device trees
of other RK3528 boards to find the PCIe pins, wrote the changes and
their descriptions, and wrote the diagnostic image that ran the read
tests. I ran the tests on my boards and reviewed the patches.
---
Sylvain LE FLOCH (2):
arm64: dts: rockchip: Enable PCIe for the M.2 slot on NanoPi Zero2
arm64: dts: rockchip: Fix the microSD's default sample phase on NanoPi Zero2
arch/arm64/boot/dts/rockchip/rk3528-nanopi-zero2.dts | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
---
base-commit: ef6427a0fcc86af4f434bc92b9d01fdc5c094e5c
change-id: 20261205-zero2-dts-1bd9fe9bb3be
Best regards,
--
Sylvain LE FLOCH <vantom@protonmail.ch>
_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip
^ permalink raw reply [flat|nested] 11+ messages in thread* [PATCH 0/2] arm64: dts: rockchip: NanoPi Zero2: enable PCIe, fix the microSD sample phase
@ 2026-12-05 21:45 ` Sylvain LE FLOCH via B4 Relay
0 siblings, 0 replies; 11+ messages in thread
From: Sylvain LE FLOCH via B4 Relay @ 2026-12-05 21:45 UTC (permalink / raw)
To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Heiko Stuebner,
Jonas Karlman
Cc: devicetree, linux-arm-kernel, linux-rockchip, linux-kernel,
Sylvain LE FLOCH
Two independent changes to the NanoPi Zero2's device tree. Both go in
rk3528-nanopi-zero2.dts rather than the shared rk3528-nanopi.dtsi: the
M.2 slot is the Zero2's own, and the sample phase depends on how the
board routes the microSD lines.
Patch 1 enables the PCIe controller for the M.2 Key-E slot.
Patch 2 sets the microSD's default sample phase to 270 degrees. When
tuning finds that every phase works, dw_mmc-rockchip falls back to the
default, 90 degrees from rk3528.dtsi, and at that phase reads fail on
this board.
Testing: two boards (RK3528A, 2 GB), one booting from microSD with an
empty M.2 slot, the other with an eMMC module and an RTL8822CE Wi-Fi
card in the slot, and two microSD cards (SanDisk Extreme and Samsung
EVO Plus, 32 GB). The tests ran on Linux 7.3.7 with the same nodes,
before the common NanoPi parts were split out. On for-next, the series
builds and passes CHECK_DTBS without a warning.
These patches were prepared with an AI coding assistant (Claude Code).
It read FriendlyElec's vendor device tree and the upstream device trees
of other RK3528 boards to find the PCIe pins, wrote the changes and
their descriptions, and wrote the diagnostic image that ran the read
tests. I ran the tests on my boards and reviewed the patches.
---
Sylvain LE FLOCH (2):
arm64: dts: rockchip: Enable PCIe for the M.2 slot on NanoPi Zero2
arm64: dts: rockchip: Fix the microSD's default sample phase on NanoPi Zero2
arch/arm64/boot/dts/rockchip/rk3528-nanopi-zero2.dts | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
---
base-commit: ef6427a0fcc86af4f434bc92b9d01fdc5c094e5c
change-id: 20261205-zero2-dts-1bd9fe9bb3be
Best regards,
--
Sylvain LE FLOCH <vantom@protonmail.ch>
^ permalink raw reply [flat|nested] 11+ messages in thread* [PATCH 1/2] arm64: dts: rockchip: Enable PCIe for the M.2 slot on NanoPi Zero2
2026-12-05 21:45 ` Sylvain LE FLOCH via B4 Relay
(?)
@ 2026-12-05 21:45 ` Sylvain LE FLOCH via B4 Relay
-1 siblings, 0 replies; 11+ messages in thread
From: Sylvain LE FLOCH @ 2026-12-05 21:45 UTC (permalink / raw)
To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Heiko Stuebner,
Jonas Karlman
Cc: devicetree, linux-arm-kernel, linux-rockchip, linux-kernel,
Sylvain LE FLOCH
The NanoPi Zero2 has an M.2 Key-E 2230 slot for Wi-Fi/Bluetooth cards,
wired to the RK3528's PCIe 2.1 x1 controller through the combo PHY, on
the PCIe pins of mux 1: CLKREQ# GPIO1_A0, WAKE# GPIO1_A1 and PERST#
GPIO1_A2.
Enable the combo PHY and the PCIe controller with the pciem1_pins group,
PERST# driven as a GPIO, and the slot powered from vcc_3v3, as on the
Radxa E20C, which uses the same pins.
Tested on two boards: with an empty slot, the controller probes and
reports that no device is found; with a Realtek RTL8822CE card, the link
comes up at 2.5 GT/s x1, the card's limit, and rtw88_8822ce brings up
its Wi-Fi.
Signed-off-by: Sylvain LE FLOCH <vantom@protonmail.ch>
---
arch/arm64/boot/dts/rockchip/rk3528-nanopi-zero2.dts | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/arch/arm64/boot/dts/rockchip/rk3528-nanopi-zero2.dts b/arch/arm64/boot/dts/rockchip/rk3528-nanopi-zero2.dts
index 05ae03622e85..2e43f1f4c2f3 100644
--- a/arch/arm64/boot/dts/rockchip/rk3528-nanopi-zero2.dts
+++ b/arch/arm64/boot/dts/rockchip/rk3528-nanopi-zero2.dts
@@ -45,12 +45,24 @@ usb2_host_5v: regulator-5v0-usb2-host {
};
};
+&combphy {
+ status = "okay";
+};
+
&led1 {
default-state = "on";
function = LED_FUNCTION_STATUS;
linux,default-trigger = "default-on";
};
+&pcie {
+ pinctrl-names = "default";
+ pinctrl-0 = <&pciem1_pins>;
+ reset-gpios = <&gpio1 RK_PA2 GPIO_ACTIVE_HIGH>;
+ vpcie3v3-supply = <&vcc_3v3>;
+ status = "okay";
+};
+
&pinctrl {
usb {
usb20_host1_pwren: usb20-host1-pwren {
--
2.53.0
^ permalink raw reply related [flat|nested] 11+ messages in thread* [PATCH 1/2] arm64: dts: rockchip: Enable PCIe for the M.2 slot on NanoPi Zero2
@ 2026-12-05 21:45 ` Sylvain LE FLOCH via B4 Relay
0 siblings, 0 replies; 11+ messages in thread
From: Sylvain LE FLOCH via B4 Relay @ 2026-12-05 21:45 UTC (permalink / raw)
To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Heiko Stuebner,
Jonas Karlman
Cc: devicetree, linux-arm-kernel, linux-rockchip, linux-kernel,
Sylvain LE FLOCH
From: Sylvain LE FLOCH <vantom@protonmail.ch>
The NanoPi Zero2 has an M.2 Key-E 2230 slot for Wi-Fi/Bluetooth cards,
wired to the RK3528's PCIe 2.1 x1 controller through the combo PHY, on
the PCIe pins of mux 1: CLKREQ# GPIO1_A0, WAKE# GPIO1_A1 and PERST#
GPIO1_A2.
Enable the combo PHY and the PCIe controller with the pciem1_pins group,
PERST# driven as a GPIO, and the slot powered from vcc_3v3, as on the
Radxa E20C, which uses the same pins.
Tested on two boards: with an empty slot, the controller probes and
reports that no device is found; with a Realtek RTL8822CE card, the link
comes up at 2.5 GT/s x1, the card's limit, and rtw88_8822ce brings up
its Wi-Fi.
Signed-off-by: Sylvain LE FLOCH <vantom@protonmail.ch>
---
arch/arm64/boot/dts/rockchip/rk3528-nanopi-zero2.dts | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/arch/arm64/boot/dts/rockchip/rk3528-nanopi-zero2.dts b/arch/arm64/boot/dts/rockchip/rk3528-nanopi-zero2.dts
index 05ae03622e85..2e43f1f4c2f3 100644
--- a/arch/arm64/boot/dts/rockchip/rk3528-nanopi-zero2.dts
+++ b/arch/arm64/boot/dts/rockchip/rk3528-nanopi-zero2.dts
@@ -45,12 +45,24 @@ usb2_host_5v: regulator-5v0-usb2-host {
};
};
+&combphy {
+ status = "okay";
+};
+
&led1 {
default-state = "on";
function = LED_FUNCTION_STATUS;
linux,default-trigger = "default-on";
};
+&pcie {
+ pinctrl-names = "default";
+ pinctrl-0 = <&pciem1_pins>;
+ reset-gpios = <&gpio1 RK_PA2 GPIO_ACTIVE_HIGH>;
+ vpcie3v3-supply = <&vcc_3v3>;
+ status = "okay";
+};
+
&pinctrl {
usb {
usb20_host1_pwren: usb20-host1-pwren {
--
2.53.0
_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip
^ permalink raw reply related [flat|nested] 11+ messages in thread* [PATCH 1/2] arm64: dts: rockchip: Enable PCIe for the M.2 slot on NanoPi Zero2
@ 2026-12-05 21:45 ` Sylvain LE FLOCH via B4 Relay
0 siblings, 0 replies; 11+ messages in thread
From: Sylvain LE FLOCH via B4 Relay @ 2026-12-05 21:45 UTC (permalink / raw)
To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Heiko Stuebner,
Jonas Karlman
Cc: devicetree, linux-arm-kernel, linux-rockchip, linux-kernel,
Sylvain LE FLOCH
From: Sylvain LE FLOCH <vantom@protonmail.ch>
The NanoPi Zero2 has an M.2 Key-E 2230 slot for Wi-Fi/Bluetooth cards,
wired to the RK3528's PCIe 2.1 x1 controller through the combo PHY, on
the PCIe pins of mux 1: CLKREQ# GPIO1_A0, WAKE# GPIO1_A1 and PERST#
GPIO1_A2.
Enable the combo PHY and the PCIe controller with the pciem1_pins group,
PERST# driven as a GPIO, and the slot powered from vcc_3v3, as on the
Radxa E20C, which uses the same pins.
Tested on two boards: with an empty slot, the controller probes and
reports that no device is found; with a Realtek RTL8822CE card, the link
comes up at 2.5 GT/s x1, the card's limit, and rtw88_8822ce brings up
its Wi-Fi.
Signed-off-by: Sylvain LE FLOCH <vantom@protonmail.ch>
---
arch/arm64/boot/dts/rockchip/rk3528-nanopi-zero2.dts | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/arch/arm64/boot/dts/rockchip/rk3528-nanopi-zero2.dts b/arch/arm64/boot/dts/rockchip/rk3528-nanopi-zero2.dts
index 05ae03622e85..2e43f1f4c2f3 100644
--- a/arch/arm64/boot/dts/rockchip/rk3528-nanopi-zero2.dts
+++ b/arch/arm64/boot/dts/rockchip/rk3528-nanopi-zero2.dts
@@ -45,12 +45,24 @@ usb2_host_5v: regulator-5v0-usb2-host {
};
};
+&combphy {
+ status = "okay";
+};
+
&led1 {
default-state = "on";
function = LED_FUNCTION_STATUS;
linux,default-trigger = "default-on";
};
+&pcie {
+ pinctrl-names = "default";
+ pinctrl-0 = <&pciem1_pins>;
+ reset-gpios = <&gpio1 RK_PA2 GPIO_ACTIVE_HIGH>;
+ vpcie3v3-supply = <&vcc_3v3>;
+ status = "okay";
+};
+
&pinctrl {
usb {
usb20_host1_pwren: usb20-host1-pwren {
--
2.53.0
^ permalink raw reply related [flat|nested] 11+ messages in thread* Re: [PATCH 1/2] arm64: dts: rockchip: Enable PCIe for the M.2 slot on NanoPi Zero2
2026-12-05 21:45 ` Sylvain LE FLOCH via B4 Relay
(?)
(?)
@ 2026-12-05 22:00 ` sashiko-bot
-1 siblings, 0 replies; 11+ messages in thread
From: sashiko-bot @ 2026-12-05 22:00 UTC (permalink / raw)
To: Sylvain LE FLOCH; +Cc: devicetree, robh, conor+dt
Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Medium] arm64: dts: rockchip: pciem1_pins muxes PERST# reset GPIO to
function 4
--
commit 392df963cea381731f347dd5415e226d20952e03
Author: Sylvain LE FLOCH <vantom@protonmail.ch>
arm64: dts: rockchip: Enable PCIe for the M.2 slot on NanoPi Zero2
This commit enables the combo PHY and PCIe controller for the M.2 slot on
the NanoPi Zero2, using the pciem1_pins pinctrl group and GPIO1_PA2 as
reset-gpios.
> diff --git a/arch/arm64/boot/dts/rockchip/rk3528-nanopi-zero2.dts b/arch/arm64/boot/dts/rockchip/rk3528-nanopi-zero2.dts
> index 05ae03622e850..2e43f1f4c2f36 100644
> --- a/arch/arm64/boot/dts/rockchip/rk3528-nanopi-zero2.dts
> +++ b/arch/arm64/boot/dts/rockchip/rk3528-nanopi-zero2.dts
> @@ -45,12 +45,24 @@ usb2_host_5v: regulator-5v0-usb2-host {
[ ... ]
> +&pcie {
> + pinctrl-names = "default";
> + pinctrl-0 = <&pciem1_pins>;
> + reset-gpios = <&gpio1 RK_PA2 GPIO_ACTIVE_HIGH>;
> + vpcie3v3-supply = <&vcc_3v3>;
> + status = "okay";
> +};
[Severity: Medium]
Does pciem1_pins conflict with reset-gpios on GPIO1_PA2?
In rk3528-pinctrl.dtsi, pciem1_pins muxes GPIO1_PA2 to hardware function 4
(pcie_perstn_m1) instead of RK_FUNC_GPIO. Linux masks this because
pinctrl-rockchip remuxes the pin to GPIO when rockchip_pcie_resource_get()
requests reset-gpios, after briefly switching it during pinctrl_bind_pins().
Stricter DT consumers such as U-Boot apply pinctrl-0 without remuxing on
GPIO request, leaving GPIO1_PA2 in function 4 and causing PCIe probing to
fail or hang, as in commit e95e4fcdc454 ("arm64: dts: rockchip: Use GPIO
function for PCIe reset on Orange Pi 5 Pro").
Should the board DTS define a pinctrl group that muxes GPIO1_PA2 to
RK_FUNC_GPIO while keeping GPIO1_PA0 and GPIO1_PA1 on function 4?
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261205-zero2-dts-v1-0-eb08c4eb5ab3@protonmail.ch?part=1
^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH 2/2] arm64: dts: rockchip: Fix the microSD's default sample phase on NanoPi Zero2
2026-12-05 21:45 ` Sylvain LE FLOCH via B4 Relay
(?)
@ 2026-12-05 21:45 ` Sylvain LE FLOCH via B4 Relay
-1 siblings, 0 replies; 11+ messages in thread
From: Sylvain LE FLOCH @ 2026-12-05 21:45 UTC (permalink / raw)
To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Heiko Stuebner,
Jonas Karlman
Cc: devicetree, linux-arm-kernel, linux-rockchip, linux-kernel,
Sylvain LE FLOCH
In SDR104 at 148.5 MHz, some cards pass the tuning block at every sample
phase. dw_mmc-rockchip then reports "All phases work" and uses
rockchip,default-sample-phase, which rk3528.dtsi sets to 90 degrees. On
the NanoPi Zero2 that phase is outside the window where data reads
work: with a SanDisk Extreme 32 GB card, reads fail, the card is
re-tuned and re-initialised over and over, and reading 1 GiB of it
gives up after 8 MiB.
With the same card, default phases of 180, 225, 270 and 315 degrees
each read 1 GiB without an error, at 56 to 69 MB/s. When tuning does
find failing phases, the windows it finds are centred at 241 to 281
degrees (281 with that card, 241 and 247 with a Samsung EVO Plus).
Use 270 degrees on this board, a multiple of 90 that needs no fine
delay element. With this change, on two boards, the SanDisk card reads
1 GiB in SDR104 at 55 to 68 MB/s (seven boots, five of them on the
default phase) and in SDR50 at 43 to 47 MB/s (four boots), without an
error, a re-tuning or a re-initialisation. The Samsung card, whose
tuning finds failing phases, is not affected: it still picks its own
phase (242 and 245 degrees) and reads 1 GiB at 58 to 60 MB/s.
Fixes: b944112abef4 ("arm64: dts: rockchip: Add FriendlyElec NanoPi Zero2")
Signed-off-by: Sylvain LE FLOCH <vantom@protonmail.ch>
---
arch/arm64/boot/dts/rockchip/rk3528-nanopi-zero2.dts | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/arch/arm64/boot/dts/rockchip/rk3528-nanopi-zero2.dts b/arch/arm64/boot/dts/rockchip/rk3528-nanopi-zero2.dts
index 2e43f1f4c2f3..eea46b07368e 100644
--- a/arch/arm64/boot/dts/rockchip/rk3528-nanopi-zero2.dts
+++ b/arch/arm64/boot/dts/rockchip/rk3528-nanopi-zero2.dts
@@ -71,6 +71,10 @@ usb20_host1_pwren: usb20-host1-pwren {
};
};
+&sdmmc {
+ rockchip,default-sample-phase = <270>;
+};
+
&usb_host0_ehci {
status = "okay";
};
--
2.53.0
^ permalink raw reply related [flat|nested] 11+ messages in thread* [PATCH 2/2] arm64: dts: rockchip: Fix the microSD's default sample phase on NanoPi Zero2
@ 2026-12-05 21:45 ` Sylvain LE FLOCH via B4 Relay
0 siblings, 0 replies; 11+ messages in thread
From: Sylvain LE FLOCH via B4 Relay @ 2026-12-05 21:45 UTC (permalink / raw)
To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Heiko Stuebner,
Jonas Karlman
Cc: devicetree, linux-arm-kernel, linux-rockchip, linux-kernel,
Sylvain LE FLOCH
From: Sylvain LE FLOCH <vantom@protonmail.ch>
In SDR104 at 148.5 MHz, some cards pass the tuning block at every sample
phase. dw_mmc-rockchip then reports "All phases work" and uses
rockchip,default-sample-phase, which rk3528.dtsi sets to 90 degrees. On
the NanoPi Zero2 that phase is outside the window where data reads
work: with a SanDisk Extreme 32 GB card, reads fail, the card is
re-tuned and re-initialised over and over, and reading 1 GiB of it
gives up after 8 MiB.
With the same card, default phases of 180, 225, 270 and 315 degrees
each read 1 GiB without an error, at 56 to 69 MB/s. When tuning does
find failing phases, the windows it finds are centred at 241 to 281
degrees (281 with that card, 241 and 247 with a Samsung EVO Plus).
Use 270 degrees on this board, a multiple of 90 that needs no fine
delay element. With this change, on two boards, the SanDisk card reads
1 GiB in SDR104 at 55 to 68 MB/s (seven boots, five of them on the
default phase) and in SDR50 at 43 to 47 MB/s (four boots), without an
error, a re-tuning or a re-initialisation. The Samsung card, whose
tuning finds failing phases, is not affected: it still picks its own
phase (242 and 245 degrees) and reads 1 GiB at 58 to 60 MB/s.
Fixes: b944112abef4 ("arm64: dts: rockchip: Add FriendlyElec NanoPi Zero2")
Signed-off-by: Sylvain LE FLOCH <vantom@protonmail.ch>
---
arch/arm64/boot/dts/rockchip/rk3528-nanopi-zero2.dts | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/arch/arm64/boot/dts/rockchip/rk3528-nanopi-zero2.dts b/arch/arm64/boot/dts/rockchip/rk3528-nanopi-zero2.dts
index 2e43f1f4c2f3..eea46b07368e 100644
--- a/arch/arm64/boot/dts/rockchip/rk3528-nanopi-zero2.dts
+++ b/arch/arm64/boot/dts/rockchip/rk3528-nanopi-zero2.dts
@@ -71,6 +71,10 @@ usb20_host1_pwren: usb20-host1-pwren {
};
};
+&sdmmc {
+ rockchip,default-sample-phase = <270>;
+};
+
&usb_host0_ehci {
status = "okay";
};
--
2.53.0
_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip
^ permalink raw reply related [flat|nested] 11+ messages in thread* [PATCH 2/2] arm64: dts: rockchip: Fix the microSD's default sample phase on NanoPi Zero2
@ 2026-12-05 21:45 ` Sylvain LE FLOCH via B4 Relay
0 siblings, 0 replies; 11+ messages in thread
From: Sylvain LE FLOCH via B4 Relay @ 2026-12-05 21:45 UTC (permalink / raw)
To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Heiko Stuebner,
Jonas Karlman
Cc: devicetree, linux-arm-kernel, linux-rockchip, linux-kernel,
Sylvain LE FLOCH
From: Sylvain LE FLOCH <vantom@protonmail.ch>
In SDR104 at 148.5 MHz, some cards pass the tuning block at every sample
phase. dw_mmc-rockchip then reports "All phases work" and uses
rockchip,default-sample-phase, which rk3528.dtsi sets to 90 degrees. On
the NanoPi Zero2 that phase is outside the window where data reads
work: with a SanDisk Extreme 32 GB card, reads fail, the card is
re-tuned and re-initialised over and over, and reading 1 GiB of it
gives up after 8 MiB.
With the same card, default phases of 180, 225, 270 and 315 degrees
each read 1 GiB without an error, at 56 to 69 MB/s. When tuning does
find failing phases, the windows it finds are centred at 241 to 281
degrees (281 with that card, 241 and 247 with a Samsung EVO Plus).
Use 270 degrees on this board, a multiple of 90 that needs no fine
delay element. With this change, on two boards, the SanDisk card reads
1 GiB in SDR104 at 55 to 68 MB/s (seven boots, five of them on the
default phase) and in SDR50 at 43 to 47 MB/s (four boots), without an
error, a re-tuning or a re-initialisation. The Samsung card, whose
tuning finds failing phases, is not affected: it still picks its own
phase (242 and 245 degrees) and reads 1 GiB at 58 to 60 MB/s.
Fixes: b944112abef4 ("arm64: dts: rockchip: Add FriendlyElec NanoPi Zero2")
Signed-off-by: Sylvain LE FLOCH <vantom@protonmail.ch>
---
arch/arm64/boot/dts/rockchip/rk3528-nanopi-zero2.dts | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/arch/arm64/boot/dts/rockchip/rk3528-nanopi-zero2.dts b/arch/arm64/boot/dts/rockchip/rk3528-nanopi-zero2.dts
index 2e43f1f4c2f3..eea46b07368e 100644
--- a/arch/arm64/boot/dts/rockchip/rk3528-nanopi-zero2.dts
+++ b/arch/arm64/boot/dts/rockchip/rk3528-nanopi-zero2.dts
@@ -71,6 +71,10 @@ usb20_host1_pwren: usb20-host1-pwren {
};
};
+&sdmmc {
+ rockchip,default-sample-phase = <270>;
+};
+
&usb_host0_ehci {
status = "okay";
};
--
2.53.0
^ permalink raw reply related [flat|nested] 11+ messages in thread* Re: [PATCH 2/2] arm64: dts: rockchip: Fix the microSD's default sample phase on NanoPi Zero2
2026-12-05 21:45 ` Sylvain LE FLOCH via B4 Relay
(?)
(?)
@ 2026-12-05 22:05 ` sashiko-bot
-1 siblings, 0 replies; 11+ messages in thread
From: sashiko-bot @ 2026-12-05 22:05 UTC (permalink / raw)
To: Sylvain LE FLOCH; +Cc: devicetree, robh, conor+dt
Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Medium] arm64: dts: rockchip: 270-deg default-sample-phase alters
untuned SD modes
--
commit 1f9d87cc05591da7243391787e9fd6f0de113011
Author: Sylvain LE FLOCH <vantom@protonmail.ch>
arm64: dts: rockchip: Fix the microSD's default sample phase on NanoPi Zero2
This commit overrides rockchip,default-sample-phase on the sdmmc node of
the FriendlyElec NanoPi Zero2 from the 90 degrees inherited from
rk3528.dtsi to 270 degrees.
> diff --git a/arch/arm64/boot/dts/rockchip/rk3528-nanopi-zero2.dts b/arch/arm64/boot/dts/rockchip/rk3528-nanopi-zero2.dts
> index 2e43f1f4c2f36..eea46b07368ed 100644
> --- a/arch/arm64/boot/dts/rockchip/rk3528-nanopi-zero2.dts
> +++ b/arch/arm64/boot/dts/rockchip/rk3528-nanopi-zero2.dts
> @@ -71,6 +71,10 @@ usb20_host1_pwren: usb20-host1-pwren {
> };
> };
>
> +&sdmmc {
> + rockchip,default-sample-phase = <270>;
> +};
[Severity: Medium]
Can changing rockchip,default-sample-phase to 270 degrees break untuned
non-UHS SD cards?
Without clk-phase-* properties in rk3528-nanopi.dtsi,
dw_mci_rk3288_set_ios() applies default_sample_phase to untuned DS/HS
modes and leaves it set for SDR12/SDR25. UHS-I cards stay at 400 kHz
until SDR50/SDR104 tuning, so 25 MHz DS and 50 MHz HS were not tested.
Because the phase is a fraction of the clock period rather than a fixed
delay, 270 degrees samples 10 ns after the falling edge at 25 MHz DS
and 15 ns after the rising edge at 50 MHz HS. With SD card output
delays up to 14 ns, that can cause CRC errors or failed reads.
Adding clk-phase-legacy, clk-phase-mmc-hs, clk-phase-sd-hs,
clk-phase-uhs-sdr12 and clk-phase-uhs-sdr25 properties to keep the
90-degree sample phase would isolate the 270-degree fallback to
dw_mci_rk3288_execute_tuning().
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261205-zero2-dts-v1-0-eb08c4eb5ab3@protonmail.ch?part=2
^ permalink raw reply [flat|nested] 11+ messages in thread