menu "Console Options"
-config KVM_KERNEL_SERIAL_CONSOLE
- bool "Serial console for the kernel prints"
- default y
- depends on (ARCH_X86_64 || ARCH_ARM_64)
- select UART_PL011 if ARCH_ARM_64
- help
- Choose serial console for the kernel printing
-
config KVM_KERNEL_VGA_CONSOLE
bool "VGA console for the kernel prints"
default y
help
Choose VGA console for the debug printing
+config KVM_KERNEL_SERIAL_CONSOLE
+ bool "Serial console for the kernel prints"
+ default y
+ depends on (ARCH_X86_64 || ARCH_ARM_64)
+ help
+ Choose serial console for the kernel printing
+
if (KVM_KVM_KERNEL_SERIAL_CONSOLE || KVM_DEBUG_SERIAL_CONSOLE)
+
+choice
+ prompt "Serial console driver"
+ depends on ARCH_ARM_64
+ default UART_PL011 if KVM_VMM_QEMU
+ default UART_NS16550 if KVM_VMM_FIRECRACKER
+
+config UART_PL011
+ bool "PrimeCell UART (PL011)"
+
+config UART_NS16550
+ bool "8250 / NS16550"
+endchoice
+
menu "Serial console configuration"
- if ARCH_X86_64
- choice
- prompt "Baudrate"
- default KVM_SERIAL_BAUD_115200
-
- config KVM_SERIAL_BAUD_115200
- bool "115200"
-
- config KVM_SERIAL_BAUD_57600
- bool "57600"
-
- config KVM_SERIAL_BAUD_38400
- bool "38400"
-
- config KVM_SERIAL_BAUD_19200
- bool "19200"
- endchoice
- endif
-
- if ARCH_ARM_64
- config EARLY_PRINT_PL011_UART_ADDR
- hex "Early debug console pl011 serial address"
- default 0x09000000
- depends on (KVM_DEBUG_SERIAL_CONSOLE && ARCH_ARM_64)
- help
- Pl011 serial address used by early debug console.
- endif
+if ARCH_X86_64
+choice
+ prompt "Baudrate"
+ default KVM_SERIAL_BAUD_115200
+
+ config KVM_SERIAL_BAUD_115200
+ bool "115200"
+
+ config KVM_SERIAL_BAUD_57600
+ bool "57600"
+
+ config KVM_SERIAL_BAUD_38400
+ bool "38400"
+
+ config KVM_SERIAL_BAUD_19200
+ bool "19200"
+endchoice
+endif
+
+config EARLY_PRINT_PL011_UART_ADDR
+ hex "Early debug console pl011 serial address"
+ depends on UART_PL011
+ default 0x09000000
+ depends on (KVM_DEBUG_SERIAL_CONSOLE && ARCH_ARM_64)
+ help
+ Pl011 serial address used by early debug console.
+
+config EARLY_UART_NS16550
+ bool "Early console"
+ depends on UART_NS16550
+ default n
+
+config EARLY_UART_NS16550_BASE
+ hex "Early debug console ns16550 serial address"
+ depends on EARLY_UART_NS16550
+ help
+ NS16550 serial address used by early debug console.
endmenu
endif
##
## Architecture library definitions for arm64
##
-ifeq ($(findstring y,$(CONFIG_KVM_KERNEL_SERIAL_CONSOLE) $(CONFIG_KVM_DEBUG_SERIAL_CONSOLE)),y)
-LIBKVMPLAT_SRCS-$(CONFIG_ARCH_ARM_64) += $(UK_PLAT_DRIVERS_BASE)/uart/pl011.c
-endif
+LIBKVMPLAT_SRCS-$(CONFIG_UART_NS16550) += $(UK_PLAT_DRIVERS_BASE)/uart/ns16550.c
+LIBKVMPLAT_SRCS-$(CONFIG_UART_PL011) += $(UK_PLAT_DRIVERS_BASE)/uart/pl011.c
ifeq ($(CONFIG_PAGING),y)
LIBKVMPLAT_SRCS-$(CONFIG_ARCH_ARM_64) += $(UK_PLAT_COMMON_BASE)/paging.c|isr
endif
--- /dev/null
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* Copyright (c) 2023, Unikraft GmbH and The Unikraft Authors.
+ * Licensed under the BSD-3-Clause License (the "License").
+ * You may not use this file except in compliance with the License.
+ */
+#if CONFIG_UART_NS16550
+#include <uart/ns16550.h>
+#endif /* CONFIG UART_NS16550 */
+
+#if CONFIG_UART_PL011
+#include <uart/pl011.h>
+#endif /* CONFIG_UART_PL011 */
+
+static inline void kvm_console_init(void *fdt)
+{
+#if CONFIG_UART_NS16550
+ ns16550_console_init(fdt);
+#endif /* CONFIG UART_NS16550 */
+
+#if CONFIG_UART_PL011
+ pl011_console_init(fdt);
+#endif /* CONFIG_UART_PL011 */
+}