Page MenuHomeFreeBSD

intel/intel_pmc_core: Add Intel PMC Core driver
Needs ReviewPublic

Authored by guest-seuros on Mon, Jan 26, 1:54 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Feb 1, 5:02 PM
Unknown Object (File)
Sun, Feb 1, 5:02 PM
Unknown Object (File)
Fri, Jan 30, 1:03 AM
Unknown Object (File)
Tue, Jan 27, 3:01 AM
Unknown Object (File)
Mon, Jan 26, 7:21 PM
Unknown Object (File)
Mon, Jan 26, 5:18 PM
Unknown Object (File)
Mon, Jan 26, 3:29 PM
Unknown Object (File)
Mon, Jan 26, 2:01 PM
Subscribers

Details

Reviewers
adrian
obiwac
Summary

Add driver for Intel Power Management Controller (PMC) found on Sunrise Point PCH chipsets.
This device exposes S0ix sleep state residency counters and power management status.

Sysctls provided:

dev.intel_pmc_core.0.slp_s0_residency_us - Time in deepest sleep (us)
dev.intel_pmc_core.0.ltr_ignore          - LTR ignore mask
dev.intel_pmc_core.0.pm_cfg              - PM configuration register
dev.intel_pmc_core.0.pm_sts              - PM status register
dev.intel_pmc_core.0.access_denied       - Firmware lock status

Supported devices for now:

  • Sunrise Point-LP (0x9D21)
  • Sunrise Point-H (0xA121)

Note: Later PCH generations (Cannon Lake, Tiger Lake, ect.) have different PMC register layouts according to the datasheet and would need per-generation tables.
I avoided adding untested hardware in case they have a quirk.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 70387
Build 67270: arc lint + arc unit

Event Timeline

guest-seuros created this revision.

Cool that someone is working on an intel PMC driver!

I don't have time today to do a more in depth review, but here's a couple small comments already. I'll review this more fully this evening or tomorrow

sys/dev/intel/intel_pmc_core.c
2–16

The SPDX identifier should be the first line of the copyright header, and maybe make the driver description a separate comment to the copyright header.

Also if you want to you could add your name as such:

* This software was developed by Abdelkader Boudih <guest-seuros@freebsd.org>
* under sponsorship from the FreeBSD Foundation.
92–103

a lot of this code could be factored out into a function which takes in oidp, req, and an offset, esp as we add sysctls for a bunch of the other registers.

175–178

I haven't read the docs yet so this might be a dumb question, but what is this register counting exactly? in theory a system using S0ix for suspend is always in S0. Or is this counting how much time the system is residing in _any_ S0ix state? perhaps the description could be updated if so.

sys/dev/intel/intel_pmc_core.c
2–16

sorry, wrongly assumed you were working for the foundation.

You can just put your name straight in the copyright notice then:

/*
 * SPDX-License-Identifier: BSD-2-Clause
 *
 * Copyright (c) 2026 Abdelkader Boudih <your@email.com>
 */
70–72
164–166

Add files.x86 and modules entries; align slp_s0_residency sysctl name