From 26dc54ce3792aa5244c0d56ab7dc67b7967da404 Mon Sep 17 00:00:00 2001 From: Geoffroy Van Cutsem Date: Mon, 19 Nov 2018 15:54:44 +0100 Subject: [PATCH] HV: allow disabling serial port via Kconfig This patch allows to disable the serial port directly from Kconfig. This used to only be possible from the command-line (by passing "uart=disabled"). To disable the serial port via Kconfig, simply unselect the "Serial IO type" option. The default options do not seem to have any effect anymore (and were confusing anyway) so they are removed and the serial port is enabled for various platforms in their corresponding *.config file. Tracked-On: #1481 Signed-off-by: Geoffroy Van Cutsem --- hypervisor/arch/x86/Kconfig | 12 +++++++----- hypervisor/arch/x86/configs/apl-mrb.config | 4 ++-- hypervisor/arch/x86/configs/cb2_dnv.config | 5 ++--- hypervisor/arch/x86/configs/nuc6cayh.config | 5 +++-- hypervisor/arch/x86/configs/up2.config | 6 ++++-- hypervisor/debug/uart16550.c | 1 - 6 files changed, 18 insertions(+), 15 deletions(-) diff --git a/hypervisor/arch/x86/Kconfig b/hypervisor/arch/x86/Kconfig index 3244967ee..0e4819c1b 100644 --- a/hypervisor/arch/x86/Kconfig +++ b/hypervisor/arch/x86/Kconfig @@ -154,13 +154,15 @@ config CPU_UP_TIMEOUT for secondary CPUs to start up. choice - prompt "serial IO type" + prompt "Serial IO type" depends on !RELEASE - default SERIAL_MMIO if PLATFORM_SBL - default SERIAL_PIO if PLATFORM_UEFI + optional help - Whether the physical serial port shall be accessed via memory-mapped - registers or I/O ports. + If selected, this configures whether the physical serial port shall + be accessed via memory-mapped registers or I/O ports. + + If this is not selected, the serial port is disabled. This is the + default. config SERIAL_MMIO bool "MMIO" diff --git a/hypervisor/arch/x86/configs/apl-mrb.config b/hypervisor/arch/x86/configs/apl-mrb.config index 5e87dc17f..71b03b332 100644 --- a/hypervisor/arch/x86/configs/apl-mrb.config +++ b/hypervisor/arch/x86/configs/apl-mrb.config @@ -1,5 +1,5 @@ +# Generated by Kconfiglib (https://github.com/ulfalizer/Kconfiglib) CONFIG_BOARD="apl-mrb" -# CONFIG_PLATFORM_UEFI is not set -CONFIG_PLATFORM_SBL=y +CONFIG_SERIAL_MMIO=y CONFIG_COM_BASE=0x3e8 CONFIG_COM_IRQ=6 diff --git a/hypervisor/arch/x86/configs/cb2_dnv.config b/hypervisor/arch/x86/configs/cb2_dnv.config index 17cd06f03..94c562bd8 100644 --- a/hypervisor/arch/x86/configs/cb2_dnv.config +++ b/hypervisor/arch/x86/configs/cb2_dnv.config @@ -1,7 +1,6 @@ -CONFIG_BOARD="cb2_dnv" -CONFIG_PLATFORM_SBL=y +# Generated by Kconfiglib (https://github.com/ulfalizer/Kconfiglib) CONFIG_PARTITION_MODE=y +CONFIG_BOARD="cb2_dnv" CONFIG_SERIAL_PIO=y CONFIG_SERIAL_PIO_BASE=0x1000 CONFIG_DMAR_PARSE_ENABLED=y - diff --git a/hypervisor/arch/x86/configs/nuc6cayh.config b/hypervisor/arch/x86/configs/nuc6cayh.config index 7ffdde65e..f056ac725 100644 --- a/hypervisor/arch/x86/configs/nuc6cayh.config +++ b/hypervisor/arch/x86/configs/nuc6cayh.config @@ -1,3 +1,4 @@ -CONFIG_BOARD="NUC6CAYH" +# Generated by Kconfiglib (https://github.com/ulfalizer/Kconfiglib) CONFIG_PLATFORM_UEFI=y -# CONFIG_PLATFORM_SBL is not set +CONFIG_BOARD="NUC6CAYH" +CONFIG_SERIAL_PIO=y diff --git a/hypervisor/arch/x86/configs/up2.config b/hypervisor/arch/x86/configs/up2.config index a3f620724..45491fa00 100644 --- a/hypervisor/arch/x86/configs/up2.config +++ b/hypervisor/arch/x86/configs/up2.config @@ -1,3 +1,5 @@ -CONFIG_BOARD="UP2" +# Generated by Kconfiglib (https://github.com/ulfalizer/Kconfiglib) CONFIG_PLATFORM_UEFI=y -# CONFIG_PLATFORM_SBL is not set +CONFIG_BOARD="UP2" +CONFIG_SERIAL_MMIO=y +CONFIG_SERIAL_MMIO_BASE=0x9141e000 diff --git a/hypervisor/debug/uart16550.c b/hypervisor/debug/uart16550.c index b787166fa..038d10c4d 100644 --- a/hypervisor/debug/uart16550.c +++ b/hypervisor/debug/uart16550.c @@ -16,7 +16,6 @@ static bool serial_port_mapped; static bool uart_enabled = true; #define UART_BASE_ADDRESS CONFIG_SERIAL_MMIO_BASE #else -#warning "no uart base configure, please check!" static bool serial_port_mapped; static bool uart_enabled; #define UART_BASE_ADDRESS 0UL