acrn-config: add MMIO type for debug UART

Tracked-On: #4937
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
This commit is contained in:
Wei Liu 2020-08-21 11:39:46 +08:00 committed by wenlingz
parent d0e06c4f80
commit 3674179701
3 changed files with 13 additions and 6 deletions

View File

@ -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, "<TTYS_INFO>", "</TTYS_INFO>")
@ -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):

View File

@ -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
</TTYS_INFO>
<AVAILABLE_IRQ_INFO>
3, 4, 5, 6, 7, 10, 11, 12, 13, 14, 15
4, 5, 6, 7, 10, 11, 12, 13, 14, 15
</AVAILABLE_IRQ_INFO>
<TOTAL_MEM_INFO>

View File

@ -3,7 +3,7 @@
<hv>
<DEBUG_OPTIONS desc="Debug options for ACRN hypervisor, only valid on debug version">
<RELEASE desc="Release build. 'y' for Release, 'n' for Debug.">n</RELEASE>
<SERIAL_CONSOLE desc="The serial device which is used for hypervisor debug, only valid on Debug version.">/dev/ttyS0</SERIAL_CONSOLE>
<SERIAL_CONSOLE desc="The serial device which is used for hypervisor debug, only valid on Debug version.">/dev/ttyS3</SERIAL_CONSOLE>
<MEM_LOGLEVEL desc="Default loglevel in memory">5</MEM_LOGLEVEL>
<NPK_LOGLEVEL desc="Default loglevel for the hypervisor NPK log">5</NPK_LOGLEVEL>
<CONSOLE_LOGLEVEL desc="Default loglevel on the serial console">3</CONSOLE_LOGLEVEL>