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 <pulkomandy@gmail.com>
This commit is contained in:
David Karoly 2021-11-24 19:49:19 +01:00 committed by Adrien Destugues
parent 15951db938
commit a722fbfc45
2 changed files with 13 additions and 1 deletions

View File

@ -17,6 +17,9 @@
#include <arch/generic/debug_uart.h>
#define UART_KIND_8250_OMAP "8250-omap"
class ArchUART8250Omap : public DebugUART8250 {
public:
ArchUART8250Omap(addr_t base, int64 clock);

View File

@ -12,6 +12,8 @@
#include <arch/debug_console.h>
#include <arch/generic/debug_uart.h>
#include <arch/generic/debug_uart_8250.h>
#include <arch/arm/arch_uart_8250_omap.h>
#include <arch/arm/arch_uart_pl011.h>
#include <boot/kernel_args.h>
#include <kernel.h>
@ -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