Fix flash_version() leaving SPI mux unlocked, turning LED pink#276
Merged
JohnAZoidberg merged 1 commit intomainfrom Mar 8, 2026
Merged
Fix flash_version() leaving SPI mux unlocked, turning LED pink#276JohnAZoidberg merged 1 commit intomainfrom
JohnAZoidberg merged 1 commit intomainfrom
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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