summaryrefslogtreecommitdiffstats
path: root/sys/dev/acpica
diff options
context:
space:
mode:
authornjl <njl@FreeBSD.org>2005-04-10 19:07:08 +0000
committernjl <njl@FreeBSD.org>2005-04-10 19:07:08 +0000
commitb6e8f5f503eaea3a8229e50ace0752e5dd4379db (patch)
tree910864546c17aa8d1741a97edd594ed966c44050 /sys/dev/acpica
parentc52e79424bd29ddc3d56a8a1108aac41dc8b05d8 (diff)
downloadFreeBSD-src-b6e8f5f503eaea3a8229e50ace0752e5dd4379db.zip
FreeBSD-src-b6e8f5f503eaea3a8229e50ace0752e5dd4379db.tar.gz
Fix support for _PDC by using the proper version/length format for the
buffer. Also, reference the Intel document where the _PDC values were found. This now supports ACPI-assisted SpeedStep on my borrowed T42.
Diffstat (limited to 'sys/dev/acpica')
-rw-r--r--sys/dev/acpica/acpi_cpu.c25
-rw-r--r--sys/dev/acpica/acpivar.h2
2 files changed, 24 insertions, 3 deletions
diff --git a/sys/dev/acpica/acpi_cpu.c b/sys/dev/acpica/acpi_cpu.c
index d320543..664a531 100644
--- a/sys/dev/acpica/acpi_cpu.c
+++ b/sys/dev/acpica/acpi_cpu.c
@@ -247,7 +247,8 @@ static int
acpi_cpu_attach(device_t dev)
{
ACPI_BUFFER buf;
- ACPI_OBJECT *obj;
+ ACPI_OBJECT arg, *obj;
+ ACPI_OBJECT_LIST arglist;
struct pcpu *pcpu_data;
struct acpi_cpu_softc *sc;
struct acpi_softc *acpi_sc;
@@ -255,6 +256,7 @@ acpi_cpu_attach(device_t dev)
u_int features;
int cpu_id, drv_count, i;
driver_t **drivers;
+ uint32_t cap_set[3];
ACPI_FUNCTION_TRACE((char *)(uintptr_t)__func__);
@@ -295,6 +297,7 @@ acpi_cpu_attach(device_t dev)
* Before calling any CPU methods, collect child driver feature hints
* and notify ACPI of them.
*/
+ sc->cpu_features = 0;
if (devclass_get_drivers(acpi_cpu_devclass, &drivers, &drv_count) == 0) {
for (i = 0; i < drv_count; i++) {
if (ACPI_GET_FEATURES(drivers[i], &features) == 0)
@@ -302,8 +305,24 @@ acpi_cpu_attach(device_t dev)
}
free(drivers, M_TEMP);
}
- if (sc->cpu_features)
- acpi_SetInteger(sc->cpu_dev, "_PDC", sc->cpu_features);
+
+ /*
+ * CPU capabilities are specified as a buffer of 32-bit integers:
+ * revision, count, and one or more capabilities. The revision of
+ * "1" is not specified anywhere but seems to match Linux. We should
+ * also support _OSC here.
+ */
+ if (sc->cpu_features) {
+ arglist.Pointer = &arg;
+ arglist.Count = 1;
+ arg.Type = ACPI_TYPE_BUFFER;
+ arg.Buffer.Length = sizeof(cap_set);
+ arg.Buffer.Pointer = (uint8_t *)cap_set;
+ cap_set[0] = 1; /* revision */
+ cap_set[1] = 1; /* number of capabilities integers */
+ cap_set[2] = sc->cpu_features;
+ AcpiEvaluateObject(sc->cpu_handle, "_PDC", &arglist, NULL);
+ }
/*
* Probe for Cx state support. If it isn't present, free up unused
diff --git a/sys/dev/acpica/acpivar.h b/sys/dev/acpica/acpivar.h
index 3935367..98f8caf 100644
--- a/sys/dev/acpica/acpivar.h
+++ b/sys/dev/acpica/acpivar.h
@@ -168,6 +168,8 @@ extern struct mtx acpi_mutex;
/*
* Various features and capabilities for the acpi_get_features() method.
* In particular, these are used for the ACPI 3.0 _PDC and _OSC methods.
+ * See the Intel document titled "Processor Driver Capabilities Bit
+ * Definitions", number 302223-002.
*/
#define ACPI_CAP_PERF_MSRS (1 << 0) /* Intel SpeedStep PERF_CTL MSRs */
#define ACPI_CAP_C1_IO_HALT (1 << 1) /* Intel C1 "IO then halt" sequence */
OpenPOWER on IntegriCloud