coreboot/src/ec
Matt DeVillier c0998983d0 ec/google/chromeec: Fix uninitialized buffer in cbi_get_uint32()
Commit e59c5abd13 ("ec/google/chromeec: Add
EC_GOOGLE_CHROMEEC_FW_CONFIG_FROM_UFSC") refactored cbi_get_uint32() to
write directly to the caller's buffer instead of using a local variable.
This caused uninitialized memory (containing garbage addresses) to be
passed to the EC as the return buffer during CBI reads.

In the case of google/zork, the call to
google_chromeec_cbi_get_board_version() returned garbage data (e.g.,
0xae6ccd05 vs 0x5)  which caused incorrect code paths to be taken:

- variant_override_gpio_table() selected wrong GPIO tables based on
  invalid board version comparisons
- variant_touchscreen_update() skipped touchscreen GPIO configuration
  because variant_uses_v3_6_schematics() returned true for garbage
  values
- variant_uses_codec_gpi() returned wrong value, preventing
  headphone jack interrupt setup

These misconfigurations caused input devices (touchpad, touchscreen,
trackpoint) to be non-functional, despite being detected by the OS.

The fix restores the original behavior by using a local variable
initialized to 0, ensuring a clean buffer is always passed to the EC.

TEST=build/boot google/zork, verify board version is read correctly,
all input devices functional under Linux/Windows.

Change-Id: Ia7be0bcc588075ab5c994edc3d68e979cc01ac79
Signed-off-by: Matt DeVillier <matt.devillier@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/90761
Reviewed-by: Yu-Ping Wu <yupingso@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2026-01-17 23:40:19 +00:00
..
51nb/npce985la0dx
acpi ec/acpi/ec.c: Promote timeout messages to errors 2025-01-22 20:20:44 +00:00
apple/acpi
clevo/it5570e Remove <swab.h> and swabXX() functions 2025-12-12 07:09:45 +00:00
compal/ene932
dasharo/ec ec/dasharo/ec: Add DTT power and battery participants 2025-06-06 13:13:59 +00:00
dell/mec5035 ec/dell/mec5035: Route power button event to host 2025-11-19 13:59:08 +00:00
google ec/google/chromeec: Fix uninitialized buffer in cbi_get_uint32() 2026-01-17 23:40:19 +00:00
hp/kbc1126 ec/hp/kbc1126/acpi: Drop unnecessary _STA methods 2024-03-16 15:20:04 +00:00
intel ec/intel: read board ID one time from EC per stage 2025-04-29 18:53:04 +00:00
kontron
lenovo ec/lenovo/h8: Turn on PWR LED 2025-09-03 18:03:05 +00:00
purism tree: Remove unused <stddef.h> 2024-05-29 02:51:20 +00:00
quanta
roda/it8518
smsc/mec1308
starlabs/merlin ec/starlabs/merlin: Reorganize Kconfig and guard options properly 2025-12-29 23:59:52 +00:00
system76/ec ec/system76/ec: Add config for 2nd fan without GPU 2025-05-14 18:08:44 +00:00
ec.h