1 #include <console/console.h>
4 #include <device/device.h>
6 #include <cpu/ppc/cpuid.h>
11 static void set_cpu_ops(struct device *cpu)
13 struct cpu_driver *driver;
15 for (driver = cpu_drivers; driver < ecpu_drivers; driver++) {
16 struct cpu_device_id *id;
17 for(id = driver->id_table; id->pvr != 0; id++) {
18 if (cpu->device == id->pvr)
27 cpu->ops = driver->ops;
31 void cpu_initialize(void)
33 /* Because we busy wait at the printk spinlock.
34 * It is important to keep the number of printed messages
35 * from secondary cpus to a minimum, when debugging is
39 struct cpu_info *info;
42 printk_notice("Initializing CPU #%d\n", info->index);
46 die("CPU: missing cpu device structure");
49 /* Find what type of cpu we are dealing with */
50 cpu->vendor = 0; /* PPC cpus do not have a vendor field */
51 cpu->device = ppc_getpvr();
55 /* Lookup the cpu's operations */
58 /* Initialize the cpu */
59 if (cpu->ops && cpu->ops->init) {
65 /* Turn on caching if we haven't already */
67 printk_info("CPU #%d Initialized\n", info->index);