1 #include <console/console.h>
2 #include <device/device.h>
3 #include <device/pci.h>
6 #include <cpu/x86/mtrr.h>
7 #include <cpu/x86/msr.h>
8 #include <cpu/x86/lapic.h>
9 #include <cpu/intel/microcode.h>
10 #include <cpu/intel/hyperthreading.h>
11 #include <cpu/x86/cache.h>
12 #include <cpu/x86/mtrr.h>
14 static const uint32_t microcode_updates[] = {
15 #include "microcode_m206e839.h"
16 /* Dummy terminator */
23 static inline void strcpy(char *dst, char *src)
25 while (*src) *dst++ = *src++;
28 static void fill_processor_name(char *processor_name)
30 struct cpuid_result regs;
31 char temp_processor_name[49];
32 char *processor_name_start;
33 unsigned int *name_as_ints = (unsigned int *)temp_processor_name;
37 regs = cpuid(0x80000002 + i);
38 name_as_ints[i*4 + 0] = regs.eax;
39 name_as_ints[i*4 + 1] = regs.ebx;
40 name_as_ints[i*4 + 2] = regs.ecx;
41 name_as_ints[i*4 + 3] = regs.edx;
44 temp_processor_name[48] = 0;
46 /* Skip leading spaces */
47 processor_name_start = temp_processor_name;
48 while (*processor_name_start == ' ')
49 processor_name_start++;
51 memset(processor_name, 0, 49);
52 strcpy(processor_name, processor_name_start);
55 static void model_6ex_init(device_t cpu)
57 char processor_name[49];
59 /* Turn on caching if we haven't already */
62 /* Update the microcode */
63 intel_update_microcode(microcode_updates);
65 /* Print processor name */
66 fill_processor_name(processor_name);
67 printk_info("CPU: %s.\n", processor_name);
73 /* Enable the local cpu apics */
76 /* Start up my cpu siblings */
77 intel_sibling_init(cpu);
80 static struct device_operations cpu_dev_ops = {
81 .init = model_6ex_init,
84 static struct cpu_device_id cpu_table[] = {
85 { X86_VENDOR_INTEL, 0x06e0 }, /* Intel Core Solo/Core Duo */
86 { X86_VENDOR_INTEL, 0x06e8 }, /* Intel Core Solo/Core Duo */
90 static const struct cpu_driver driver __cpu_driver = {
92 .id_table = cpu_table,