Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/acpica/acpi_throttle.c
Show First 20 Lines • Show All 76 Lines • ▼ Show 20 Lines | |||||
*/ | */ | ||||
#define CPU_MAX_SPEED (1 << cpu_duty_width) | #define CPU_MAX_SPEED (1 << cpu_duty_width) | ||||
#define CPU_SPEED_PERCENT(x) ((10000 * (x)) / CPU_MAX_SPEED) | #define CPU_SPEED_PERCENT(x) ((10000 * (x)) / CPU_MAX_SPEED) | ||||
#define CPU_SPEED_PRINTABLE(x) (CPU_SPEED_PERCENT(x) / 10), \ | #define CPU_SPEED_PRINTABLE(x) (CPU_SPEED_PERCENT(x) / 10), \ | ||||
(CPU_SPEED_PERCENT(x) % 10) | (CPU_SPEED_PERCENT(x) % 10) | ||||
#define CPU_P_CNT_THT_EN (1<<4) | #define CPU_P_CNT_THT_EN (1<<4) | ||||
#define CPU_QUIRK_NO_THROTTLE (1<<1) /* Throttling is not usable. */ | #define CPU_QUIRK_NO_THROTTLE (1<<1) /* Throttling is not usable. */ | ||||
#define PCI_VENDOR_INTEL 0x8086 | |||||
#define PCI_DEVICE_82371AB_3 0x7113 /* PIIX4 chipset for quirks. */ | #define PCI_DEVICE_82371AB_3 0x7113 /* PIIX4 chipset for quirks. */ | ||||
#define PCI_REVISION_A_STEP 0 | #define PCI_REVISION_A_STEP 0 | ||||
#define PCI_REVISION_B_STEP 1 | #define PCI_REVISION_B_STEP 1 | ||||
static uint32_t cpu_duty_offset; /* Offset in P_CNT of throttle val. */ | static uint32_t cpu_duty_offset; /* Offset in P_CNT of throttle val. */ | ||||
static uint32_t cpu_duty_width; /* Bit width of throttle value. */ | static uint32_t cpu_duty_width; /* Bit width of throttle value. */ | ||||
static int thr_rid; /* Driver-wide resource id. */ | static int thr_rid; /* Driver-wide resource id. */ | ||||
static int thr_quirks; /* Indicate any hardware bugs. */ | static int thr_quirks; /* Indicate any hardware bugs. */ | ||||
▲ Show 20 Lines • Show All 222 Lines • ▼ Show 20 Lines | |||||
static void | static void | ||||
acpi_throttle_quirks(struct acpi_throttle_softc *sc) | acpi_throttle_quirks(struct acpi_throttle_softc *sc) | ||||
{ | { | ||||
#ifdef __i386__ | #ifdef __i386__ | ||||
device_t acpi_dev; | device_t acpi_dev; | ||||
/* Look for various quirks of the PIIX4 part. */ | /* Look for various quirks of the PIIX4 part. */ | ||||
acpi_dev = pci_find_device(PCI_VENDOR_INTEL, PCI_DEVICE_82371AB_3); | acpi_dev = pci_find_device(PCIV_INTEL, PCI_DEVICE_82371AB_3); | ||||
if (acpi_dev) { | if (acpi_dev) { | ||||
switch (pci_get_revid(acpi_dev)) { | switch (pci_get_revid(acpi_dev)) { | ||||
/* | /* | ||||
* Disable throttling control on PIIX4 A and B-step. | * Disable throttling control on PIIX4 A and B-step. | ||||
* See specification changes #13 ("Manual Throttle Duty Cycle") | * See specification changes #13 ("Manual Throttle Duty Cycle") | ||||
* and #14 ("Enabling and Disabling Manual Throttle"), plus | * and #14 ("Enabling and Disabling Manual Throttle"), plus | ||||
* erratum #5 ("STPCLK# Deassertion Time") from the January | * erratum #5 ("STPCLK# Deassertion Time") from the January | ||||
* 2002 PIIX4 specification update. Note that few (if any) | * 2002 PIIX4 specification update. Note that few (if any) | ||||
▲ Show 20 Lines • Show All 111 Lines • Show Last 20 Lines |