1 #include <linux/kernel.h>
2 #include <linux/init.h>
3 #include <asm/processor.h>
7 static void __init init_transmeta(struct cpuinfo_x86 *c)
9 unsigned int cap_mask, uk, max, dummy;
10 unsigned int cms_rev1, cms_rev2;
11 unsigned int cpu_rev, cpu_freq, cpu_flags, new_cpu_rev;
14 get_model_name(c); /* Same as AMD/Cyrix */
17 /* Print CMS and CPU revision */
18 max = cpuid_eax(0x80860000);
20 if ( max >= 0x80860001 ) {
21 cpuid(0x80860001, &dummy, &cpu_rev, &cpu_freq, &cpu_flags);
22 if (cpu_rev != 0x02000000) {
23 printk(KERN_INFO "CPU: Processor revision %u.%u.%u.%u, %u MHz\n",
24 (cpu_rev >> 24) & 0xff,
25 (cpu_rev >> 16) & 0xff,
26 (cpu_rev >> 8) & 0xff,
31 if ( max >= 0x80860002 ) {
32 cpuid(0x80860002, &new_cpu_rev, &cms_rev1, &cms_rev2, &dummy);
33 if (cpu_rev == 0x02000000) {
34 printk(KERN_INFO "CPU: Processor revision %08X, %u MHz\n",
35 new_cpu_rev, cpu_freq);
37 printk(KERN_INFO "CPU: Code Morphing Software revision %u.%u.%u-%u-%u\n",
38 (cms_rev1 >> 24) & 0xff,
39 (cms_rev1 >> 16) & 0xff,
40 (cms_rev1 >> 8) & 0xff,
44 if ( max >= 0x80860006 ) {
49 (void *)&cpu_info[12]);
51 (void *)&cpu_info[16],
52 (void *)&cpu_info[20],
53 (void *)&cpu_info[24],
54 (void *)&cpu_info[28]);
56 (void *)&cpu_info[32],
57 (void *)&cpu_info[36],
58 (void *)&cpu_info[40],
59 (void *)&cpu_info[44]);
61 (void *)&cpu_info[48],
62 (void *)&cpu_info[52],
63 (void *)&cpu_info[56],
64 (void *)&cpu_info[60]);
66 printk(KERN_INFO "CPU: %s\n", cpu_info);
69 /* Unhide possibly hidden capability flags */
70 rdmsr(0x80860004, cap_mask, uk);
71 wrmsr(0x80860004, ~0, uk);
72 c->x86_capability[0] = cpuid_edx(0x00000001);
73 wrmsr(0x80860004, cap_mask, uk);
75 /* If we can run i686 user-space code, call us an i686 */
76 #define USER686 (X86_FEATURE_TSC|X86_FEATURE_CX8|X86_FEATURE_CMOV)
77 if ( c->x86 == 5 && (c->x86_capability[0] & USER686) == USER686 )
81 static void transmeta_identify(struct cpuinfo_x86 * c)
86 /* Transmeta-defined flags: level 0x80860001 */
87 xlvl = cpuid_eax(0x80860000);
88 if ( (xlvl & 0xffff0000) == 0x80860000 ) {
89 if ( xlvl >= 0x80860001 )
90 c->x86_capability[2] = cpuid_edx(0x80860001);
94 static struct cpu_dev transmeta_cpu_dev __initdata = {
95 .c_vendor = "Transmeta",
96 .c_ident = { "GenuineTMx86", "TransmetaCPU" },
97 .c_init = init_transmeta,
98 .c_identify = transmeta_identify,
101 int __init transmeta_init_cpu(void)
103 cpu_devs[X86_VENDOR_TRANSMETA] = &transmeta_cpu_dev;
107 //early_arch_initcall(transmeta_init_cpu);