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 <geoffroy.vancutsem@intel.com>
This commit is contained in:
Geoffroy Van Cutsem 2018-11-19 15:54:44 +01:00 committed by Xie, Nanlin
parent 584f6b7255
commit 26dc54ce37
6 changed files with 18 additions and 15 deletions

View File

@ -154,13 +154,15 @@ config CPU_UP_TIMEOUT
for secondary CPUs to start up. for secondary CPUs to start up.
choice choice
prompt "serial IO type" prompt "Serial IO type"
depends on !RELEASE depends on !RELEASE
default SERIAL_MMIO if PLATFORM_SBL optional
default SERIAL_PIO if PLATFORM_UEFI
help help
Whether the physical serial port shall be accessed via memory-mapped If selected, this configures whether the physical serial port shall
registers or I/O ports. 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 config SERIAL_MMIO
bool "MMIO" bool "MMIO"

View File

@ -1,5 +1,5 @@
# Generated by Kconfiglib (https://github.com/ulfalizer/Kconfiglib)
CONFIG_BOARD="apl-mrb" CONFIG_BOARD="apl-mrb"
# CONFIG_PLATFORM_UEFI is not set CONFIG_SERIAL_MMIO=y
CONFIG_PLATFORM_SBL=y
CONFIG_COM_BASE=0x3e8 CONFIG_COM_BASE=0x3e8
CONFIG_COM_IRQ=6 CONFIG_COM_IRQ=6

View File

@ -1,7 +1,6 @@
CONFIG_BOARD="cb2_dnv" # Generated by Kconfiglib (https://github.com/ulfalizer/Kconfiglib)
CONFIG_PLATFORM_SBL=y
CONFIG_PARTITION_MODE=y CONFIG_PARTITION_MODE=y
CONFIG_BOARD="cb2_dnv"
CONFIG_SERIAL_PIO=y CONFIG_SERIAL_PIO=y
CONFIG_SERIAL_PIO_BASE=0x1000 CONFIG_SERIAL_PIO_BASE=0x1000
CONFIG_DMAR_PARSE_ENABLED=y CONFIG_DMAR_PARSE_ENABLED=y

View File

@ -1,3 +1,4 @@
CONFIG_BOARD="NUC6CAYH" # Generated by Kconfiglib (https://github.com/ulfalizer/Kconfiglib)
CONFIG_PLATFORM_UEFI=y CONFIG_PLATFORM_UEFI=y
# CONFIG_PLATFORM_SBL is not set CONFIG_BOARD="NUC6CAYH"
CONFIG_SERIAL_PIO=y

View File

@ -1,3 +1,5 @@
CONFIG_BOARD="UP2" # Generated by Kconfiglib (https://github.com/ulfalizer/Kconfiglib)
CONFIG_PLATFORM_UEFI=y CONFIG_PLATFORM_UEFI=y
# CONFIG_PLATFORM_SBL is not set CONFIG_BOARD="UP2"
CONFIG_SERIAL_MMIO=y
CONFIG_SERIAL_MMIO_BASE=0x9141e000

View File

@ -16,7 +16,6 @@ static bool serial_port_mapped;
static bool uart_enabled = true; static bool uart_enabled = true;
#define UART_BASE_ADDRESS CONFIG_SERIAL_MMIO_BASE #define UART_BASE_ADDRESS CONFIG_SERIAL_MMIO_BASE
#else #else
#warning "no uart base configure, please check!"
static bool serial_port_mapped; static bool serial_port_mapped;
static bool uart_enabled; static bool uart_enabled;
#define UART_BASE_ADDRESS 0UL #define UART_BASE_ADDRESS 0UL