2 * Copyright 2007, François Revol, revol@free.fr.
3 * Distributed under the terms of the MIT License.
5 * Copyright 2003-2006, Axel Dörfler, axeld@pinc-software.de.
6 * Distributed under the terms of the MIT License.
8 * Copyright 2001, Travis Geiselbrecht. All rights reserved.
9 * Distributed under the terms of the NewOS License.
13 //#include <arch_platform.h>
14 #include <arch/debug_console.h>
15 #include <arch/generic/debug_uart.h>
16 #include <boot/kernel_args.h>
22 // TODO: Declare this in some header
23 DebugUART
*gArchDebugUART
;
24 extern DebugUART
*debug_uart_from_fdt(const void *fdt
);
28 arch_debug_remove_interrupt_handler(uint32 line
)
34 arch_debug_install_interrupt_handlers(void)
40 arch_debug_blue_screen_try_getchar(void)
42 // TODO: Implement correctly!
43 return arch_debug_blue_screen_getchar();
48 arch_debug_blue_screen_getchar(void)
50 return arch_debug_serial_getchar();
55 arch_debug_serial_try_getchar(void)
57 // TODO: Implement correctly!
58 return arch_debug_serial_getchar();
63 arch_debug_serial_getchar(void)
65 return gArchDebugUART
->GetChar(false);
70 arch_debug_serial_putchar(const char c
)
72 gArchDebugUART
->PutChar(c
);
77 arch_debug_serial_puts(const char *s
)
80 arch_debug_serial_putchar(*s
);
87 arch_debug_serial_early_boot_message(const char *string
)
89 // this function will only be called in fatal situations
90 arch_debug_serial_puts(string
);
95 arch_debug_console_init(kernel_args
*args
)
97 // first try with hints from the FDT
98 gArchDebugUART
= debug_uart_from_fdt(args
->platform_args
.fdt
);
100 // Do we can some kind of direct fallback here
101 // (aka, guess arch_get_uart_pl011 or arch_get_uart_8250?)
102 if (gArchDebugUART
== NULL
)
105 gArchDebugUART
->InitEarly();
112 arch_debug_console_init_settings(kernel_args
*args
)