Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 16 additions & 8 deletions framework_lib/src/chromium_ec/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1354,15 +1354,23 @@ 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")? {
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;
}
}
Comment on lines 1356 to 1373
Copy link

Copilot AI Mar 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dry_run currently skips the actual EEPROM writes inside the chunk loop, but the bay-power GPIO manipulation and the initial sleep still run even in dry-run mode. This means --dry-run can still change hardware power state (and potentially impact a running OS/driver). Consider guarding the get_gpio/set_gpio/sleep block (and the later power-off restore) with if !dry_run, consistent with other flash paths in this module.

Copilot uses AI. Check for mistakes.
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm that's a good idea

println!("Forcing Power to GPU");
os_specific::sleep(100_000);
force_power = true;
}

// Need to program the EEPROM 32 bytes at a time.
Expand Down
Loading