diff options
author | Nate Lawson <njl@FreeBSD.org> | 2005-04-10 19:07:08 +0000 |
---|---|---|
committer | Nate Lawson <njl@FreeBSD.org> | 2005-04-10 19:07:08 +0000 |
commit | bce9288570069b6fd97a1c8f5ef084ec1bd523d4 (patch) | |
tree | 910864546c17aa8d1741a97edd594ed966c44050 | |
parent | 4b61852d3dedebb457a11a28d777dfbf4e8fa6e7 (diff) | |
download | src-bce9288570069b6fd97a1c8f5ef084ec1bd523d4.tar.gz src-bce9288570069b6fd97a1c8f5ef084ec1bd523d4.zip |
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.
Notes
Notes:
svn path=/head/; revision=144875
-rw-r--r-- | sys/dev/acpica/acpi_cpu.c | 25 | ||||
-rw-r--r-- | sys/dev/acpica/acpivar.h | 2 |
2 files changed, 24 insertions, 3 deletions
diff --git a/sys/dev/acpica/acpi_cpu.c b/sys/dev/acpica/acpi_cpu.c index d32054386a32..664a5310fe42 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 393536728812..98f8cafc44f5 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 */ |