# intel/ecfw-zephyr architecture

> Architecture diagram of the GitHub repository intel/ecfw-zephyr, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-13). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/intel/ecfw-zephyr
- Repository: https://github.com/intel/ecfw-zephyr

## Overview

This is Intel EC firmware for prototyping and evaluation. Its boot path checks and initializes board hardware and eSPI, configures straps, then starts cooperative firmware tasks. Those tasks implement host-facing management, power-state sequencing, keyboard and peripheral control, and optional thermal and diagnostic services, using board-specific configuration and hardware-interface drivers. The README provides no detailed capability map; subsystem coverage also uses the source index. Several connections among unsampled modules are therefore omitted rather than inferred.

Main entry points: [`app/smchost/smchost.c`](https://github.com/intel/ecfw-zephyr/blob/master/app/smchost/smchost.c) (SMC host service), [`app/power_sequencing/pwrplane.c`](https://github.com/intel/ecfw-zephyr/blob/master/app/power_sequencing/pwrplane.c) (Power sequencing), [`misc/task_handler.c`](https://github.com/intel/ecfw-zephyr/blob/master/misc/task_handler.c) (Task scheduler), [`app/peripheral_management/periphmgmt.c`](https://github.com/intel/ecfw-zephyr/blob/master/app/peripheral_management/periphmgmt.c) (Peripheral management)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_startup["Startup and board"]
  node_firmware["Firmware entry<br/>[app.c]"]
  node_board["Board setup<br/>[board.c]"]
  node_board_config["Board configuration<br/>[board_config.h]"]
  node_scheduler["Task scheduler<br/>[task_handler.c]"]
end

subgraph group_power["Power control"]
  node_powerseq["Power sequencing<br/>[pwrplane.c]"]
  node_power_modes["Sleep mode handling<br/>[deepsx.c]"]
  node_power_helpers["Power sequence helpers<br/>[pwrseq_utils.h]"]
end

subgraph group_host["Host services"]
  node_smchost["SMC host service<br/>[smchost.c]"]
  node_smc["ACPI SMC interface<br/>[smc.c]"]
  node_sci["SCI events<br/>[sci.h]"]
  node_keyboard["Keyboard host service<br/>[kbchost.c]"]
  node_peripherals["Peripheral management<br/>[periphmgmt.c]"]
  node_power_button["Power button management<br/>[pwrbtnmgmt.c]"]
end

subgraph group_platform["Platform features"]
  node_thermal["Thermal management<br/>[thermalmgmt.c]"]
  node_dtt["Thermal tuning<br/>[dtt_thermals.c]"]
  node_saf["Serial flash support<br/>[saf_flash_config.c]"]
  node_dnx["Download and execute<br/>[dnx.c]"]
  node_diagnostics["Postcode diagnostics<br/>[postcodemgmt.c]"]
  node_soc_debug["SoC debug awareness<br/>[soc_debug.c]"]
end

subgraph group_drivers["Hardware interfaces"]
  node_espi["eSPI hub<br/>[espi_hub.c]"]
  node_gpio["EC GPIO<br/>[gpio_ec.h]"]
  node_keymatrix["Keyboard matrix<br/>[kbs_matrix.c]"]
  node_peci["PECI hub<br/>[peci_hub.c]"]
  node_oob["eSPI OOB manager<br/>[espioob_mngr.c]"]
end

node_host_actor(("Host / BIOS"))

node_firmware -->|"checks and initializes"| node_board
node_firmware -->|"initializes"| node_espi
node_firmware -->|"starts tasks"| node_scheduler
node_board -->|"uses platform config"| node_board_config
node_scheduler -->|"starts task"| node_powerseq
node_scheduler -->|"starts task"| node_smchost
node_scheduler -->|"starts task"| node_keyboard
node_scheduler -->|"starts task"| node_peripherals
node_scheduler -->|"starts optional task"| node_thermal
node_scheduler -->|"starts optional task"| node_diagnostics
node_powerseq -->|"uses eSPI signals"| node_espi
node_powerseq -->|"uses sleep modes"| node_power_modes
node_powerseq -->|"uses helpers"| node_power_helpers
node_powerseq -->|"reads and drives"| node_gpio
node_powerseq -->|"uses flash configuration"| node_saf
node_smchost -->|"dispatches host commands"| node_smc
node_smchost -->|"uses host bus"| node_espi
node_smchost -->|"calls management"| node_peripherals
node_smchost -->|"uses power state"| node_powerseq
node_smchost -->|"uses PECI"| node_peci
node_smc -->|"uses SCI interface"| node_sci
node_keyboard -->|"uses matrix"| node_keymatrix
node_keyboard -->|"uses host bus"| node_espi
node_peripherals -->|"uses button management"| node_power_button
node_peripherals -->|"uses host interface"| node_smchost
node_peripherals -->|"uses GPIO"| node_gpio
node_thermal -->|"updates host state"| node_smchost
node_thermal -->|"requests shutdown"| node_powerseq
node_thermal -->|"uses temperature data"| node_peci
node_thermal -->|"uses OOB manager"| node_oob
node_dnx -->|"uses eSPI"| node_espi
node_dnx -->|"uses GPIO"| node_gpio
node_diagnostics -->|"registers postcode handler"| node_espi
node_diagnostics -.->|"reports postcodes"| node_host_actor
node_host_actor -.->|"sends management requests"| node_smchost
node_host_actor -.->|"uses keyboard interface"| node_keyboard
node_soc_debug -->|"uses peripheral state"| node_peripherals
node_soc_debug -->|"uses keyboard matrix"| node_keymatrix

click node_firmware "https://github.com/intel/ecfw-zephyr/blob/master/app/app.c"
click node_board "https://github.com/intel/ecfw-zephyr/blob/master/boards/board.c"
click node_board_config "https://github.com/intel/ecfw-zephyr/blob/master/boards/board_config.h"
click node_scheduler "https://github.com/intel/ecfw-zephyr/blob/master/misc/task_handler.c"
click node_powerseq "https://github.com/intel/ecfw-zephyr/blob/master/app/power_sequencing/pwrplane.c"
click node_power_modes "https://github.com/intel/ecfw-zephyr/blob/master/app/power_sequencing/deepsx.c"
click node_power_helpers "https://github.com/intel/ecfw-zephyr/blob/master/app/power_sequencing/pwrseq_utils.h"
click node_smchost "https://github.com/intel/ecfw-zephyr/blob/master/app/smchost/smchost.c"
click node_smc "https://github.com/intel/ecfw-zephyr/blob/master/app/smchost/smc.c"
click node_sci "https://github.com/intel/ecfw-zephyr/blob/master/app/smchost/sci.h"
click node_keyboard "https://github.com/intel/ecfw-zephyr/blob/master/app/kbchost/kbchost.c"
click node_peripherals "https://github.com/intel/ecfw-zephyr/blob/master/app/peripheral_management/periphmgmt.c"
click node_power_button "https://github.com/intel/ecfw-zephyr/blob/master/app/peripheral_management/pwrbtnmgmt.c"
click node_thermal "https://github.com/intel/ecfw-zephyr/blob/master/app/thermal_management/thermalmgmt.c"
click node_dtt "https://github.com/intel/ecfw-zephyr/blob/master/app/dtt/dtt_thermals.c"
click node_saf "https://github.com/intel/ecfw-zephyr/blob/master/app/saf/saf_flash_config.c"
click node_dnx "https://github.com/intel/ecfw-zephyr/blob/master/app/dnx/dnx.c"
click node_diagnostics "https://github.com/intel/ecfw-zephyr/blob/master/app/debug/postcodemgmt.c"
click node_soc_debug "https://github.com/intel/ecfw-zephyr/blob/master/app/soc_debug_awareness/soc_debug.c"
click node_espi "https://github.com/intel/ecfw-zephyr/blob/master/drivers/espi_hub.c"
click node_gpio "https://github.com/intel/ecfw-zephyr/blob/master/drivers/gpio_ec.h"
click node_keymatrix "https://github.com/intel/ecfw-zephyr/blob/master/drivers/kbs_matrix.c"
click node_peci "https://github.com/intel/ecfw-zephyr/blob/master/drivers/peci_hub.c"
click node_oob "https://github.com/intel/ecfw-zephyr/blob/master/drivers/espioob_mngr.c"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_firmware,node_board,node_board_config,node_scheduler toneBlue
class node_powerseq,node_power_modes,node_power_helpers toneAmber
class node_smchost,node_smc,node_sci,node_keyboard,node_peripherals,node_power_button toneMint
class node_thermal,node_dtt,node_saf,node_dnx,node_diagnostics,node_soc_debug toneRose
class node_espi,node_gpio,node_keymatrix,node_peci,node_oob,node_host_actor toneIndigo
```

## Components

### Startup and board

- [Firmware entry](https://github.com/intel/ecfw-zephyr/blob/master/app/app.c): `app/app.c`
- [Board setup](https://github.com/intel/ecfw-zephyr/blob/master/boards/board.c): `boards/board.c`
- [Board configuration](https://github.com/intel/ecfw-zephyr/blob/master/boards/board_config.h): `boards/board_config.h`
- [Task scheduler](https://github.com/intel/ecfw-zephyr/blob/master/misc/task_handler.c): `misc/task_handler.c`

### Power control

- [Power sequencing](https://github.com/intel/ecfw-zephyr/blob/master/app/power_sequencing/pwrplane.c): `app/power_sequencing/pwrplane.c`
- [Sleep mode handling](https://github.com/intel/ecfw-zephyr/blob/master/app/power_sequencing/deepsx.c): `app/power_sequencing/deepsx.c`
- [Power sequence helpers](https://github.com/intel/ecfw-zephyr/blob/master/app/power_sequencing/pwrseq_utils.h): `app/power_sequencing/pwrseq_utils.h`

### Host services

- [SMC host service](https://github.com/intel/ecfw-zephyr/blob/master/app/smchost/smchost.c): `app/smchost/smchost.c`
- [ACPI SMC interface](https://github.com/intel/ecfw-zephyr/blob/master/app/smchost/smc.c): `app/smchost/smc.c`
- [SCI events](https://github.com/intel/ecfw-zephyr/blob/master/app/smchost/sci.h): `app/smchost/sci.h`
- [Keyboard host service](https://github.com/intel/ecfw-zephyr/blob/master/app/kbchost/kbchost.c): `app/kbchost/kbchost.c`
- [Peripheral management](https://github.com/intel/ecfw-zephyr/blob/master/app/peripheral_management/periphmgmt.c): `app/peripheral_management/periphmgmt.c`
- [Power button management](https://github.com/intel/ecfw-zephyr/blob/master/app/peripheral_management/pwrbtnmgmt.c): `app/peripheral_management/pwrbtnmgmt.c`

### Platform features

- [Thermal management](https://github.com/intel/ecfw-zephyr/blob/master/app/thermal_management/thermalmgmt.c): `app/thermal_management/thermalmgmt.c`
- [Thermal tuning](https://github.com/intel/ecfw-zephyr/blob/master/app/dtt/dtt_thermals.c): `app/dtt/dtt_thermals.c`
- [Serial flash support](https://github.com/intel/ecfw-zephyr/blob/master/app/saf/saf_flash_config.c): `app/saf/saf_flash_config.c`
- [Download and execute](https://github.com/intel/ecfw-zephyr/blob/master/app/dnx/dnx.c): `app/dnx/dnx.c`
- [Postcode diagnostics](https://github.com/intel/ecfw-zephyr/blob/master/app/debug/postcodemgmt.c): `app/debug/postcodemgmt.c`
- [SoC debug awareness](https://github.com/intel/ecfw-zephyr/blob/master/app/soc_debug_awareness/soc_debug.c): `app/soc_debug_awareness/soc_debug.c`

### Hardware interfaces

- [eSPI hub](https://github.com/intel/ecfw-zephyr/blob/master/drivers/espi_hub.c): `drivers/espi_hub.c`
- [EC GPIO](https://github.com/intel/ecfw-zephyr/blob/master/drivers/gpio_ec.h): `drivers/gpio_ec.h`
- [Keyboard matrix](https://github.com/intel/ecfw-zephyr/blob/master/drivers/kbs_matrix.c): `drivers/kbs_matrix.c`
- [PECI hub](https://github.com/intel/ecfw-zephyr/blob/master/drivers/peci_hub.c): `drivers/peci_hub.c`
- [eSPI OOB manager](https://github.com/intel/ecfw-zephyr/blob/master/drivers/espioob_mngr.c): `drivers/espioob_mngr.c`

### Other components

- **Host / BIOS**

## Connections

- Firmware entry → Board setup: checks and initializes (evidence: `app/app.c`)
- Firmware entry → eSPI hub: initializes (evidence: `app/app.c`)
- Firmware entry → Task scheduler: starts tasks (evidence: `app/app.c`)
- Board setup → Board configuration: uses platform config (evidence: `boards/board.c`)
- Task scheduler → Power sequencing: starts task (evidence: `misc/task_handler.c`)
- Task scheduler → SMC host service: starts task (evidence: `misc/task_handler.c`)
- Task scheduler → Keyboard host service: starts task (evidence: `misc/task_handler.c`)
- Task scheduler → Peripheral management: starts task (evidence: `misc/task_handler.c`)
- Task scheduler → Thermal management: starts optional task (evidence: `misc/task_handler.c`)
- Task scheduler → Postcode diagnostics: starts optional task (evidence: `misc/task_handler.c`)
- Power sequencing → eSPI hub: uses eSPI signals (evidence: `app/power_sequencing/pwrplane.c`)
- Power sequencing → Sleep mode handling: uses sleep modes (evidence: `app/power_sequencing/pwrplane.c`)
- Power sequencing → Power sequence helpers: uses helpers (evidence: `app/power_sequencing/pwrplane.c`)
- Power sequencing → EC GPIO: reads and drives (evidence: `app/power_sequencing/pwrplane.c`)
- Power sequencing → Serial flash support: uses flash configuration (evidence: `app/power_sequencing/pwrplane.c`)
- SMC host service → ACPI SMC interface: dispatches host commands (evidence: `app/smchost/smchost.c`)
- SMC host service → eSPI hub: uses host bus (evidence: `app/smchost/smchost.c`)
- SMC host service → Peripheral management: calls management (evidence: `app/smchost/smchost.c`)
- SMC host service → Power sequencing: uses power state (evidence: `app/smchost/smchost.c`)
- SMC host service → PECI hub: uses PECI (evidence: `app/smchost/smchost.c`)
- ACPI SMC interface → SCI events: uses SCI interface (evidence: `app/smchost/smc.c`)
- Keyboard host service → Keyboard matrix: uses matrix (evidence: `app/kbchost/kbchost.c`)
- Keyboard host service → eSPI hub: uses host bus (evidence: `app/kbchost/kbchost.c`)
- Peripheral management → Power button management: uses button management (evidence: `app/peripheral_management/periphmgmt.c`)
- Peripheral management → SMC host service: uses host interface (evidence: `app/peripheral_management/periphmgmt.c`)
- Peripheral management → EC GPIO: uses GPIO (evidence: `app/peripheral_management/periphmgmt.c`)
- Thermal management → SMC host service: updates host state (evidence: `app/thermal_management/thermalmgmt.c`)
- Thermal management → Power sequencing: requests shutdown
- Thermal management → PECI hub: uses temperature data (evidence: `app/thermal_management/thermalmgmt.c`)
- Thermal management → eSPI OOB manager: uses OOB manager (evidence: `app/thermal_management/thermalmgmt.c`)
- Download and execute → eSPI hub: uses eSPI (evidence: `app/dnx/dnx.c`)
- Download and execute → EC GPIO: uses GPIO (evidence: `app/dnx/dnx.c`)
- Postcode diagnostics → eSPI hub: registers postcode handler (evidence: `app/debug/postcodemgmt.c`)
- Postcode diagnostics → Host / BIOS: reports postcodes (evidence: `app/debug/postcodemgmt.c`)
- Host / BIOS → SMC host service: sends management requests
- Host / BIOS → Keyboard host service: uses keyboard interface (evidence: `app/kbchost/kbchost.c`)
- SoC debug awareness → Peripheral management: uses peripheral state (evidence: `app/soc_debug_awareness/soc_debug.c`)
- SoC debug awareness → Keyboard matrix: uses keyboard matrix (evidence: `app/soc_debug_awareness/soc_debug.c`)
