hwpstate: Add CPPC enable tunable

The Framework 13 runs very hot the maximum frequency is possible. By
disabling CPPC (reverting to Cool`n'Quiet 2.0) we can use powerd to
limit the CPU frequency to 2200, thereby reducing the CPU temperature.

Some systems may run slower with CPPC enabled. See PR/292615 for that
bug.

Those experiencing either of these issues may add the following to
their loader.conf or device.hints to disable CPPC:

machdep.hwpstate_amd_cppc_enable="0"

PR:			292615
Reviewed by:		lwhsu, olce
Differential revision:	https://reviews.freebsd.org/D54803
This commit is contained in:
Cy Schubert
2026-01-04 20:53:51 -08:00
parent eacc501eff
commit ad9932995c
+7 -1
View File
@@ -179,6 +179,11 @@ SYSCTL_BOOL(_machdep, OID_AUTO, hwpstate_pkg_ctrl, CTLFLAG_RDTUN,
&hwpstate_pkg_ctrl_enable, 0,
"Set 1 (default) to enable package-level control, 0 to disable");
static bool hwpstate_amd_cppc_enable = true;
SYSCTL_BOOL(_machdep, OID_AUTO, hwpstate_amd_cppc_enable, CTLFLAG_RDTUN,
&hwpstate_amd_cppc_enable, 0,
"Set 1 (default) to enable AMD CPPC, 0 to disable");
static device_method_t hwpstate_methods[] = {
/* Device interface */
DEVMETHOD(device_identify, hwpstate_identify),
@@ -667,7 +672,8 @@ hwpstate_probe(device_t dev)
sc = device_get_softc(dev);
if (amd_extended_feature_extensions & AMDFEID_CPPC) {
if (hwpstate_amd_cppc_enable &&
(amd_extended_feature_extensions & AMDFEID_CPPC)) {
sc->flags |= PSTATE_CPPC;
device_set_desc(dev,
"AMD Collaborative Processor Performance Control (CPPC)");