mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-09-18 15:28:43 +00:00
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:
@@ -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)
|
||||
|
Reference in New Issue
Block a user