1 #include <linux/kernel.h>
3 #include <linux/init.h>
4 #include <asm/processor.h>
8 static void __init init_transmeta(struct cpuinfo_x86 *c)
10 unsigned int cap_mask, uk, max, dummy;
11 unsigned int cms_rev1, cms_rev2;
12 unsigned int cpu_rev, cpu_freq, cpu_flags, new_cpu_rev;
15 get_model_name(c); /* Same as AMD/Cyrix */
18 /* Print CMS and CPU revision */
19 max = cpuid_eax(0x80860000);
21 if ( max >= 0x80860001 ) {
22 cpuid(0x80860001, &dummy, &cpu_rev, &cpu_freq, &cpu_flags);
23 if (cpu_rev != 0x02000000) {
24 printk(KERN_INFO "CPU: Processor revision %u.%u.%u.%u, %u MHz\n",
25 (cpu_rev >> 24) & 0xff,
26 (cpu_rev >> 16) & 0xff,
27 (cpu_rev >> 8) & 0xff,
32 if ( max >= 0x80860002 ) {
33 cpuid(0x80860002, &new_cpu_rev, &cms_rev1, &cms_rev2, &dummy);
34 if (cpu_rev == 0x02000000) {
35 printk(KERN_INFO "CPU: Processor revision %08X, %u MHz\n",
36 new_cpu_rev, cpu_freq);
38 printk(KERN_INFO "CPU: Code Morphing Software revision %u.%u.%u-%u-%u\n",
39 (cms_rev1 >> 24) & 0xff,
40 (cms_rev1 >> 16) & 0xff,
41 (cms_rev1 >> 8) & 0xff,
45 if ( max >= 0x80860006 ) {
50 (void *)&cpu_info[12]);
52 (void *)&cpu_info[16],
53 (void *)&cpu_info[20],
54 (void *)&cpu_info[24],
55 (void *)&cpu_info[28]);
57 (void *)&cpu_info[32],
58 (void *)&cpu_info[36],
59 (void *)&cpu_info[40],
60 (void *)&cpu_info[44]);
62 (void *)&cpu_info[48],
63 (void *)&cpu_info[52],
64 (void *)&cpu_info[56],
65 (void *)&cpu_info[60]);
67 printk(KERN_INFO "CPU: %s\n", cpu_info);
70 /* Unhide possibly hidden capability flags */
71 rdmsr(0x80860004, cap_mask, uk);
72 wrmsr(0x80860004, ~0, uk);
73 c->x86_capability[0] = cpuid_edx(0x00000001);
74 wrmsr(0x80860004, cap_mask, uk);
76 /* If we can run i686 user-space code, call us an i686 */
77 #define USER686 (X86_FEATURE_TSC|X86_FEATURE_CX8|X86_FEATURE_CMOV)
78 if ( c->x86 == 5 && (c->x86_capability[0] & USER686) == USER686 )
82 /* randomize_va_space slows us down enormously;
83 it probably triggers retranslation of x86->native bytecode */
84 randomize_va_space = 0;
88 static void __init transmeta_identify(struct cpuinfo_x86 * c)
93 /* Transmeta-defined flags: level 0x80860001 */
94 xlvl = cpuid_eax(0x80860000);
95 if ( (xlvl & 0xffff0000) == 0x80860000 ) {
96 if ( xlvl >= 0x80860001 )
97 c->x86_capability[2] = cpuid_edx(0x80860001);
101 static struct cpu_dev transmeta_cpu_dev __initdata = {
102 .c_vendor = "Transmeta",
103 .c_ident = { "GenuineTMx86", "TransmetaCPU" },
104 .c_init = init_transmeta,
105 .c_identify = transmeta_identify,
108 int __init transmeta_init_cpu(void)
110 cpu_devs[X86_VENDOR_TRANSMETA] = &transmeta_cpu_dev;
114 //early_arch_initcall(transmeta_init_cpu);
116 static int __init transmeta_exit_cpu(void)
118 cpu_devs[X86_VENDOR_TRANSMETA] = NULL;
122 late_initcall(transmeta_exit_cpu);