Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 12 Jan 2009 22:01:49 +0000 (UTC)
From:      Jung-uk Kim <jkim@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r187118 - head/sys/i386/i386
Message-ID:  <200901122201.n0CM1n5N077550@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jkim
Date: Mon Jan 12 22:01:49 2009
New Revision: 187118
URL: http://svn.freebsd.org/changeset/base/187118

Log:
  Add basic i386 support for VIA Nano processors.

Modified:
  head/sys/i386/i386/i686_mem.c
  head/sys/i386/i386/identcpu.c
  head/sys/i386/i386/initcpu.c

Modified: head/sys/i386/i386/i686_mem.c
==============================================================================
--- head/sys/i386/i386/i686_mem.c	Mon Jan 12 21:58:19 2009	(r187117)
+++ head/sys/i386/i386/i686_mem.c	Mon Jan 12 22:01:49 2009	(r187118)
@@ -678,9 +678,17 @@ i686_mem_drvinit(void *unused)
 		return;
 	if ((cpu_id & 0xf00) != 0x600 && (cpu_id & 0xf00) != 0xf00)
 		return;
-	if (cpu_vendor_id != CPU_VENDOR_INTEL &&
-	    cpu_vendor_id != CPU_VENDOR_AMD)
+	switch (cpu_vendor_id) {
+	case CPU_VENDOR_INTEL:
+	case CPU_VENDOR_AMD:
+		break;
+	case CPU_VENDOR_CENTAUR:
+		if (cpu_exthigh >= 0x80000008)
+			break;
+		/* FALLTHROUGH */
+	default:
 		return;
+	}
 	mem_range_softc.mr_op = &i686_mrops;
 }
 SYSINIT(i686memdev, SI_SUB_DRIVERS, SI_ORDER_FIRST, i686_mem_drvinit, NULL);

Modified: head/sys/i386/i386/identcpu.c
==============================================================================
--- head/sys/i386/i386/identcpu.c	Mon Jan 12 21:58:19 2009	(r187117)
+++ head/sys/i386/i386/identcpu.c	Mon Jan 12 22:01:49 2009	(r187118)
@@ -606,6 +606,9 @@ printcpuinfo(void)
 		case 0x6d0:
 			strcpy(cpu_model, "VIA C7 Esther");
 			break;
+		case 0x6f0:
+			strcpy(cpu_model, "VIA Nano");
+			break;
 		default:
 			strcpy(cpu_model, "VIA/IDT Unknown");
 		}
@@ -856,6 +859,9 @@ printcpuinfo(void)
 				);
 			}
 
+			if (cpu_vendor_id == CPU_VENDOR_CENTAUR)
+				print_via_padlock_info();
+
 			if ((cpu_feature & CPUID_HTT) &&
 			    cpu_vendor_id == CPU_VENDOR_AMD)
 				cpu_feature &= ~CPUID_HTT;
@@ -879,6 +885,11 @@ printcpuinfo(void)
 				    I386_CPU_MODEL(cpu_id) >= 0x3))
 					tsc_is_invariant = 1;
 				break;
+			case CPU_VENDOR_CENTAUR:
+				if (I386_CPU_FAMILY(cpu_id) == 0x6 &&
+				    I386_CPU_MODEL(cpu_id) >= 0xf)
+					tsc_is_invariant = 1;
+				break;
 			}
 			if (tsc_is_invariant)
 				printf("\n  TSC: P-state invariant");
@@ -915,8 +926,6 @@ printcpuinfo(void)
 			printf("\n  CPU cache: write-through mode");
 #endif
 	}
-	if (cpu_vendor_id == CPU_VENDOR_CENTAUR)
-		print_via_padlock_info();
 
 	/* Avoid ugly blank lines: only print newline when we have to. */
 	if (*cpu_vendor || cpu_id)
@@ -1568,6 +1577,7 @@ print_via_padlock_info(void)
 			return;
 	case 0x6a0:
 	case 0x6d0:
+	case 0x6f0:
 		break;
 	default:
 		return;

Modified: head/sys/i386/i386/initcpu.c
==============================================================================
--- head/sys/i386/i386/initcpu.c	Mon Jan 12 21:58:19 2009	(r187117)
+++ head/sys/i386/i386/initcpu.c	Mon Jan 12 22:01:49 2009	(r187118)
@@ -686,6 +686,7 @@ initializecpu(void)
 				/* fall through. */
 			case 0x6a0:
 			case 0x6d0:
+			case 0x6f0:
 				init_via();
 				break;
 			default:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200901122201.n0CM1n5N077550>