How system76/ec works
System76 EC is embedded-controller firmware for System76 laptops, with companion host tools for EC access and firmware programming. Its principal product role is handling laptop hardware functions—power, charging, thermal sensing, keyboard, and related controller interfaces—while host-side tools provide access and flashing support. The tree exposes these major firmware domains and tool components, but the sampled sources do not show the firmware’s top-level dispatch wiring or the ectool CLI flow; those connections are therefore not inferred. The graph focuses on relationships directly visible in excerpts.
Main entry points: tps65987.c USB-PD driver · parallel.c Parallel interface · nvidia.c GPU telemetry · main.c Programmer entry
Components 19
EC firmware
- EC application
src/app/main/main.c - Power management
src/app/main/power/intel.c - Battery charging
src/app/main/battery.c - Fan control
src/app/main/fan/interp.c - Keyboard scan
src/app/main/kbscan.c - Keymaps
src/common/keymap.c - Flash handling
src/app/main/flash/main.c
Hardware drivers
- USB-PD driver
src/drivers/usbpd/tps65987.c - GPU telemetry
src/drivers/dgpu/nvidia.c - Flash security
src/drivers/security/security.c - EC I2C bus
src/ec/ite/i2c.c
Host tools
- EC command tool
tools/system76_ectool/src/main.rs - Linux LPC access
tools/system76_ectool/src/access/lpc/linux.rs - Command timeout
tools/system76_ectool/src/timeout.rs
Programmer
- Programmer entry
tools/mega2560/src/main.c - Parallel interface
tools/mega2560/src/parallel.c - Programmer GPIO
tools/mega2560/src/gpio.h - Programmer UART
tools/mega2560/src/uart.h
Other components
- Laptop hardware
Connections 11
- USB-PD driver → EC I2C bus: reads and writes
src/drivers/usbpd/tps65987.c - USB-PD driver → Power management: checks power state
src/drivers/usbpd/tps65987.c - USB-PD driver → Battery charging: updates charge limit
src/drivers/usbpd/tps65987.c - GPU telemetry → EC I2C bus: reads temperature
src/drivers/dgpu/nvidia.c - GPU telemetry → Power management: checks power state
src/drivers/dgpu/nvidia.c - Flash security → Laptop hardware: sets security GPIO
src/drivers/security/security.c - Programmer entry → Parallel interface: starts interface
tools/mega2560/src/main.c - Programmer entry → Programmer UART: initializes console
tools/mega2560/src/main.c - Parallel interface → Programmer GPIO: controls pins
tools/mega2560/src/parallel.c - Parallel interface → Programmer UART: serial transfers
tools/mega2560/src/parallel.c - Linux LPC access → Command timeout: waits with timeout
tools/system76_ectool/src/access/lpc/linux.rs