version 1.1, 2007/10/16 09:41:04 |
version 1.4, 2007/10/29 21:10:02 |
|
|
*/ |
*/ |
#include <sys/types.h> |
#include <sys/types.h> |
#include <sys/device.h> |
#include <sys/device.h> |
#include <sys/mem.h> |
|
#include <libkern/printf.h> |
#include <libkern/printf.h> |
|
|
#include <sys/cpu.h> |
#include <dev/cpuvar.h> |
|
|
|
|
int cpu_attach(struct device *, uint32_t, uint8_t); |
int cpu_attach(struct device *, uint32_t, uint8_t); |
|
|
struct driver cpu_dr = { |
struct driver cpu_dr = { |
sizeof(struct cpu_dd), |
sizeof(struct cpu_dd), |
cpu_attach, |
cpu_attach, |
|
NULL, |
NULL |
NULL |
}; |
}; |
|
|
|
|
printf("%s CPU at %d MHz (flags=0x%x)\n", ddp->cpu_name, |
printf("%s CPU at %d MHz (flags=0x%x)\n", ddp->cpu_name, |
ddp->cpu_freq, ddp->cpu_flags); |
ddp->cpu_freq, ddp->cpu_flags); |
|
|
return(-1); |
return(0); |
} |
} |
|
|
|
|
|
|
/* |
/* |
* Identify given CPU using cp15 (System Control Co-Processor) register 0 (ID) |
* Identify given CPU using cp15 (System Control Co-Processor) register 0 (ID) |
*/ |
*/ |
// uint32_t rd; |
uint32_t rd; |
|
|
/* store cp15 ID register into rd */ |
/* store cp15 ID register into rd */ |
// __asm __volatile("mrc p15 0, %0, c0, c0, 0" |
// __asm __volatile("mrc p15 0, %0, c0, c0, 0" |