From 2d014a28863f95a905daaa1f75aa9637565dd16a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Revol?= Date: Tue, 6 Nov 2012 19:43:12 +0100 Subject: [PATCH] U-Boot: Fix linking the kernel by adding FDT support Add FDT support to the kernel, move fdt_support.cpp and declare gFDT there for the kernel. --- src/system/boot/platform/u-boot/Jamfile | 2 +- src/system/kernel/platform/u-boot/Jamfile | 15 +++++++++++++++ .../platform/u-boot/fdt_support.cpp | 4 ++++ 3 files changed, 20 insertions(+), 1 deletion(-) rename src/system/{boot => kernel}/platform/u-boot/fdt_support.cpp (96%) diff --git a/src/system/boot/platform/u-boot/Jamfile b/src/system/boot/platform/u-boot/Jamfile index 7641bea93c..a2cea4405b 100644 --- a/src/system/boot/platform/u-boot/Jamfile +++ b/src/system/boot/platform/u-boot/Jamfile @@ -248,7 +248,7 @@ Depends haiku-mmc-image : haiku-$(HAIKU_BOOT_BOARD).mmc ; SEARCH on [ FGristFiles $(genericPlatformSources) ] = [ FDirName $(HAIKU_TOP) src system boot platform generic ] ; -SEARCH on [ FGristFiles openfirmware.cpp ] +SEARCH on [ FGristFiles openfirmware.cpp fdt_support.cpp ] = [ FDirName $(HAIKU_TOP) src system kernel platform u-boot ] ; SEARCH on [ FGristFiles $(libFDTSources) ] diff --git a/src/system/kernel/platform/u-boot/Jamfile b/src/system/kernel/platform/u-boot/Jamfile index b9604505c7..dbadd8cbcb 100644 --- a/src/system/kernel/platform/u-boot/Jamfile +++ b/src/system/kernel/platform/u-boot/Jamfile @@ -5,7 +5,22 @@ SubDirC++Flags $(TARGET_KERNEL_PIC_CCFLAGS) ; UseLibraryHeaders [ FDirName libfdt ] ; +local libFDTSources = + fdt.c + fdt_ro.c + fdt_rw.c + fdt_strerror.c + fdt_sw.c + fdt_wip.c +; + KernelMergeObject kernel_platform_u-boot.o : platform.cpp + fdt_support.cpp openfirmware.cpp + $(libFDTSources) ; + +SEARCH on [ FGristFiles $(libFDTSources) ] + = [ FDirName $(HAIKU_TOP) src libs libfdt ] ; + diff --git a/src/system/boot/platform/u-boot/fdt_support.cpp b/src/system/kernel/platform/u-boot/fdt_support.cpp similarity index 96% rename from src/system/boot/platform/u-boot/fdt_support.cpp rename to src/system/kernel/platform/u-boot/fdt_support.cpp index d0ac350ae8..fe05f6f9ad 100644 --- a/src/system/boot/platform/u-boot/fdt_support.cpp +++ b/src/system/kernel/platform/u-boot/fdt_support.cpp @@ -15,6 +15,10 @@ extern "C" { #include }; +#ifndef _BOOT_MODE +/* the bootloader has it in asm code to avoid it ending up in .bss */ +void *gFDT; +#endif extern "C" void dump_fdt(const void *fdt);