Author: wmb
Date: 2007-04-27 23:50:06 +0200 (Fri, 27 Apr 2007)
New Revision: 328
Modified:
clients/memtest86/head.S
clients/memtest86/init.c
Log:
OLPC trac #1375 - memtest fails to find L1/L2 cache size. Added CPUID
entries for the AMD Geode GX and LX chips.
Modified: clients/memtest86/head.S
===================================================================
--- clients/memtest86/head.S 2007-04-27 06:49:05 UTC (rev 327)
+++ clients/memtest86/head.S 2007-04-27 21:50:06 UTC (rev 328)
@@ -368,6 +368,8 @@
movl X86_VENDOR_ID+8(%esi),%eax
cmpl $0x444d4163, %eax # Is this an AMD CPU?
je amd_type
+ cmpl $0x43534e20, %eax # " NSC" - Geode GX, now owned by AMD
+ je amd_type
cmpl $0x736c7561, %eax # Is this a VIA CENTAUR?
jne not_amd
amd_type:
Modified: clients/memtest86/init.c
===================================================================
--- clients/memtest86/init.c 2007-04-27 06:49:05 UTC (rev 327)
+++ clients/memtest86/init.c 2007-04-27 21:50:06 UTC (rev 328)
@@ -280,9 +280,9 @@
v->pae = 0;
#ifdef CPUID_DEBUG
- dprint(11,0,cpu_id.type,3,1);
- dprint(12,0,cpu_id.model,3,1);
- dprint(13,0,cpu_id.cpuid,3,1);
+ dprint(13,0,cpu_id.type,3,1);
+ dprint(14,0,cpu_id.model,3,1);
+ dprint(15,0,cpu_id.cpuid,3,1);
#endif
/* If the CPUID instruction is not supported then this is */
@@ -371,6 +371,9 @@
cprint(LINE_CPU, 0, "AMD K5");
off = 6;
break;
+ /* case 5 doesn't exist, because it would be the */
+ /* AMD Geode GX, but the vendor ID string for that */
+ /* part says "Geode by NSC", handled elsewhere. */
case 6:
case 7:
cprint(LINE_CPU, 0, "AMD K6");
@@ -392,6 +395,14 @@
l2_cache = (cpu_id.cache_info[11] << 8);
l2_cache += cpu_id.cache_info[10];
break;
+ case 10:
+ cprint(LINE_CPU, 0, "AMD Geode LX");
+ off = 12;
+ l1_cache = cpu_id.cache_info[3];
+ l1_cache += cpu_id.cache_info[7];
+ l2_cache = (cpu_id.cache_info[11] << 8);
+ l2_cache += cpu_id.cache_info[10];
+ break;
case 13:
cprint(LINE_CPU, 0, "AMD K6-III+");
off = 11;
@@ -513,6 +524,11 @@
}
l1_cache = cpu_id.cache_info[3] + cpu_id.cache_info[7];
l2_cache = (cpu_id.cache_info[11]*256) + cpu_id.cache_info[10];
+ } else if ( cpu_id.vend_id[9] == 'N' ) { /* Geode by NSC (now AMD) */
+ cprint(LINE_CPU, 0, "AMD Geode GX");
+ off = 12;
+ l1_cache = cpu_id.cache_info[3];
+ l1_cache += cpu_id.cache_info[7];
} else { /* GenuineIntel */
if (cpu_id.type == 4) {
switch(cpu_id.model) {