Skip to content

Fix flash_version() leaving SPI mux unlocked, turning LED pink#276

Merged
JohnAZoidberg merged 1 commit intomainfrom
versions-spi-lock
Mar 8, 2026
Merged

Fix flash_version() leaving SPI mux unlocked, turning LED pink#276
JohnAZoidberg merged 1 commit intomainfrom
versions-spi-lock

Conversation

@JohnAZoidberg
Copy link
Member

flash_version() sent EC_CMD_FLASH_NOTIFIED with AccessSpi (0x00) to unlock the SPI flash but never sent AccessSpiDone (0x03) to restore it.

On hx30 (12th Gen), GPIO_0056 is shared between the SPI flash clock (function 2) and the right-side green charging LED PWM (function 1). When AccessSpi is sent, the EC switches GPIO_0056 to SPI mode and disables the LED driver (GPIO_TYPEC_G_DRV2_EN). Without the matching AccessSpiDone, the green channel stays dead while red and blue continue normally, turning the white charging LED pink (R+B without G).

Send AccessSpiDone after reading the version to restore the mux, matching the pattern used by test_ec_flash_read() and get_entire_ec_flash().

Fixes #40

flash_version() sent EC_CMD_FLASH_NOTIFIED with AccessSpi (0x00) to
unlock the SPI flash but never sent AccessSpiDone (0x03) to restore it.

On hx30 (12th Gen), GPIO_0056 is shared between the SPI flash clock
(function 2) and the right-side green charging LED PWM (function 1).
When AccessSpi is sent, the EC switches GPIO_0056 to SPI mode and
disables the LED driver (GPIO_TYPEC_G_DRV2_EN). Without the matching
AccessSpiDone, the green channel stays dead while red and blue continue
normally, turning the white charging LED pink (R+B without G).

Send AccessSpiDone after reading the version to restore the mux,
matching the pattern used by test_ec_flash_read() and
get_entire_ec_flash().

Signed-off-by: Daniel Schaefer <dhs@frame.work>
@JohnAZoidberg JohnAZoidberg merged commit b649feb into main Mar 8, 2026
8 checks passed
@JohnAZoidberg JohnAZoidberg deleted the versions-spi-lock branch March 8, 2026 16:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

running with flag --versions turns (only) right-side charging LED pink

1 participant