summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsobomax <sobomax@FreeBSD.org>2004-08-23 09:47:56 +0000
committersobomax <sobomax@FreeBSD.org>2004-08-23 09:47:56 +0000
commitfe731a9733a7b3d4274a54761f8cf9ca846d036a (patch)
tree6bf5ccdca41508e7259b3ebc36308db2d721b1bd
parent529a80f729d1d9b5f7ce84a361f5812575bd9f38 (diff)
downloadFreeBSD-src-fe731a9733a7b3d4274a54761f8cf9ca846d036a.zip
FreeBSD-src-fe731a9733a7b3d4274a54761f8cf9ca846d036a.tar.gz
o Extend boot output: print out mimimum/maximum performance value and number
of performance steps available; o similarly to Enhanced SpeedStep driver, export list of all available steps via hw.p4tcc.cpuperf_levels sysctl.
-rw-r--r--sys/i386/cpufreq/p4tcc.c20
-rw-r--r--sys/i386/i386/p4tcc.c20
2 files changed, 38 insertions, 2 deletions
diff --git a/sys/i386/cpufreq/p4tcc.c b/sys/i386/cpufreq/p4tcc.c
index cec2f58..84444c6 100644
--- a/sys/i386/cpufreq/p4tcc.c
+++ b/sys/i386/cpufreq/p4tcc.c
@@ -191,11 +191,15 @@ p4tcc_profile_sysctl(SYSCTL_HANDLER_ARGS)
static void
setup_p4tcc(void *dummy __unused)
{
+ int nsteps, i;
+ static char p4tcc_levels[(3 * TCC_LEVELS) + 1];
+ char buf[4 + 1];
if ((cpu_feature & (CPUID_ACPI | CPUID_TM)) !=
(CPUID_ACPI | CPUID_TM))
return;
+ nsteps = TCC_LEVELS;
switch (cpu_id & 0xf) {
case 0x22: /* errata O50 P44 and Z21 */
case 0x24:
@@ -204,6 +208,7 @@ setup_p4tcc(void *dummy __unused)
case 0x29:
/* hang with 12.5 */
tcc[TCC_LEVELS - 1] = tcc[TCC_LEVELS - 2];
+ nsteps -= 1;
break;
case 0x07: /* errata N44 and P18 */
case 0x0a:
@@ -211,16 +216,24 @@ setup_p4tcc(void *dummy __unused)
case 0x13:
/* hang at 12.5 and 25 */
tcc[TCC_LEVELS - 1] = tcc[TCC_LEVELS - 2] = tcc[TCC_LEVELS - 3];
+ nsteps -= 2;
break;
default:
break;
}
+ p4tcc_levels[0] = '\0';
+ for (i = nsteps; i > 0; i--) {
+ sprintf(buf, "%d%s", tcc[i - 1].rlevel, (i != 1) ? " " : "");
+ strcat(p4tcc_levels, buf);
+ }
+
p4tcc_economy = tcc[TCC_LEVELS - 1].rlevel;
p4tcc_performance = tcc[0].rlevel;
p4tcc_percentage = p4tcc_getperf();
- printf("Pentium 4 TCC support enabled, current performance %u%%\n",
+ printf("Pentium 4 TCC support enabled, %d steps from 100%% to %d%%, "
+ "current performance %u%%\n", nsteps, p4tcc_economy,
p4tcc_percentage);
sysctl_ctx_init(&p4tcc_sysctl_ctx);
@@ -242,6 +255,11 @@ setup_p4tcc(void *dummy __unused)
"cpuperf_economy", CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_RW,
&p4tcc_economy, 0, p4tcc_profile_sysctl, "I",
"CPU performance in % of maximum in Economy mode");
+ SYSCTL_ADD_STRING(&p4tcc_sysctl_ctx,
+ SYSCTL_CHILDREN(p4tcc_sysctl_tree), OID_AUTO,
+ "cpuperf_levels", CTLFLAG_RD, p4tcc_levels, 0,
+ "Perormance levels supported by the Pentium 4 Thermal Control "
+ "Circuitry");
/* register performance profile change handler */
EVENTHANDLER_REGISTER(power_profile_change, p4tcc_power_profile, NULL, 0);
diff --git a/sys/i386/i386/p4tcc.c b/sys/i386/i386/p4tcc.c
index cec2f58..84444c6 100644
--- a/sys/i386/i386/p4tcc.c
+++ b/sys/i386/i386/p4tcc.c
@@ -191,11 +191,15 @@ p4tcc_profile_sysctl(SYSCTL_HANDLER_ARGS)
static void
setup_p4tcc(void *dummy __unused)
{
+ int nsteps, i;
+ static char p4tcc_levels[(3 * TCC_LEVELS) + 1];
+ char buf[4 + 1];
if ((cpu_feature & (CPUID_ACPI | CPUID_TM)) !=
(CPUID_ACPI | CPUID_TM))
return;
+ nsteps = TCC_LEVELS;
switch (cpu_id & 0xf) {
case 0x22: /* errata O50 P44 and Z21 */
case 0x24:
@@ -204,6 +208,7 @@ setup_p4tcc(void *dummy __unused)
case 0x29:
/* hang with 12.5 */
tcc[TCC_LEVELS - 1] = tcc[TCC_LEVELS - 2];
+ nsteps -= 1;
break;
case 0x07: /* errata N44 and P18 */
case 0x0a:
@@ -211,16 +216,24 @@ setup_p4tcc(void *dummy __unused)
case 0x13:
/* hang at 12.5 and 25 */
tcc[TCC_LEVELS - 1] = tcc[TCC_LEVELS - 2] = tcc[TCC_LEVELS - 3];
+ nsteps -= 2;
break;
default:
break;
}
+ p4tcc_levels[0] = '\0';
+ for (i = nsteps; i > 0; i--) {
+ sprintf(buf, "%d%s", tcc[i - 1].rlevel, (i != 1) ? " " : "");
+ strcat(p4tcc_levels, buf);
+ }
+
p4tcc_economy = tcc[TCC_LEVELS - 1].rlevel;
p4tcc_performance = tcc[0].rlevel;
p4tcc_percentage = p4tcc_getperf();
- printf("Pentium 4 TCC support enabled, current performance %u%%\n",
+ printf("Pentium 4 TCC support enabled, %d steps from 100%% to %d%%, "
+ "current performance %u%%\n", nsteps, p4tcc_economy,
p4tcc_percentage);
sysctl_ctx_init(&p4tcc_sysctl_ctx);
@@ -242,6 +255,11 @@ setup_p4tcc(void *dummy __unused)
"cpuperf_economy", CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_RW,
&p4tcc_economy, 0, p4tcc_profile_sysctl, "I",
"CPU performance in % of maximum in Economy mode");
+ SYSCTL_ADD_STRING(&p4tcc_sysctl_ctx,
+ SYSCTL_CHILDREN(p4tcc_sysctl_tree), OID_AUTO,
+ "cpuperf_levels", CTLFLAG_RD, p4tcc_levels, 0,
+ "Perormance levels supported by the Pentium 4 Thermal Control "
+ "Circuitry");
/* register performance profile change handler */
EVENTHANDLER_REGISTER(power_profile_change, p4tcc_power_profile, NULL, 0);
OpenPOWER on IntegriCloud