From 1f675a7fcbc9a2a6177d22c279e6c923d763a6ee Mon Sep 17 00:00:00 2001 From: Alexander von Gluck IV Date: Thu, 17 May 2012 05:31:29 -0500 Subject: [PATCH] uart: Fix arm kernel build * Make kernel use mmu_man's new UART code * Remove no longer used uart.cpp / uart.h --- headers/private/kernel/arch/arm/uart.h | 22 ---------- src/system/boot/platform/u-boot/serial.cpp | 2 +- src/system/kernel/arch/arm/Jamfile | 7 ++-- .../kernel/arch/arm/arch_debug_console.cpp | 16 ++++---- src/system/kernel/arch/arm/uart.cpp | 41 ------------------- 5 files changed, 13 insertions(+), 75 deletions(-) delete mode 100644 headers/private/kernel/arch/arm/uart.h delete mode 100644 src/system/kernel/arch/arm/uart.cpp diff --git a/headers/private/kernel/arch/arm/uart.h b/headers/private/kernel/arch/arm/uart.h deleted file mode 100644 index 7d340672ca..0000000000 --- a/headers/private/kernel/arch/arm/uart.h +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright 2011-2012 Haiku, Inc. All rights reserved. - * Distributed under the terms of the MIT License. - * - * Authors: - * Alexander von Gluck, kallisti5@unixzen.com - */ -#ifndef __DEV_UART_H -#define __DEV_UART_H - - -#include - -#include "uart_8250.h" -#include "uart_pl011.h" - - -addr_t uart_base_port(int port); -addr_t uart_base_debug(); - - -#endif diff --git a/src/system/boot/platform/u-boot/serial.cpp b/src/system/boot/platform/u-boot/serial.cpp index 2a8f8f9ab4..12c6357d26 100644 --- a/src/system/boot/platform/u-boot/serial.cpp +++ b/src/system/boot/platform/u-boot/serial.cpp @@ -18,7 +18,7 @@ #include -DebugUART8250* gUART; +DebugUART* gUART; static int32 sSerialEnabled = 0; static char sBuffer[16384]; diff --git a/src/system/kernel/arch/arm/Jamfile b/src/system/kernel/arch/arm/Jamfile index 2a10ddd8b8..13a56e44e6 100644 --- a/src/system/kernel/arch/arm/Jamfile +++ b/src/system/kernel/arch/arm/Jamfile @@ -7,6 +7,7 @@ UsePrivateHeaders [ FDirName kernel arch $(TARGET_ARCH) board $(TARGET_BOOT_BOAR SEARCH_SOURCE += [ FDirName $(SUBDIR) paging ] ; SEARCH_SOURCE += [ FDirName $(SUBDIR) paging 32bit ] ; +SEARCH_SOURCE += [ FDirName $(SUBDIR) $(DOTDOT) generic ] ; KernelMergeObject kernel_arch_arm.o : # arch_atomic.c @@ -28,9 +29,9 @@ KernelMergeObject kernel_arch_arm.o : arch_vm.cpp arch_vm_translation_map.cpp arch_asm.S - uart.cpp - uart_8250.cpp - uart_pl011.cpp + debug_uart_8250.cpp + arch_uart_8250.cpp + arch_uart_pl011.cpp # paging arm_physical_page_mapper.cpp diff --git a/src/system/kernel/arch/arm/arch_debug_console.cpp b/src/system/kernel/arch/arm/arch_debug_console.cpp index 5e6d4210c7..bce88e10ee 100644 --- a/src/system/kernel/arch/arm/arch_debug_console.cpp +++ b/src/system/kernel/arch/arm/arch_debug_console.cpp @@ -12,18 +12,17 @@ //#include #include +#include +#include #include #include #include -#include #include +#include "board_config.h" -#if defined(BOARD_UART_AMBA_PL011) -UartPL011* gArchDebugUART; -#else -Uart8250* gArchDebugUART; -#endif + +DebugUART *gArchDebugUART; void @@ -97,9 +96,10 @@ status_t arch_debug_console_init(kernel_args *args) { #if defined(BOARD_UART_AMBA_PL011) - gArchDebugUART = new UartPL011(uart_base_debug()); + gArchDebugUART = arch_get_uart_pl011(BOARD_UART_DEBUG, BOARD_UART_CLOCK); #else - gArchDebugUART = new Uart8250(uart_base_debug()); + // More Generic 8250 + gArchDebugUART = arch_get_uart_8250(BOARD_UART_DEBUG, BOARD_UART_CLOCK); #endif gArchDebugUART->InitEarly(); diff --git a/src/system/kernel/arch/arm/uart.cpp b/src/system/kernel/arch/arm/uart.cpp deleted file mode 100644 index bba93b8308..0000000000 --- a/src/system/kernel/arch/arm/uart.cpp +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright 2011-2012 Haiku, Inc. All rights reserved. - * Distributed under the terms of the MIT License. - * - * Authors: - * Alexander von Gluck, kallisti5@unixzen.com - */ - - -#include -#include -#include -#include -#include -//#include - - -#define DEBUG_UART BOARD_UART_DEBUG - - -addr_t -uart_base_debug() -{ - return DEBUG_UART; -} - - -addr_t -uart_base_port(int port) -{ - switch (port) { - case 1: - return BOARD_UART1_BASE; - case 2: - return BOARD_UART2_BASE; - case 3: - return BOARD_UART3_BASE; - } - - return uart_base_debug(); -}