[PATCH] board: rockchip: set M.2 NVMe PERSTN low in spl_board_init on Jaguar
Jakob Unterwurzacher
jakobunt at gmail.com
Tue Jun 9 14:21:51 CEST 2026
From: Jakob Unterwurzacher <jakob.unterwurzacher at cherry.de>
As it is, an NVMe's built-in PERSTN pull-up fights against the
SoC's built-in pull-down which results in an undefined logic state
on the Samsung SSD 980 and likely others.
Fix that by forcing PERSTN low as early as possible, which is SPL.
Both Linux and U-Boot (via "pci enum") set the pin high later
as needed and the NVMe is detected fine.
Oscillocope shots ("x" means undefined logic state at around 1.5V):
Before:
3V3 ____|‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
PERSTN ____xxxxxxxxxxxxxxx_|‾‾‾‾‾
PCICLK ____∿∿∿∿∿∿∿∿∿∿∿∿___∿∿∿∿∿∿∿
^U-Boot ^ Linux
After:
3V3 ____|‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
PERSTN ____x_______________|‾‾‾‾‾
PCICLK ____∿∿∿∿∿∿∿∿∿∿∿∿___∿∿∿∿∿∿∿
^U-Boot ^ Linux
With this change, the power-up sequence conforms to PCIe specs,
except a remaining short PERSTN glitch. The glitch is about 400ms
long. It could be shortened by moving the logic to TPL, but
completely fixing it is only possible in hardware.
Signed-off-by: Jakob Unterwurzacher <jakob.unterwurzacher at cherry.de>
---
arch/arm/dts/rk3588-jaguar-u-boot.dtsi | 6 ++++++
board/theobroma-systems/jaguar_rk3588/jaguar_rk3588.c | 19 +++++++++++++++++++
2 files changed, 25 insertions(+)
diff --git a/arch/arm/dts/rk3588-jaguar-u-boot.dtsi b/arch/arm/dts/rk3588-jaguar-u-boot.dtsi
index dcda4f99d6e..0fbbb50fc5a 100644
--- a/arch/arm/dts/rk3588-jaguar-u-boot.dtsi
+++ b/arch/arm/dts/rk3588-jaguar-u-boot.dtsi
@@ -21,6 +21,12 @@
bootph-some-ram;
};
+&gpio0 {
+ /* Need gpio0 in SPL for spl_board_init() to control GPIO0_D0 */
+ /* TODO: once we have a U-Boot TPL, use bootph-pre-sram; */
+ bootph-pre-ram;
+};
+
&gpio2 {
bootph-pre-ram;
bootph-some-ram;
diff --git a/board/theobroma-systems/jaguar_rk3588/jaguar_rk3588.c b/board/theobroma-systems/jaguar_rk3588/jaguar_rk3588.c
index 3f484646701..45fa5d9fae1 100644
--- a/board/theobroma-systems/jaguar_rk3588/jaguar_rk3588.c
+++ b/board/theobroma-systems/jaguar_rk3588/jaguar_rk3588.c
@@ -54,6 +54,9 @@ int rockchip_early_misc_init_r(void)
#define GPIO0B7_PU_EN BIT(15)
+#define M2_NVME_PERSTN 24 /* GPIO0_D0, PERSTN signal to the M.2 NVMe slot */
+
+/* TODO: once we have a U-Boot TPL, move this to tpl_board_init() */
void spl_board_init(void)
{
/*
@@ -67,6 +70,22 @@ void spl_board_init(void)
* pull-up.
*/
struct rk3588_pmu2_ioc * const ioc = (void *)PMU2_IOC_BASE;
+ int ret;
rk_setreg(&ioc->gpio0b_p, GPIO0B7_PU_EN);
+
+ /*
+ * Set the M.2 NVMe slot PERSTN to a defined low
+ * state as early as possible
+ */
+ ret = gpio_request(M2_NVME_PERSTN, "M2_NVME_PERSTN");
+ if (ret) {
+ log_err("M2_NVME_PERSTN: gpio request failed: %d\n", ret);
+ return;
+ }
+ ret = gpio_direction_output(M2_NVME_PERSTN, 0);
+ if (ret) {
+ log_err("M2_NVME_PERSTN: gpio direction set failed: %d\n", ret);
+ return;
+ }
}
---
base-commit: 1a8b7ad50aed5f5f0a4ccbfd455233919c097293
change-id: 20260609-b4-master_nvme-08d2c5d6a5f7
Best regards,
--
Jakob Unterwurzacher <jakob.unterwurzacher at cherry.de>
More information about the U-Boot
mailing list