diff options
author | Marcel Moolenaar <marcel@FreeBSD.org> | 2004-03-10 22:23:20 +0000 |
---|---|---|
committer | Marcel Moolenaar <marcel@FreeBSD.org> | 2004-03-10 22:23:20 +0000 |
commit | 39209a2fad805018fdb4159bcffd9022e9b0f930 (patch) | |
tree | c63f43c788e627ce9d09d5cc1a1c17dc90386b6f /sys/ia64 | |
parent | 30b800de8eb25e7bb0ccc2e579fd2530646821da (diff) | |
download | src-39209a2fad805018fdb4159bcffd9022e9b0f930.tar.gz src-39209a2fad805018fdb4159bcffd9022e9b0f930.zip |
Identify the Deerfield processor. Deerfield is a low-voltage variant
based on the Madison core and targeting the low end of the spectrum.
Its clock frequency is 1Ghz, whereas Madison starts at 1.3Ghz. Since
the CPUID information is the same for Madison and Deerfield, we use
the clock frequency to identify the processor.
Supposedly the Deerfield only uses 62W, which seems to be less than
modern Xeon processors (about 70W) and about half what a Madison would
need.
Notes
Notes:
svn path=/head/; revision=126825
Diffstat (limited to 'sys/ia64')
-rw-r--r-- | sys/ia64/ia64/machdep.c | 37 |
1 files changed, 25 insertions, 12 deletions
diff --git a/sys/ia64/ia64/machdep.c b/sys/ia64/ia64/machdep.c index b7fb86ab5217..17fa6e406f66 100644 --- a/sys/ia64/ia64/machdep.c +++ b/sys/ia64/ia64/machdep.c @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2003 Marcel Moolenaar + * Copyright (c) 2003,2004 Marcel Moolenaar * Copyright (c) 2000,2001 Doug Rabson * All rights reserved. * @@ -146,14 +146,16 @@ void mi_startup(void); /* XXX should be in a MI header */ struct kva_md_info kmi; +#define Mhz 1000000L +#define Ghz (1000L*Mhz) + static void identifycpu(void) { char vendor[17]; char *family_name, *model_name; - u_int64_t t; + u_int64_t features, tmp; int number, revision, model, family, archrev; - u_int64_t features; /* * Assumes little-endian. @@ -162,12 +164,12 @@ identifycpu(void) *(u_int64_t *) &vendor[8] = ia64_get_cpuid(1); vendor[16] = '\0'; - t = ia64_get_cpuid(3); - number = (t >> 0) & 0xff; - revision = (t >> 8) & 0xff; - model = (t >> 16) & 0xff; - family = (t >> 24) & 0xff; - archrev = (t >> 32) & 0xff; + tmp = ia64_get_cpuid(3); + number = (tmp >> 0) & 0xff; + revision = (tmp >> 8) & 0xff; + model = (tmp >> 16) & 0xff; + family = (tmp >> 24) & 0xff; + archrev = (tmp >> 32) & 0xff; family_name = model_name = "unknown"; switch (family) { @@ -182,7 +184,18 @@ identifycpu(void) model_name = "McKinley"; break; case 0x01: - model_name = "Madison"; + /* + * Deerfield is a low-voltage variant based on the + * Madison core. We need circumstantial evidence + * (i.e. the clock frequency) to identify those. + * Allow for roughly 1% error margin. + */ + tmp = processor_frequency >> 7; + if ((processor_frequency - tmp) < 1*Ghz && + (processor_frequency + tmp) >= 1*Ghz) + model_name = "Deerfield"; + else + model_name = "Madison"; break; } break; @@ -195,8 +208,8 @@ identifycpu(void) printf("CPU: %s (", model_name); if (processor_frequency) { printf("%ld.%02ld-Mhz ", - (processor_frequency + 4999) / 1000000, - ((processor_frequency + 4999) / 10000) % 100); + (processor_frequency + 4999) / Mhz, + ((processor_frequency + 4999) / (Mhz/100)) % 100); } printf("%s)\n", family_name); printf(" Origin = \"%s\" Revision = %d\n", vendor, revision); |