fdt: Major over-haul of fdt
* Consolidate all fdt code into fdt bus_manager * Build boot and kernel static libraries Change-Id: I2a69cd7e1f1276999a80734ff12918fd49b599e5 Reviewed-on: https://review.haiku-os.org/440 Reviewed-by: Alexander von Gluck IV <[email protected]>
This commit is contained in:
@@ -12,11 +12,27 @@ local libFDTSources =
|
||||
fdt_wip.c
|
||||
;
|
||||
|
||||
# Do we want / need these in the bus as well?
|
||||
local earlyFDTHelpers =
|
||||
fdt_serial.cpp
|
||||
fdt_support.cpp
|
||||
;
|
||||
|
||||
KernelAddon fdt :
|
||||
fdt.cpp
|
||||
# $(libFDTSources)
|
||||
;
|
||||
|
||||
BootStaticLibrary boot_fdt :
|
||||
$(earlyFDTHelpers)
|
||||
$(libFDTSources)
|
||||
;
|
||||
|
||||
KernelStaticLibrary kernel_fdt :
|
||||
$(earlyFDTHelpers)
|
||||
$(libFDTSources)
|
||||
;
|
||||
|
||||
SEARCH on [ FGristFiles $(libFDTSources) ]
|
||||
= [ FDirName $(HAIKU_TOP) src libs libfdt ] ;
|
||||
|
||||
|
||||
-8
@@ -41,14 +41,6 @@ static const char *sTabTab = "\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t";
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef _BOOT_MODE
|
||||
/* the bootloader has it in asm code to avoid it ending up in .bss */
|
||||
void *gFDT;
|
||||
#else
|
||||
extern void *gFDT;
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef FDT_DUMP_PROP_VALUES
|
||||
static void dump_hex(const char *data, int32 len, int depth)
|
||||
{
|
||||
@@ -1,9 +1,8 @@
|
||||
SubDir HAIKU_TOP src system boot arch arm ;
|
||||
|
||||
UsePrivateHeaders [ FDirName kernel platform $(TARGET_BOOT_PLATFORM) ] ;
|
||||
|
||||
#XXX: should not be needed here
|
||||
UseLibraryHeaders [ FDirName libfdt ] ;
|
||||
UsePrivateHeaders [ FDirName kernel platform $(TARGET_BOOT_PLATFORM) ] ;
|
||||
SubDirHdrs $(HAIKU_TOP) src add-ons kernel bus_managers fdt ;
|
||||
|
||||
{
|
||||
local defines = _BOOT_MODE ;
|
||||
|
||||
@@ -2,9 +2,12 @@ SubDir HAIKU_TOP src system boot platform u-boot ;
|
||||
|
||||
SubDirHdrs $(HAIKU_TOP) headers private kernel boot platform $(TARGET_BOOT_PLATFORM) ;
|
||||
SubDirHdrs $(HAIKU_TOP) headers private kernel platform $(TARGET_BOOT_PLATFORM) ;
|
||||
SubDirHdrs $(HAIKU_TOP) src add-ons kernel bus_managers fdt ;
|
||||
|
||||
SubDirHdrs $(HAIKU_TOP) src system boot arch $(TARGET_KERNEL_ARCH) ;
|
||||
|
||||
UseLibraryHeaders [ FDirName libfdt ] ;
|
||||
|
||||
UsePrivateHeaders [ FDirName kernel disk_device_manager ] ;
|
||||
UsePrivateHeaders [ FDirName graphics common ] ;
|
||||
UsePrivateHeaders [ FDirName graphics vesa ] ;
|
||||
@@ -19,17 +22,6 @@ UsePrivateHeaders [ FDirName kernel arch generic ] ;
|
||||
SubDirC++Flags $(defines) -fno-rtti -g3 -O0 ;
|
||||
}
|
||||
|
||||
UseLibraryHeaders [ FDirName libfdt ] ;
|
||||
|
||||
local libFDTSources =
|
||||
fdt.c
|
||||
fdt_ro.c
|
||||
fdt_rw.c
|
||||
fdt_strerror.c
|
||||
fdt_sw.c
|
||||
fdt_wip.c
|
||||
;
|
||||
|
||||
# we fake NetBSD since we don't have an OS ID yet for uimage,
|
||||
# and we also fake a netbsd loader anyway.
|
||||
local uImageFakeOS = "netbsd" ;
|
||||
@@ -58,15 +50,12 @@ BootMergeObject boot_platform_u-boot_common.o :
|
||||
cpu.cpp
|
||||
uimage.cpp
|
||||
video.cpp
|
||||
fdt_serial.cpp
|
||||
fdt_support.cpp
|
||||
openfirmware.cpp
|
||||
$(genericPlatformSources)
|
||||
$(libFDTSources)
|
||||
|
||||
|
||||
:
|
||||
: boot_platform_generic.a
|
||||
:
|
||||
boot_platform_generic.a
|
||||
boot_fdt.a
|
||||
;
|
||||
|
||||
BootMergeObject boot_platform_u-boot.o :
|
||||
@@ -281,12 +270,9 @@ Depends haiku-mmc-image : haiku-$(TARGET_KERNEL_ARCH).mmc ;
|
||||
SEARCH on [ FGristFiles $(genericPlatformSources) ]
|
||||
= [ FDirName $(HAIKU_TOP) src system boot platform generic ] ;
|
||||
|
||||
SEARCH on [ FGristFiles openfirmware.cpp fdt_serial.cpp fdt_support.cpp ]
|
||||
SEARCH on [ FGristFiles openfirmware.cpp ]
|
||||
= [ FDirName $(HAIKU_TOP) src system kernel platform u-boot ] ;
|
||||
|
||||
SEARCH on [ FGristFiles $(libFDTSources) ]
|
||||
= [ FDirName $(HAIKU_TOP) src libs libfdt ] ;
|
||||
|
||||
# Tell the build system to where stage1.bin can be found, so it can be used
|
||||
# elsewhere.
|
||||
SEARCH on stage1.bin = $(SUBDIR) ;
|
||||
|
||||
@@ -2,6 +2,7 @@ SubDir HAIKU_TOP src system boot platform u-boot arch arm ;
|
||||
|
||||
SubDirHdrs $(HAIKU_TOP) src system boot platform $(TARGET_BOOT_PLATFORM) ;
|
||||
SubDirHdrs $(HAIKU_TOP) src system boot arch $(TARGET_KERNEL_ARCH) ;
|
||||
SubDirHdrs $(HAIKU_TOP) src add-ons kernel bus_managers fdt ;
|
||||
|
||||
UsePrivateSystemHeaders ;
|
||||
UsePrivateHeaders kernel [ FDirName kernel platform u-boot ] ;
|
||||
|
||||
@@ -55,7 +55,7 @@ KernelMergeObject kernel_arch_arm.o :
|
||||
:
|
||||
$(TARGET_KERNEL_PIC_CCFLAGS) -Wno-unused
|
||||
:
|
||||
|
||||
kernel_fdt.a
|
||||
;
|
||||
|
||||
CreateAsmStructOffsetsHeader asm_offsets.h : asm_offsets.cpp ;
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
|
||||
#include <drivers/bus/FDT.h>
|
||||
|
||||
extern char *gFDT;
|
||||
char *gFDT;
|
||||
|
||||
status_t
|
||||
arch_platform_init(struct kernel_args *kernelArgs)
|
||||
|
||||
@@ -53,6 +53,9 @@ KernelMergeObject kernel_arch_ppc.o :
|
||||
arch_vm.cpp
|
||||
arch_vm_translation_map.cpp
|
||||
arch_asm.S
|
||||
|
||||
# serial uart
|
||||
fdt_serial.cpp
|
||||
debug_uart_8250.cpp
|
||||
arch_uart_8250.cpp
|
||||
|
||||
@@ -70,6 +73,7 @@ KernelMergeObject kernel_arch_ppc.o :
|
||||
:
|
||||
arch_ppc_classic.o
|
||||
arch_ppc_460.o
|
||||
kernel_fdt.a
|
||||
;
|
||||
|
||||
CreateAsmStructOffsetsHeader asm_offsets.h : asm_offsets.cpp ;
|
||||
|
||||
@@ -15,11 +15,9 @@
|
||||
#include <real_time_clock.h>
|
||||
#include <util/kernel_cpp.h>
|
||||
|
||||
#include "fdt_serial.h"
|
||||
|
||||
// TODO: declare this in some header
|
||||
extern void *gFDT;
|
||||
extern DebugUART *debug_uart_from_fdt(const void *fdt);
|
||||
|
||||
void *gFDT;
|
||||
static PPCPlatform *sPPCPlatform;
|
||||
|
||||
|
||||
|
||||
@@ -1,29 +1,12 @@
|
||||
SubDir HAIKU_TOP src system kernel platform u-boot ;
|
||||
|
||||
SubDirHdrs $(HAIKU_TOP) headers private kernel platform $(TARGET_BOOT_PLATFORM) ;
|
||||
UseLibraryHeaders [ FDirName libfdt ] ;
|
||||
|
||||
SubDirCcFlags $(TARGET_KERNEL_PIC_CCFLAGS) ;
|
||||
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_serial.cpp
|
||||
fdt_support.cpp
|
||||
openfirmware.cpp
|
||||
$(libFDTSources)
|
||||
;
|
||||
|
||||
SEARCH on [ FGristFiles $(libFDTSources) ]
|
||||
= [ FDirName $(HAIKU_TOP) src libs libfdt ] ;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user