* [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
2026-12-05 21:45 ` [PATCH 1/2] arm64: dts: rockchip: Enable PCIe for the M.2 slot on NanoPi Zero2 Sylvain LE FLOCH via B4 Relay
2026-12-05 21:45 ` [PATCH 2/2] arm64: dts: rockchip: Fix the microSD's default sample phase " Sylvain LE FLOCH via B4 Relay
0 siblings, 2 replies; 3+ 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] 3+ messages in thread
* [PATCH 1/2] arm64: dts: rockchip: Enable PCIe for the M.2 slot on NanoPi Zero2
2026-12-05 21:45 [PATCH 0/2] arm64: dts: rockchip: NanoPi Zero2: enable PCIe, fix the microSD sample phase Sylvain LE FLOCH via B4 Relay
@ 2026-12-05 21:45 ` Sylvain LE FLOCH via B4 Relay
2026-12-05 21:45 ` [PATCH 2/2] arm64: dts: rockchip: Fix the microSD's default sample phase " Sylvain LE FLOCH via B4 Relay
1 sibling, 0 replies; 3+ 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 [flat|nested] 3+ messages in thread
* [PATCH 2/2] arm64: dts: rockchip: Fix the microSD's default sample phase on NanoPi Zero2
2026-12-05 21:45 [PATCH 0/2] arm64: dts: rockchip: NanoPi Zero2: enable PCIe, fix the microSD sample phase Sylvain LE FLOCH via B4 Relay
2026-12-05 21:45 ` [PATCH 1/2] arm64: dts: rockchip: Enable PCIe for the M.2 slot on NanoPi Zero2 Sylvain LE FLOCH via B4 Relay
@ 2026-12-05 21:45 ` Sylvain LE FLOCH via B4 Relay
1 sibling, 0 replies; 3+ 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 [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-12-05 21:48 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-12-05 21:45 [PATCH 0/2] arm64: dts: rockchip: NanoPi Zero2: enable PCIe, fix the microSD sample phase Sylvain LE FLOCH via B4 Relay
2026-12-05 21:45 ` [PATCH 1/2] arm64: dts: rockchip: Enable PCIe for the M.2 slot on NanoPi Zero2 Sylvain LE FLOCH via B4 Relay
2026-12-05 21:45 ` [PATCH 2/2] arm64: dts: rockchip: Fix the microSD's default sample phase " Sylvain LE FLOCH via B4 Relay
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®