OF: PPC: Check for bus-frequency on '/' first
As per PowerPC IEEE 1275-1994 binding v1.8 page 13.
This commit is contained in:
@@ -26,6 +26,17 @@
|
|||||||
status_t
|
status_t
|
||||||
boot_arch_cpu_init(void)
|
boot_arch_cpu_init(void)
|
||||||
{
|
{
|
||||||
|
int32 busFrequency = 0;
|
||||||
|
|
||||||
|
int root = of_finddevice("/");
|
||||||
|
if (root == OF_FAILED) {
|
||||||
|
printf("boot_arch_cpu_init(): Failed to open \"/\"!\n");
|
||||||
|
return B_ERROR;
|
||||||
|
}
|
||||||
|
|
||||||
|
of_getprop(root, "clock-frequency", &busFrequency, 4);
|
||||||
|
// we might find it in /cpus instead
|
||||||
|
|
||||||
// iterate through the "/cpus" node to find all CPUs
|
// iterate through the "/cpus" node to find all CPUs
|
||||||
int cpus = of_finddevice("/cpus");
|
int cpus = of_finddevice("/cpus");
|
||||||
if (cpus == OF_FAILED) {
|
if (cpus == OF_FAILED) {
|
||||||
@@ -58,8 +69,8 @@ boot_arch_cpu_init(void)
|
|||||||
"frequency!\n");
|
"frequency!\n");
|
||||||
return B_ERROR;
|
return B_ERROR;
|
||||||
}
|
}
|
||||||
int32 busFrequency;
|
if (busFrequency == 0
|
||||||
if (of_getprop(cpu, "bus-frequency", &busFrequency, 4)
|
&& of_getprop(cpu, "bus-frequency", &busFrequency, 4)
|
||||||
== OF_FAILED) {
|
== OF_FAILED) {
|
||||||
printf("boot_arch_cpu_init: Failed to get bus clock "
|
printf("boot_arch_cpu_init: Failed to get bus clock "
|
||||||
"frequency!\n");
|
"frequency!\n");
|
||||||
|
|||||||
Reference in New Issue
Block a user