Skip to content

peci: Rewrite support - #580

Draft
crawfxrd wants to merge 3 commits into
masterfrom
dev/peci-rewrite
Draft

crawfxrd wants to merge 3 commits into
masterfrom
dev/peci-rewrite

Conversation

@crawfxrd

@crawfxrd crawfxrd commented Nov 20, 2026 •

Copy link
Copy Markdown
Member

Rewrite PECI support, moving most of it out of the app and into:

  • SoC-specific implementations
  • A generic driver

Some POSIX errno values are added and used in an attempt to set some
standard for error handling, replacing the arbitrary -0xX000 values
previously used.

Improvements

  • Consolidates transaction logic into a single function
  • Adds Ping(), GetDIB(), RdPkgConfig(), RdIAMSR()
  • Improves support for handling package capabilities ({Rd,Wr}PkgConfig())
  • Replaces hard-coded Tjmax value in GetTemp() calculation
  • legacy: Enables additional error checking on transactions
  • espi: Adds upstream channel checks to avoid bus contention
  • espi: Adds Assured Write FCS calculation

Ref: IT5570E V0.3.2 datasheet
Ref: MTL PECI 4.0 Implementation Guide (#630138)
Ref: eSPI 1.6 Base Specification (#841685)

Related issues

Future work

  • Add retries on supported commands/errors
  • Refactor eSPI logic for generic use of OOB channel (support other tunneled protocols)

Some functions return arbitrary negative values for errors. Add some
common POSIX errno values that can be used instead.

Signed-off-by: Tim Crawford <tcrawford@system76.com>
These boards use PECI over eSPI. Per the schematics, the H_PECI wire is
not connected.

GPF6 defaults to GPI, so set it to to input with an internal pull down
to avoid floating.

Signed-off-by: Tim Crawford <tcrawford@system76.com>
@crawfxrd
crawfxrd force-pushed the dev/peci-rewrite branch 3 times, most recently from 4b05cb8 to 34df1af Compare November 24, 2026 21:48
@crawfxrd crawfxrd changed the title [WIP] peci: Rewrite peci: Rewrite support Nov 24, 2026
@crawfxrd
crawfxrd force-pushed the dev/peci-rewrite branch 3 times, most recently from 5381c46 to 9c94366 Compare November 24, 2026 23:11
Rewrite PECI support, moving most of it out of the app and into:

- SoC-specific implementations
- A generic driver

Improvements:

- Consolidates transaction logic into a single function
- Adds Ping(), GetDIB(), RdPkgConfig(), RdIAMSR()
- Improves support for handling package capabilities ({Rd,Wr}PkgConfig())
- Replaces hard-coded Tjmax value in GetTemp() calculation
- legacy: Enables additional error checking on transactions
- espi: Adds upstream channel checks to avoid bus contention
- espi: Adds Assured Write FCS calculation

Ref: IT5570E V0.3.2 datasheet
Ref: MTL PECI 4.0 Implementation Guide (#630138)
Ref: eSPI 1.6 Base Specification (#841685)
Signed-off-by: Tim Crawford <tcrawford@system76.com>
@crawfxrd

Copy link
Copy Markdown
Member Author

Testing on darp10 (legacy wire), RdPkConfig() for Tjmax always returns 0x80 (PECI_CC_RSP_TIMEOUT). GetTemp() by itself works.

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.

lemp13-b: EC CPU temperature reads ~10 °C low (PECI uses T_JUNCTION=100, CPU TjMax is 110 °C), so the fan starts late

1 participant