From a722fbfc4558a940451da865b5474659cd91e6aa Mon Sep 17 00:00:00 2001 From: David Karoly Date: Wed, 24 Nov 2021 19:49:19 +0100 Subject: [PATCH] kernel/arch/arm: enable 8250 generic and OMAP UART drivers Change-Id: I45396eada2e9088b27df7fb9522d07e8ac223fd5 Reviewed-on: https://review.haiku-os.org/c/haiku/+/4741 Reviewed-by: Adrien Destugues --- headers/private/kernel/arch/arm/arch_uart_8250_omap.h | 3 +++ src/system/kernel/arch/arm/arch_debug_console.cpp | 11 ++++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/headers/private/kernel/arch/arm/arch_uart_8250_omap.h b/headers/private/kernel/arch/arm/arch_uart_8250_omap.h index 6bc65bc6f0..643b7432f3 100644 --- a/headers/private/kernel/arch/arm/arch_uart_8250_omap.h +++ b/headers/private/kernel/arch/arm/arch_uart_8250_omap.h @@ -17,6 +17,9 @@ #include +#define UART_KIND_8250_OMAP "8250-omap" + + class ArchUART8250Omap : public DebugUART8250 { public: ArchUART8250Omap(addr_t base, int64 clock); diff --git a/src/system/kernel/arch/arm/arch_debug_console.cpp b/src/system/kernel/arch/arm/arch_debug_console.cpp index 8e6a22eea3..8c6f259d40 100644 --- a/src/system/kernel/arch/arm/arch_debug_console.cpp +++ b/src/system/kernel/arch/arm/arch_debug_console.cpp @@ -12,6 +12,8 @@ #include #include +#include +#include #include #include #include @@ -98,11 +100,18 @@ arch_debug_serial_early_boot_message(const char *string) status_t arch_debug_console_init(kernel_args *args) { - //TODO: add initialiation for other UART types e.g. 8250 if (strncmp(args->arch_args.uart.kind, UART_KIND_PL011, sizeof(args->arch_args.uart.kind)) == 0) { sArchDebugUART = arch_get_uart_pl011(args->arch_args.uart.regs.start, args->arch_args.uart.clock); + } else if (strncmp(args->arch_args.uart.kind, UART_KIND_8250_OMAP, + sizeof(args->arch_args.uart.kind)) == 0) { + sArchDebugUART = arch_get_uart_8250_omap(args->arch_args.uart.regs.start, + args->arch_args.uart.clock); + } else if (strncmp(args->arch_args.uart.kind, UART_KIND_8250, + sizeof(args->arch_args.uart.kind)) == 0) { + sArchDebugUART = arch_get_uart_8250(args->arch_args.uart.regs.start, + args->arch_args.uart.clock); } // As a last try, lets assume qemu's pl011 at a sane address