2005-04-16 16:20:36 -06:00
|
|
|
#include <linux/kernel.h>
|
|
|
|
#include <linux/init.h>
|
|
|
|
#include <linux/string.h>
|
|
|
|
#include <asm/processor.h>
|
|
|
|
|
|
|
|
#include "cpu.h"
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Detect a NexGen CPU running without BIOS hypercode new enough
|
|
|
|
* to have CPUID. (Thanks to Herbert Oppmann)
|
|
|
|
*/
|
2008-02-19 16:18:05 -07:00
|
|
|
|
2006-09-26 02:52:36 -06:00
|
|
|
static int __cpuinit deep_magic_nexgen_probe(void)
|
2005-04-16 16:20:36 -06:00
|
|
|
{
|
|
|
|
int ret;
|
2008-02-19 16:18:05 -07:00
|
|
|
|
2005-04-16 16:20:36 -06:00
|
|
|
__asm__ __volatile__ (
|
|
|
|
" movw $0x5555, %%ax\n"
|
|
|
|
" xorw %%dx,%%dx\n"
|
|
|
|
" movw $2, %%cx\n"
|
|
|
|
" divw %%cx\n"
|
|
|
|
" movl $0, %%eax\n"
|
|
|
|
" jnz 1f\n"
|
|
|
|
" movl $1, %%eax\n"
|
2008-02-19 16:18:05 -07:00
|
|
|
"1:\n"
|
|
|
|
: "=a" (ret) : : "cx", "dx");
|
2005-04-16 16:20:36 -06:00
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
2008-02-19 16:18:05 -07:00
|
|
|
static void __cpuinit init_nexgen(struct cpuinfo_x86 *c)
|
2005-04-16 16:20:36 -06:00
|
|
|
{
|
|
|
|
c->x86_cache_size = 256; /* A few had 1 MB... */
|
|
|
|
}
|
|
|
|
|
2008-02-19 16:18:05 -07:00
|
|
|
static void __cpuinit nexgen_identify(struct cpuinfo_x86 *c)
|
2005-04-16 16:20:36 -06:00
|
|
|
{
|
|
|
|
/* Detect NexGen with old hypercode */
|
2008-02-19 16:18:05 -07:00
|
|
|
if (deep_magic_nexgen_probe())
|
2005-04-16 16:20:36 -06:00
|
|
|
strcpy(c->x86_vendor_id, "NexGenDriven");
|
|
|
|
}
|
|
|
|
|
2006-09-26 02:52:36 -06:00
|
|
|
static struct cpu_dev nexgen_cpu_dev __cpuinitdata = {
|
2005-04-16 16:20:36 -06:00
|
|
|
.c_vendor = "Nexgen",
|
|
|
|
.c_ident = { "NexGenDriven" },
|
|
|
|
.c_models = {
|
|
|
|
{ .vendor = X86_VENDOR_NEXGEN,
|
|
|
|
.family = 5,
|
|
|
|
.model_names = { [1] = "Nx586" }
|
|
|
|
},
|
|
|
|
},
|
|
|
|
.c_init = init_nexgen,
|
|
|
|
.c_identify = nexgen_identify,
|
|
|
|
};
|
|
|
|
|
|
|
|
int __init nexgen_init_cpu(void)
|
|
|
|
{
|
|
|
|
cpu_devs[X86_VENDOR_NEXGEN] = &nexgen_cpu_dev;
|
|
|
|
return 0;
|
|
|
|
}
|