added 4 changesets to branch 'refs/remotes/mmu_man-github/sam460ex' old head: f4b31e85b54a0665a5db0cffafb8a18a965fe38c new head: acc4e245de592de1897b78b16f1f4dffbda07249 overview: https://github.com/mmuman/haiku/compare/f4b31e8...acc4e24 ---------------------------------------------------------------------------- 5bdc101: U-Boot: use FDT call directly in of_init() in OF wrapper This avoids calling dprintf() and allows calling it earlier. 307c617: U-Boot: cleanup OpenFirmware wrapper tracing 219f59d: U-Boot: bail out in of_init() if no FDT passed acc4e24: U-Boot: Typo [ François Revol <revol@xxxxxxx> ] ---------------------------------------------------------------------------- 2 files changed, 21 insertions(+), 5 deletions(-) .../boot/platform/u-boot/arch/ppc/arch_cpu.cpp | 2 +- .../kernel/platform/u-boot/openfirmware.cpp | 24 ++++++++++++++++---- ############################################################################ Commit: 5bdc10121bb8eabc3921db5d950ff5c96eb81b3a Author: François Revol <revol@xxxxxxx> Date: Sun Feb 17 23:42:10 2013 UTC U-Boot: use FDT call directly in of_init() in OF wrapper This avoids calling dprintf() and allows calling it earlier. ---------------------------------------------------------------------------- diff --git a/src/system/kernel/platform/u-boot/openfirmware.cpp b/src/system/kernel/platform/u-boot/openfirmware.cpp index 557f4e5..12115b1 100644 --- a/src/system/kernel/platform/u-boot/openfirmware.cpp +++ b/src/system/kernel/platform/u-boot/openfirmware.cpp @@ -49,7 +49,8 @@ static int fdt2of(int err) status_t of_init(int (*openFirmwareEntry)(void *)) { - gChosen = of_finddevice("/chosen"); + gChosen = fdt2of(fdt_path_offset(gFDT, "/chosen")); + if (gChosen == OF_FAILED) return B_ERROR; ############################################################################ Commit: 307c6177df9c9bce3d361bdb2dee278874adbf7f Author: François Revol <revol@xxxxxxx> Date: Sun Feb 17 23:47:22 2013 UTC U-Boot: cleanup OpenFirmware wrapper tracing ---------------------------------------------------------------------------- diff --git a/src/system/kernel/platform/u-boot/openfirmware.cpp b/src/system/kernel/platform/u-boot/openfirmware.cpp index 12115b1..9d24315 100644 --- a/src/system/kernel/platform/u-boot/openfirmware.cpp +++ b/src/system/kernel/platform/u-boot/openfirmware.cpp @@ -15,6 +15,13 @@ extern "C" { #include <libfdt_env.h> }; +#define TRACE_OF +#ifdef TRACE_OF +# define TRACE(x) dprintf x +#else +# define TRACE(x) ; +#endif + // FIXME: HACK: until we support multiple platforms at once in the kernel. @@ -92,7 +99,8 @@ of_finddevice(const char *device) name = fdt_get_alias(gFDT, device); node = fdt_path_offset(gFDT, name); -dprintf("of_finddevice('%s') name='%s' node=%d ret=%d\n", device, name, node, fdt2of(node)); + TRACE(("of_finddevice('%s') name='%s' node=%d ret=%d\n", device, name, node, + fdt2of(node))); return fdt2of(node); } @@ -152,11 +160,15 @@ of_instance_to_package(int instance) int of_getprop(int package, const char *property, void *buffer, int bufferSize) { -int oldSize = bufferSize; + int oldSize = bufferSize; const void *p = fdt_getprop(gFDT, package, property, &bufferSize); -dprintf("of_getprop(%d, '%s', , %d) =%p sz=%d ret=%d\n", package, property, oldSize, p, bufferSize, fdt2of(bufferSize)); + + TRACE(("of_getprop(%d, '%s', , %d) =%p sz=%d ret=%d\n", package, property, + oldSize, p, bufferSize, fdt2of(bufferSize))); + if (p == NULL) return fdt2of(bufferSize); + memcpy(buffer, p, bufferSize); return bufferSize; } ############################################################################ Commit: 219f59da1fa25ddd8596efe1c83f2fa45eb2c103 Author: François Revol <revol@xxxxxxx> Date: Sun Feb 17 23:52:31 2013 UTC U-Boot: bail out in of_init() if no FDT passed ---------------------------------------------------------------------------- diff --git a/src/system/kernel/platform/u-boot/openfirmware.cpp b/src/system/kernel/platform/u-boot/openfirmware.cpp index 9d24315..9a56ce9 100644 --- a/src/system/kernel/platform/u-boot/openfirmware.cpp +++ b/src/system/kernel/platform/u-boot/openfirmware.cpp @@ -56,6 +56,9 @@ static int fdt2of(int err) status_t of_init(int (*openFirmwareEntry)(void *)) { + if (gFDT == NULL) + return OF_FAILED; + gChosen = fdt2of(fdt_path_offset(gFDT, "/chosen")); if (gChosen == OF_FAILED) ############################################################################ Commit: acc4e245de592de1897b78b16f1f4dffbda07249 Author: François Revol <revol@xxxxxxx> Date: Sun Feb 17 23:58:16 2013 UTC U-Boot: Typo ---------------------------------------------------------------------------- diff --git a/src/system/boot/platform/u-boot/arch/ppc/arch_cpu.cpp b/src/system/boot/platform/u-boot/arch/ppc/arch_cpu.cpp index 682ae82..ac3a0a6 100644 --- a/src/system/boot/platform/u-boot/arch/ppc/arch_cpu.cpp +++ b/src/system/boot/platform/u-boot/arch/ppc/arch_cpu.cpp @@ -81,7 +81,7 @@ check_cpu_features() // if we have an FDT... // XXX: use it only as fallback? if (gFDT != NULL/* && pvr_unknown*/) { - // TODO: for MP support we must checn /chosen/cpu first + // TODO: for MP support we must check /chosen/cpu first int node = fdt_path_offset(gFDT, "/cpus/cpu@0"); int len;