From 3674179701e96b630750a28c0d9817ffc880f5e3 Mon Sep 17 00:00:00 2001 From: Wei Liu Date: Fri, 21 Aug 2020 11:39:46 +0800 Subject: [PATCH] acrn-config: add MMIO type for debug UART Tracked-On: #4937 Signed-off-by: Wei Liu --- misc/acrn-config/hv_config/board_defconfig.py | 14 ++++++++++---- misc/vm_configs/xmls/board-xmls/ehl-crb-b.xml | 3 ++- .../xmls/config-xmls/ehl-crb-b/industry.xml | 2 +- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/misc/acrn-config/hv_config/board_defconfig.py b/misc/acrn-config/hv_config/board_defconfig.py index 3d51ce4bd..4cb498ecd 100644 --- a/misc/acrn-config/hv_config/board_defconfig.py +++ b/misc/acrn-config/hv_config/board_defconfig.py @@ -37,6 +37,7 @@ def get_serial_type(): """ Get serial console type specified by user """ ttys_type = '' ttys_value = '' + pci_mmio = False # Get ttySx information from board config file ttys_lines = board_cfg_lib.get_info(common.BOARD_INFO_FILE, "", "") @@ -58,11 +59,12 @@ def get_serial_type(): elif ttys_type == "mmio": if 'bdf' in line: ttys_value = line.split()[-1].split('"')[1:-1][0] + pci_mmio = True else: - common.print_yel("You have chosen a MMIO PCI serial that BDF does not existed for HV console.", warn=True) + ttys_value = line.split()[2].split(':')[1] break - return (ttys_type, ttys_value) + return (ttys_type, ttys_value, pci_mmio) def get_memory(hv_info, config): @@ -111,14 +113,18 @@ def get_memory(hv_info, config): def get_serial_console(config): - (serial_type, serial_value) = get_serial_type() + (serial_type, serial_value, pci_mmio) = get_serial_type() if serial_type == "portio": print("CONFIG_SERIAL_LEGACY=y", file=config) print("CONFIG_SERIAL_PIO_BASE={}".format(serial_value), file=config) - if serial_type == "mmio": + elif serial_type == "mmio" and pci_mmio: print("CONFIG_SERIAL_PCI=y", file=config) if serial_value: print('CONFIG_SERIAL_PCI_BDF="{}"'.format(serial_value), file=config) + else: + print("CONFIG_SERIAL_MMIO=y", file=config) + if serial_value: + print('CONFIG_SERIAL_MMIO_BASE={}'.format(serial_value), file=config) def get_miscfg(hv_info, config): diff --git a/misc/vm_configs/xmls/board-xmls/ehl-crb-b.xml b/misc/vm_configs/xmls/board-xmls/ehl-crb-b.xml index cb7741419..40563c1d3 100644 --- a/misc/vm_configs/xmls/board-xmls/ehl-crb-b.xml +++ b/misc/vm_configs/xmls/board-xmls/ehl-crb-b.xml @@ -397,10 +397,11 @@ seri:/dev/ttyS0 type:mmio base:0x83449000 irq:33 bdf:"00:19.2" seri:/dev/ttyS1 type:mmio base:0x8344A000 irq:16 bdf:"00:1e.0" seri:/dev/ttyS2 type:mmio base:0x8344B000 irq:17 bdf:"00:1e.1" + seri:/dev/ttyS3 type:mmio base:0xfe042000 irq:3 - 3, 4, 5, 6, 7, 10, 11, 12, 13, 14, 15 + 4, 5, 6, 7, 10, 11, 12, 13, 14, 15 diff --git a/misc/vm_configs/xmls/config-xmls/ehl-crb-b/industry.xml b/misc/vm_configs/xmls/config-xmls/ehl-crb-b/industry.xml index 0aa6372bc..ba17674f5 100644 --- a/misc/vm_configs/xmls/config-xmls/ehl-crb-b/industry.xml +++ b/misc/vm_configs/xmls/config-xmls/ehl-crb-b/industry.xml @@ -3,7 +3,7 @@ n - /dev/ttyS0 + /dev/ttyS3 5 5 3