From 5b0ba27efaa62aba8dcf4fae0950a2899261ecdc Mon Sep 17 00:00:00 2001 From: Daniel Schaefer Date: Wed, 11 Mar 2026 11:05:35 +0800 Subject: [PATCH 1/3] --flash_gpu_descriptor: Keep bay power if already on 84ffa840c57116cd6bc221e5ac1ddce3c1f0b290 made sure to turn on and off the bay power to enable programming the EEPROM even with bad eeprom (which would cause EC not to turn on bay power). But this would cause issue for reprogramming a good eeprom because the power is already on and it would turn it off afterwards. So if the bay power if turned off for a GPU when windows with nvidia driver is running, the driver crashes and bluescreens Windows. Signed-off-by: Daniel Schaefer --- framework_lib/src/chromium_ec/mod.rs | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/framework_lib/src/chromium_ec/mod.rs b/framework_lib/src/chromium_ec/mod.rs index f83cfb6..3b31da3 100644 --- a/framework_lib/src/chromium_ec/mod.rs +++ b/framework_lib/src/chromium_ec/mod.rs @@ -1354,15 +1354,18 @@ impl CrosEc { } if let Ok(ExpansionBayBoard::DualInterposer) = info.expansion_bay_board() { - /* Force power to the GPU if we are writing the EEPROM */ - let res = self.set_gpio("gpu_3v_5v_en", true); - if let Err(err) = res { - error!("Failed to set ALW power to GPU off {:?}", err); - return Err(err); + // If bay power is on already, we don't need to enable/disable it + if !self.get_gpio("gpu_3v_5v_en")? { + // Force power to the GPU if we are writing the EEPROM + let res = self.set_gpio("gpu_3v_5v_en", true); + if let Err(err) = res { + error!("Failed to set ALW power to GPU off {:?}", err); + return Err(err); + } + println!("Forcing Power to GPU"); + os_specific::sleep(100_000); + force_power = true; } - println!("Forcing Power to GPU"); - os_specific::sleep(100_000); - force_power = true; } // Need to program the EEPROM 32 bytes at a time. From 82d16542da2031d47d0224cffc14a1f38066af45 Mon Sep 17 00:00:00 2001 From: Daniel Schaefer Date: Wed, 11 Mar 2026 11:12:01 +0800 Subject: [PATCH 2/3] chromium_ec: Fix typo Signed-off-by: Daniel Schaefer --- framework_lib/src/chromium_ec/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/framework_lib/src/chromium_ec/mod.rs b/framework_lib/src/chromium_ec/mod.rs index 3b31da3..d358270 100644 --- a/framework_lib/src/chromium_ec/mod.rs +++ b/framework_lib/src/chromium_ec/mod.rs @@ -1359,7 +1359,7 @@ impl CrosEc { // Force power to the GPU if we are writing the EEPROM let res = self.set_gpio("gpu_3v_5v_en", true); if let Err(err) = res { - error!("Failed to set ALW power to GPU off {:?}", err); + error!("Failed to set ALW power to GPU on {:?}", err); return Err(err); } println!("Forcing Power to GPU"); From 79fd152e150cd7ccc5be54f09b11bae186178874 Mon Sep 17 00:00:00 2001 From: Daniel Schaefer Date: Thu, 12 Mar 2026 14:43:48 +0800 Subject: [PATCH 3/3] --flash-gpu-descriptor: dry-run skip bay power control Signed-off-by: Daniel Schaefer --- framework_lib/src/chromium_ec/mod.rs | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/framework_lib/src/chromium_ec/mod.rs b/framework_lib/src/chromium_ec/mod.rs index d358270..a9e9691 100644 --- a/framework_lib/src/chromium_ec/mod.rs +++ b/framework_lib/src/chromium_ec/mod.rs @@ -1356,15 +1356,20 @@ impl CrosEc { if let Ok(ExpansionBayBoard::DualInterposer) = info.expansion_bay_board() { // If bay power is on already, we don't need to enable/disable it if !self.get_gpio("gpu_3v_5v_en")? { - // Force power to the GPU if we are writing the EEPROM - let res = self.set_gpio("gpu_3v_5v_en", true); - if let Err(err) = res { - error!("Failed to set ALW power to GPU on {:?}", err); - return Err(err); + println!("Expansion Bay Power is Off"); + if dry_run { + println!("Forcing Power to Expansion Bay (skip - dry-run)"); + } else { + // Force power to the GPU if we are writing the EEPROM + let res = self.set_gpio("gpu_3v_5v_en", true); + if let Err(err) = res { + error!("Failed to set ALW power to GPU on {:?}", err); + return Err(err); + } + println!("Forcing Power to Expansion Bay"); + os_specific::sleep(100_000); + force_power = true; } - println!("Forcing Power to GPU"); - os_specific::sleep(100_000); - force_power = true; } }