Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/i386/i386 Enable Transmeta CPUs without the LongRun...



details:   https://anonhg.NetBSD.org/src/rev/57fd06e16eb2
branches:  trunk
changeset: 538635:57fd06e16eb2
user:      mycroft <mycroft%NetBSD.org@localhost>
date:      Wed Oct 23 21:41:34 2002 +0000

description:
Enable Transmeta CPUs without the LongRun registers to get through
transmeta_cpu_{info,setup}().

diffstat:

 sys/arch/i386/i386/machdep.c |  27 +++++++++++++++++----------
 1 files changed, 17 insertions(+), 10 deletions(-)

diffs (53 lines):

diff -r 0c4dee7a0ee5 -r 57fd06e16eb2 sys/arch/i386/i386/machdep.c
--- a/sys/arch/i386/i386/machdep.c      Wed Oct 23 21:30:46 2002 +0000
+++ b/sys/arch/i386/i386/machdep.c      Wed Oct 23 21:41:34 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: machdep.c,v 1.492 2002/10/20 10:35:41 kanaoka Exp $    */
+/*     $NetBSD: machdep.c,v 1.493 2002/10/23 21:41:34 mycroft Exp $    */
 
 /*-
  * Copyright (c) 1996, 1997, 1998, 2000 The NetBSD Foundation, Inc.
@@ -76,7 +76,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.492 2002/10/20 10:35:41 kanaoka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.493 2002/10/23 21:41:34 mycroft Exp $");
 
 #include "opt_cputype.h"
 #include "opt_ddb.h"
@@ -1400,19 +1400,26 @@
                printf("%s: %s\n", ci->ci_dev->dv_xname, info.text);
        }
 
-       crusoe_longrun = tmx86_get_longrun_mode();
-       tmx86_get_longrun_status(&crusoe_frequency,
-           &crusoe_voltage, &crusoe_percentage);
-       printf("%s: LongRun mode: %d  <%dMHz %dmV %d%%>\n", ci->ci_dev->dv_xname,
-           crusoe_longrun, crusoe_frequency, crusoe_voltage,
-           crusoe_percentage);
+       if (nreg >= 0x80860007) {
+               crusoe_longrun = tmx86_get_longrun_mode();
+               tmx86_get_longrun_status(&crusoe_frequency,
+                   &crusoe_voltage, &crusoe_percentage);
+               printf("%s: LongRun mode: %d  <%dMHz %dmV %d%%>\n",
+                   ci->ci_dev->dv_xname,
+                   crusoe_longrun, crusoe_frequency, crusoe_voltage,
+                   crusoe_percentage);
+       }
 }
 
 void
 transmeta_cpu_setup(struct cpu_info *ci)
 {
-
-       tmx86_has_longrun = 1;
+       u_int regs[4], nreg = 0;
+
+       do_cpuid(0x80860000, regs);
+       nreg = regs[0];
+       if (nreg >= 0x80860007)
+               tmx86_has_longrun = 1;
 }
 
 



Home | Main Index | Thread Index | Old Index