From b96e57e8853e11d9bf6df0a7f61d452c4a0be5d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Revol?= Date: Sat, 19 Oct 2013 16:06:41 +0200 Subject: [PATCH 1/2] Fix typo --- src/system/kernel/arch/ppc/arch_vm_translation_map.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/system/kernel/arch/ppc/arch_vm_translation_map.cpp b/src/system/kernel/arch/ppc/arch_vm_translation_map.cpp index 3eb31e3a6a..f045583ebe 100644 --- a/src/system/kernel/arch/ppc/arch_vm_translation_map.cpp +++ b/src/system/kernel/arch/ppc/arch_vm_translation_map.cpp @@ -793,7 +793,7 @@ status_t arch_vm_translation_map_early_query(addr_t va, phys_addr_t *out_physical) { //PANIC_UNIMPLEMENTED(); - panic("vm_translation_map_quick_query(): not yet implemented\n"); + panic("vm_translation_map_early_query(): not yet implemented\n"); return B_OK; } From 4c7a310ce1b0bdc98f2b712e2ae20540d6886bfb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Revol?= Date: Sun, 20 Oct 2013 20:53:06 +0200 Subject: [PATCH 2/2] OF: PPC: Check for bus-frequency on '/' first As per PowerPC IEEE 1275-1994 binding v1.8 page 13. --- .../boot/platform/openfirmware/arch/ppc/cpu.cpp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/system/boot/platform/openfirmware/arch/ppc/cpu.cpp b/src/system/boot/platform/openfirmware/arch/ppc/cpu.cpp index 66aedf6d04..a2a4b2a883 100644 --- a/src/system/boot/platform/openfirmware/arch/ppc/cpu.cpp +++ b/src/system/boot/platform/openfirmware/arch/ppc/cpu.cpp @@ -26,6 +26,17 @@ status_t 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 int cpus = of_finddevice("/cpus"); if (cpus == OF_FAILED) { @@ -58,8 +69,8 @@ boot_arch_cpu_init(void) "frequency!\n"); return B_ERROR; } - int32 busFrequency; - if (of_getprop(cpu, "bus-frequency", &busFrequency, 4) + if (busFrequency == 0 + && of_getprop(cpu, "bus-frequency", &busFrequency, 4) == OF_FAILED) { printf("boot_arch_cpu_init: Failed to get bus clock " "frequency!\n");