acrn-config: add CONFIG_SERIAL_x for new board

Add CONFIG_SERIAL_x in $(borad).config, this will help to output
console log and help new board debug.

Tracked-On: #3854
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
This commit is contained in:
Wei Liu
2019-12-11 19:16:55 +08:00
committed by wenlingz
parent d699347e7b
commit 12a9bc29df
6 changed files with 46 additions and 12 deletions

View File

@@ -67,6 +67,7 @@ def get_ram_range():
def get_serial_type():
""" Get the serial type of consle which set by user """
ttys_type = ''
ttys_value = ''
# Get ttySx information from board config file
ttys_lines = board_cfg_lib.get_info(board_cfg_lib.BOARD_INFO_FILE, "<TTYS_INFO>", "</TTYS_INFO>")
@@ -85,11 +86,15 @@ def get_serial_type():
if ttyn in line:
# line format:
# seri:/dev/ttyS0 type:portio base:0x3F8 irq:4
# seri:/dev/ttyS0 type:mmio base:0xB3640000 irq:4
# seri:/dev/ttyS0 type:mmio base:0xB3640000 irq:4 bdf:"0:x.y"
ttys_type = line.split()[1].split(':')[1]
if ttys_type == "portio":
ttys_value = line.split()[2].split(':')[1]
elif ttys_type == "mmio":
ttys_value = line.split()[-1].split(':')[1]
break
return ttys_type
return (ttys_type, ttys_value)
def generate_file(config):
@@ -118,12 +123,14 @@ def generate_file(config):
print("{}".format(DESC), file=config)
print('CONFIG_BOARD="{}"'.format(board_cfg_lib.BOARD_NAME), file=config)
serial_type = get_serial_type()
(serial_type, serial_value) = 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":
print("CONFIG_SERIAL_PCI=y", file=config)
print("CONFIG_SERIAL_PCI_BDF={}".format(serial_value), file=config)
print("CONFIG_HV_RAM_START={}".format(hex(hv_start_addr)), file=config)
print("CONFIG_HV_RAM_SIZE={}".format(hex(hv_ram_size)), file=config)