Module Name:    src
Committed By:   msaitoh
Date:           Fri Jul 25 14:34:22 UTC 2014

Modified Files:
        src/sys/arch/x86/x86: intel_busclock.c

Log Message:
Modify p3_get_bus_clock():
- Intel SDM says 06_17H is the same as 06_0fH. Same as OpenBSD.
- Add some Silvermont models.
- For Slivermont architecture, 0x011 is not 166.67MHz but 116.67MHz.
- Print model name not in decimal but in hexadecimal
- Cleanup code.


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/sys/arch/x86/x86/intel_busclock.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/x86/x86/intel_busclock.c
diff -u src/sys/arch/x86/x86/intel_busclock.c:1.18 src/sys/arch/x86/x86/intel_busclock.c:1.19
--- src/sys/arch/x86/x86/intel_busclock.c:1.18	Sun Nov 17 19:22:06 2013
+++ src/sys/arch/x86/x86/intel_busclock.c	Fri Jul 25 14:34:22 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: intel_busclock.c,v 1.18 2013/11/17 19:22:06 martin Exp $	*/
+/*	$NetBSD: intel_busclock.c,v 1.19 2014/07/25 14:34:22 msaitoh Exp $	*/
 
 /*-
  * Copyright (c) 1999, 2000, 2001 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: intel_busclock.c,v 1.18 2013/11/17 19:22:06 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: intel_busclock.c,v 1.19 2014/07/25 14:34:22 msaitoh Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -144,18 +144,8 @@ p3_get_bus_clock(struct cpu_info *ci)
 		}
 		break;
 	case 0xe: /* Core Duo/Solo */
-		/*
-		 * XXX (See also case 0xc)
-		 * Newer CPUs will GP when attemping to access MSR_FSB_FREQ.
-		 * In the long-term, use ACPI instead of all this.
-		 */
-		if (rdmsr_safe(MSR_FSB_FREQ, &msr) == EFAULT) {
-			aprint_debug_dev(ci->ci_dev,
-			    "unable to determine bus speed");
-			goto print_msr;
-		}
-		/* FALLTHROUGH */
 	case 0xf: /* Core Xeon */
+	case 0x17: /* Xeon [35]000, Core 2 Quad [89]00 */
 		if (rdmsr_safe(MSR_FSB_FREQ, &msr) == EFAULT) {
 			aprint_debug_dev(ci->ci_dev,
 			    "unable to determine bus speed");
@@ -181,6 +171,9 @@ p3_get_bus_clock(struct cpu_info *ci)
 		case 4:
 			bus_clock = 33333;
 			break;
+		case 6:
+			bus_clock = 40000;
+			break;
 		default:
 			aprint_debug("%s: unknown Core FSB_FREQ value %d",
 			    device_xname(ci->ci_dev), bus);
@@ -247,7 +240,10 @@ p3_get_bus_clock(struct cpu_info *ci)
 		}
 		break;
 	case 0x37: /* Silvermont */
+	case 0x4a:
 	case 0x4d:
+	case 0x5a:
+	case 0x5d:
 		if (rdmsr_safe(MSR_FSB_FREQ, &msr) == EFAULT) {
 			aprint_debug_dev(ci->ci_dev,
 			    "unable to determine bus speed");
@@ -268,7 +264,7 @@ p3_get_bus_clock(struct cpu_info *ci)
 			bus_clock = 13333;
 			break;
 		case 3:
-			bus_clock = 16667;
+			bus_clock = 11667;
 			break;
 		default:
 			aprint_debug("%s: unknown Silvermont FSB_FREQ value %d",
@@ -277,7 +273,7 @@ p3_get_bus_clock(struct cpu_info *ci)
 		}
 		break;
 	default:
-		aprint_debug("%s: unknown i686 model %d, can't get bus clock",
+		aprint_debug("%s: unknown i686 model %02x, can't get bus clock",
 		    device_xname(ci->ci_dev),
 		    CPUID_TO_MODEL(ci->ci_signature));
 print_msr:

Reply via email to