Commit Graph

4 Commits

Author SHA1 Message Date
Simone e9a90d63ac i2c-imc-skylake: final v3 submission fixes
- Rewrite timeout comments with single-board test data (drop
  multi-board validation claim not backed by the test campaign)
- Reword CLTT arbitration comment as verified observation, drop TODO
- Drop CONFIG_ACPI fallback stub; Kconfig already depends on ACPI
- Quiet probe: demote informational messages to dev_dbg()
- Kconfig: allow COMPILE_TEST builds
- Cover letter: v3 subject prefix, complete changes-since-v2 list,
  updated diffstat, drop stray Signed-off-by, fix GO-bit wording
- Ignore local reviewer Q&A notes
2026-07-02 12:48:30 +02:00
Simone 3c86f6c866 docs: correct i2cdetect usage and ignore archived notes
The engine exposes only SMBus BYTE_DATA/WORD_DATA, so i2cdetect (which
needs SMBus QUICK or READ_BYTE) cannot scan the bus. Replace the
misleading "i2cdetect -r/-y" scan instructions with a direct i2cget
byte-data read in the README, the cover letter and the smoke test.

Also gitignore the archived internal working documents
(docs/archive-*.md).

Signed-off-by: Simone Chifari <simone.chifari@gmail.com>
2026-06-27 20:11:37 +02:00
Simone fee48bba23 i2c-imc-skylake: apply LKML review fixes
Apply senior-review feedback to the driver, validated on hardware
(Skylake-X / X299). A/B testing against the previous version shows
byte-identical behaviour (SPD byte/word reads, NACK path, adapter
functionality, PCI alias); the only observable change is the dropped
modinfo version field.

  - Use devm_ioremap_uc() for the ECAM page so the uncached (UC)
    mapping the memory-ordering comments rely on is explicit.
  - Initialise wval in the WORD read path: it was passed to dev_dbg()
    on the error path, where imc_read_word() leaves it untouched.
  - Drop MODULE_VERSION() (discouraged for in-tree drivers).
  - Iterate over ARRAY_SIZE(s->adap) instead of the literal 2.
  - Name the config-space offsets (CFG_VENDOR_DEV, CFG_IMC_BUS).
  - Restrict Kconfig to X86_64 (Skylake-X is 64-bit only).
  - Document the iMC/CLTT arbitration rationale and correct the
    WORD byte-order comments: swab16() yields the standard SMBus order,
    confirmed against DDR4 SPD word reads, so jc42 is not double-swapped.

Signed-off-by: Simone Chifari <simone.chifari@gmail.com>
2026-06-27 20:11:37 +02:00
Simone 4697ce3e3b i2c: imc-skylake: add driver for Intel Skylake-X iMC SMBus engine
Add a driver for the integrated memory controller (iMC) SMBus engine on
Intel Skylake-X / Cascade Lake-X processors (socket LGA 2066, platform
X299, PCU function 8086:2085).

The engine provides two SMBus channels — one per pair of DIMM slots —
over which SPD EEPROMs, DDR4 thermal sensors and third-party LED
controllers are accessible. Exposing it as a pair of standard Linux I2C
adapters lets existing tools (i2c-tools, lm-sensors) use it without
bespoke sysfs hacks.

Key design decisions:
- ECAM MMIO access instead of CF8/CFC port I/O (SMM traps port writes)
- Dynamic MCFG table parsing for mmcfg_base (no hardcoding)
- Support for SMBus BYTE_DATA and WORD_DATA transfers
- devm-managed resources with automatic cleanup
- Global mutex to serialize transactions across both channels sharing
  the same ECAM mapping

Signed-off-by: Simone Chifari <simone.chifari@gmail.com>
2026-06-27 15:01:50 +02:00