Skip to contentSkip to conversation

board: microsoft: surface-rt: clear VDDCTRL EN1 assignment before enabling VDD_CPU

PATCH In review Jerome Berclaz 2 participants 2 messages Nov 22

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 board: microsoft: surface-rt: clear VDDCTRL EN1 assignment before enabling VDD_CPU

Linux's tps65910 regulator driver assigns the CPU rail (TPS65911 VDDCTRL) to the EN1 input, which is driven by the Tegra CPU_PWR_REQ signal, with a 0 V sleep voltage. A PMC warm reset (PMC_CNTRL MAIN_RST, used for example to reboot into RCM) does not reset the PMIC, so U-Boot and the next kernel start with that assignment still active instead of the cold boot state. About half of such boots then hung right after "Starting kernel...", with no output from the kernel.

Clear EN1_SMPS_ASS before setting up VDD_CPU, so every boot starts from the same PMIC state as a cold boot. Linux assigns the external controls again when the regulator driver probes. The SPL I2C helper can only write, so the whole register is cleared; on the Surface RT only VDDCTRL is assigned to EN1.

Tested on a Surface RT: 6 consecutive PMC warm-reset boots with U-Boot loaded over RCM all reached userspace (about half hung before), and LP1 suspend still works afterwards. Normal reboots go through the PMIC restart handler and were not affected.

The problem was investigated, and this change and its description written, with the help of an AI coding assistant (Claude); I reviewed the change and tested it on my device as described above.

---
Sent here as suggested on the libre-tegra tracker:
https://codeberg.org/libre-tegra/u-boot/pulls/8

---
 board/microsoft/surface-rt/surface-rt-spl.c | 10 ++++++++++
 1 file changed, 10 insertions(+)
board/microsoft/surface-rt/surface-rt-spl.c +10 -0
index f327a80ef..7a8c38395 100644
@@ -18,6 +18,8 @@
 #define TPS65911_VDDCTRL_SR_REG		0x27
 #define TPS65911_VDDCTRL_OP_DATA	(0x2400 | TPS65911_VDDCTRL_OP_REG)
 #define TPS65911_VDDCTRL_SR_DATA	(0x0100 | TPS65911_VDDCTRL_SR_REG)
+#define TPS65911_EN1_SMPS_ASS_REG	0x46
+#define TPS65911_EN1_SMPS_ASS_DATA	(0x0000 | TPS65911_EN1_SMPS_ASS_REG)
 
 #define TPS62361B_I2C_ADDR		(0x60 << 1)
 #define TPS62361B_SET3_REG		0x03
@@ -30,6 +32,14 @@ void pmic_enable_cpu_vdd(void)
 
 	udelay(1000);
 
+	/*
+	 * Linux assigns VDDCTRL to the EN1 input (CPU_PWR_REQ) with a 0 V
+	 * sleep voltage. A PMC warm reset does not reset the PMIC, so drop
+	 * that assignment to start from the same state as a cold boot.
+	 */
+	tegra_i2c_ll_write(TPS65911_I2C_ADDR, TPS65911_EN1_SMPS_ASS_DATA);
+	udelay(1000);
+
 	/*
 	 * Bring up CPU VDD via the TPS65911x PMIC on the DVC I2C bus.
 	 * First set VDD to 1.0125V, then enable the VDD regulator.

---
base-commit: e578056c766d653270b14557c2a9d8daec414c17
change-id: 20261122-surface-rt-en1-vddctrl-9a383020da62

Best regards,

Signature · 1 line
Jerome Berclaz <[email protected]>
#1 lore raw

нд, 22 лист. 2026 р. о 18:44 Jerome Berclaz via B4 Relay <[email protected]> пише:

Quoted 67 lines

From: Jerome Berclaz <[email protected]>

Linux's tps65910 regulator driver assigns the CPU rail (TPS65911 VDDCTRL) to the EN1 input, which is driven by the Tegra CPU_PWR_REQ signal, with a 0 V sleep voltage. A PMC warm reset (PMC_CNTRL MAIN_RST, used for example to reboot into RCM) does not reset the PMIC, so U-Boot and the next kernel start with that assignment still active instead of the cold boot state. About half of such boots then hung right after "Starting kernel...", with no output from the kernel.

Clear EN1_SMPS_ASS before setting up VDD_CPU, so every boot starts from the same PMIC state as a cold boot. Linux assigns the external controls again when the regulator driver probes. The SPL I2C helper can only write, so the whole register is cleared; on the Surface RT only VDDCTRL is assigned to EN1.

Tested on a Surface RT: 6 consecutive PMC warm-reset boots with U-Boot loaded over RCM all reached userspace (about half hung before), and LP1 suspend still works afterwards. Normal reboots go through the PMIC restart handler and were not affected.

The problem was investigated, and this change and its description written, with the help of an AI coding assistant (Claude); I reviewed the change and tested it on my device as described above.

---
Sent here as suggested on the libre-tegra tracker:
https://codeberg.org/libre-tegra/u-boot/pulls/8

---
 board/microsoft/surface-rt/surface-rt-spl.c | 10 ++++++++++
 1 file changed, 10 insertions(+)
board/microsoft/surface-rt/surface-rt-spl.c +10 -1
index f327a80ef..7a8c38395 100644
@@ -18,6 +18,8 @@
 #define TPS65911_VDDCTRL_SR_REG                0x27
 #define TPS65911_VDDCTRL_OP_DATA       (0x2400 | TPS65911_VDDCTRL_OP_REG)
 #define TPS65911_VDDCTRL_SR_DATA       (0x0100 | TPS65911_VDDCTRL_SR_REG)
+#define TPS65911_EN1_SMPS_ASS_REG      0x46
+#define TPS65911_EN1_SMPS_ASS_DATA     (0x0000 | TPS65911_EN1_SMPS_ASS_REG)
 
 #define TPS62361B_I2C_ADDR             (0x60 << 1)
 #define TPS62361B_SET3_REG             0x03
@@ -30,6 +32,14 @@ void pmic_enable_cpu_vdd(void)
 
        udelay(1000);
 
+       /*
+        * Linux assigns VDDCTRL to the EN1 input (CPU_PWR_REQ) with a 0 V
+        * sleep voltage. A PMC warm reset does not reset the PMIC, so drop
+        * that assignment to start from the same state as a cold boot.
+        */
+       tegra_i2c_ll_write(TPS65911_I2C_ADDR, TPS65911_EN1_SMPS_ASS_DATA);
+       udelay(1000);
+
        /*
         * Bring up CPU VDD via the TPS65911x PMIC on the DVC I2C bus.
         * First set VDD to 1.0125V, then enable the VDD regulator.
 
---

base-commit: e578056c766d653270b14557c2a9d8daec414c17
change-id: 20261122-surface-rt-en1-vddctrl-9a383020da62

Quoted 4 lines

Best regards,
--
Jerome Berclaz <[email protected]>

Hello Jerome! LGTM.

Applied to u-boot-tegra/staging, thank you!