diff --git a/build/jam/ArchitectureRules b/build/jam/ArchitectureRules index 706e61d552..9e87fad8a4 100644 --- a/build/jam/ArchitectureRules +++ b/build/jam/ArchitectureRules @@ -234,6 +234,7 @@ rule KernelArchitectureSetup architecture case arm : HAIKU_BOOT_PLATFORM ?= u-boot ; + HAIKU_BOARD_LOADER_BASE ?= 0x1000000 ; HAIKU_BOOT_FLOPPY_IMAGE_SIZE = 1440 ; # offset in floppy image (>= sizeof(haiku_loader)) HAIKU_BOOT_ARCHIVE_IMAGE_OFFSET = 192 ; # in kB - unused yet @@ -325,14 +326,10 @@ rule KernelArchitectureSetup architecture HAIKU_KERNEL_PIC_LINKFLAGS = ; HAIKU_KERNEL_ADDON_LINKFLAGS = ; - # Include embedded board-specific file. - if $(HAIKU_BOOT_BOARD) { - include [ FDirName $(HAIKU_BUILD_RULES_DIR) board $(HAIKU_BOOT_BOARD) - BoardSetup ] ; - if $(HAIKU_BOARD_LOADER_BASE) { - HAIKU_BOOT_LDFLAGS += - --defsym BOARD_LOADER_BASE=$(HAIKU_BOARD_LOADER_BASE) ; - } + # Any special kernel base addresses + if $(HAIKU_BOARD_LOADER_BASE) { + HAIKU_BOOT_LDFLAGS += + --defsym BOARD_LOADER_BASE=$(HAIKU_BOARD_LOADER_BASE) ; } switch $(cpu) { diff --git a/src/system/kernel/arch/arm/arch_debug_console.cpp b/src/system/kernel/arch/arm/arch_debug_console.cpp index 195b68b632..b76b32547f 100644 --- a/src/system/kernel/arch/arm/arch_debug_console.cpp +++ b/src/system/kernel/arch/arm/arch_debug_console.cpp @@ -12,17 +12,16 @@ //#include #include -#include -#include +#include #include #include #include #include -#include "board_config.h" - +// TODO: Declare this in some header DebugUART *gArchDebugUART; +extern DebugUART *debug_uart_from_fdt(const void *fdt); void @@ -95,12 +94,13 @@ arch_debug_serial_early_boot_message(const char *string) status_t arch_debug_console_init(kernel_args *args) { - #if defined(BOARD_UART_PL011) - gArchDebugUART = arch_get_uart_pl011(BOARD_UART_DEBUG, BOARD_UART_CLOCK); - #else - // More Generic 8250 - gArchDebugUART = arch_get_uart_8250(BOARD_UART_DEBUG, BOARD_UART_CLOCK); - #endif + // first try with hints from the FDT + gArchDebugUART = debug_uart_from_fdt(args->platform_args.fdt); + + // Do we can some kind of direct fallback here + // (aka, guess arch_get_uart_pl011 or arch_get_uart_8250?) + if (gArchDebugUART == NULL) + return B_ERROR; gArchDebugUART->InitEarly();