Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/x86/acpi Properly detect AMD hardware P-state suppo...



details:   https://anonhg.NetBSD.org/src/rev/17dded18b09c
branches:  trunk
changeset: 757231:17dded18b09c
user:      jruoho <jruoho%NetBSD.org@localhost>
date:      Sat Aug 21 02:47:37 2010 +0000

description:
Properly detect AMD hardware P-state support. Also detect "core boost" (only
present in some models of family 10h).

diffstat:

 sys/arch/x86/acpi/acpi_cpu_md.c |  12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)

diffs (41 lines):

diff -r d29ff0421482 -r 17dded18b09c sys/arch/x86/acpi/acpi_cpu_md.c
--- a/sys/arch/x86/acpi/acpi_cpu_md.c   Sat Aug 21 02:31:13 2010 +0000
+++ b/sys/arch/x86/acpi/acpi_cpu_md.c   Sat Aug 21 02:47:37 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: acpi_cpu_md.c,v 1.20 2010/08/20 07:00:17 jruoho Exp $ */
+/* $NetBSD: acpi_cpu_md.c,v 1.21 2010/08/21 02:47:37 jruoho Exp $ */
 
 /*-
  * Copyright (c) 2010 Jukka Ruohonen <jruohonen%iki.fi@localhost>
@@ -27,7 +27,7 @@
  * SUCH DAMAGE.
  */
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: acpi_cpu_md.c,v 1.20 2010/08/20 07:00:17 jruoho Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi_cpu_md.c,v 1.21 2010/08/21 02:47:37 jruoho Exp $");
 
 #include <sys/param.h>
 #include <sys/bus.h>
@@ -111,6 +111,7 @@
        struct cpu_info *ci = curcpu();
        struct pci_attach_args pa;
        uint32_t family, val = 0;
+       uint32_t regs[4];
 
        if (acpicpu_md_cpus_running() == 1)
                val |= ACPICPU_FLAG_C_BM;
@@ -144,8 +145,13 @@
                case 0x10:
                case 0x11:
 
-                       if ((ci->ci_feat_val[2] & CPUID_APM_HWP) != 0)
+                       x86_cpuid(0x80000007, regs);
+
+                       if ((regs[3] & CPUID_APM_HWP) != 0)
                                val |= ACPICPU_FLAG_P_FFH;
+
+                       if ((regs[3] & CPUID_APM_CPB) != 0)
+                               val |= ACPICPU_FLAG_P_TURBO;
                }
 
                break;



Home | Main Index | Thread Index | Old Index