Subject: kern/25261: Geode GX1 (id 0x540) clock not broken
To: None <gnats-bugs@gnats.NetBSD.org>
From: None <andreas@planix.com>
List: netbsd-bugs
Date: 04/20/2004 12:58:33
>Number:         25261
>Category:       kern
>Synopsis:       Geode GX1 (id 0x540) clock not broken
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Apr 20 16:59:00 UTC 2004
>Closed-Date:
>Last-Modified:
>Originator:     Andreas Wrede <andreas@planix.com>
>Release:        NetBSD 2.0C
>Organization:
Planix, Inc.
>Environment:
	
	
System: NetBSD wia 2.0C NetBSD 2.0C (NET4801) #12: Tue Apr 20 11:12:55 EDT 2004  root@woffi:/m5/netbsd-current/obj/sys/arch/i386/compile.i386/NET4801 i386
Architecture: i386
Machine: i386
>Description:
	Code in sys/arch/i386/i386/identcpu.c sets 'clock_broken_latch' for Cyrix
MediaGX (id 0x440) and NSC Geode GX1 (id 0x540). On a Soekris 4801 with a GX1 
CPU, this produces erratic clock behaviour, including time running backwards.

I don't know if there are other versions of the GX1 CPU which needs the fix,
my CPU is marked SC1100UFH-266, (C)(M)NSC2002 B1, VS318AB

cpuid reports:
 eax in    eax      ebx      ecx      edx
00000000 00000002 646f6547 43534e20 79622065
00000001 00000540 00000000 00000000 00808131
00000002 00007001 00000000 00000000 00000080
80000000 80000005 00000000 00000000 00000000
80000001 00000540 00000000 00000000 01818131
80000002 646f6547 4d542865 6e492029 72676574
80000003 64657461 6f725020 73736563 6220726f
80000004 614e2079 6e6f6974 53206c61 00696d65
80000005 00000000 00007001 00000080 00000000

Vendor ID: "Geode by NSC"; CPUID level 2

>How-To-Repeat:
Boot a GX1 based machine, like a Soekris 4801 with a GENERIC kernel and run
$ while true; do date; done
Mon Apr 19 22:30:49 EDT 2004
Mon Apr 19 22:30:49 EDT 2004
Mon Apr 19 22:30:50 EDT 2004
Mon Apr 19 22:30:51 EDT 2004
Mon Apr 19 22:30:51 EDT 2004
Mon Apr 19 22:30:52 EDT 2004
Mon Apr 19 22:30:53 EDT 2004
Mon Apr 19 22:30:54 EDT 2004
Mon Apr 19 22:30:55 EDT 2004
Mon Apr 19 22:30:56 EDT 2004
Mon Apr 19 22:30:56 EDT 2004
Mon Apr 19 22:30:57 EDT 2004
Mon Apr 19 22:30:58 EDT 2004
Mon Apr 19 22:30:59 EDT 2004
Mon Apr 19 22:31:00 EDT 2004
Mon Apr 19 22:31:00 EDT 2004
Mon Apr 19 22:31:02 EDT 2004
Mon Apr 19 22:31:02 EDT 2004
Mon Apr 19 22:31:03 EDT 2004
Mon Apr 19 22:31:04 EDT 2004
Mon Apr 19 22:31:05 EDT 2004
Mon Apr 19 22:31:06 EDT 2004
Mon Apr 19 22:31:07 EDT 2004
Mon Apr 19 22:31:07 EDT 2004
Mon Apr 19 22:30:49 EDT 2004
Mon Apr 19 22:30:49 EDT 2004
Mon Apr 19 22:30:49 EDT 2004
Mon Apr 19 22:30:49 EDT 2004
Mon Apr 19 22:30:49 EDT 2004
Mon Apr 19 22:30:49 EDT 2004
^C^C

>Fix:
Apply fix below. 

Index: identcpu.c
===================================================================
RCS file: /cvsroot/src/sys/arch/i386/i386/identcpu.c,v
retrieving revision 1.11
diff -u -r1.11 identcpu.c
--- identcpu.c	5 Apr 2004 02:09:41 -0000	1.11
+++ identcpu.c	20 Apr 2004 16:26:52 -0000
@@ -552,7 +552,6 @@
 
 	switch (ci->ci_signature) {
 	case 0x440:     /* Cyrix MediaGX */
-	case 0x540:     /* GXm */
 		clock_broken_latch = 1;
 		break;
 	}
>Release-Note:
>Audit-Trail:
>Unformatted: