mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-09-16 14:28:56 +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:
@@ -48,6 +48,30 @@ def detected_ttys():
|
||||
return tty_used_list
|
||||
|
||||
|
||||
def irq2bdf(irq_n):
|
||||
cmd = 'lspci -vv'
|
||||
res = parser_lib.cmd_execute(cmd)
|
||||
bdf = ''
|
||||
irq = 0
|
||||
while True:
|
||||
line = res.stdout.readline().decode('ascii')
|
||||
if not line:
|
||||
break
|
||||
|
||||
if ':' not in line:
|
||||
continue
|
||||
|
||||
if '.' in line.split()[0]:
|
||||
bdf = line.split()[0]
|
||||
|
||||
if "Interrupt:" in line.strip():
|
||||
irq = line.split()[-1]
|
||||
if irq == irq_n and bdf:
|
||||
break
|
||||
|
||||
return bdf
|
||||
|
||||
|
||||
def dump_ttys_info(ttys_list, config):
|
||||
for ttys in ttys_list:
|
||||
ttys_n = ttys.split('/')[-1]
|
||||
@@ -65,7 +89,8 @@ def dump_ttys_info(ttys_list, config):
|
||||
elif ttys_type[serial_type] == 'MMIO':
|
||||
base_path = '{}{}/iomem_base'.format(TTY_PATH, ttys_n)
|
||||
base = read_ttys_node(base_path)
|
||||
print("\tseri:{} type:mmio base:{} irq:{}".format(ttys, base, irq), file=config)
|
||||
bdf = irq2bdf(irq)
|
||||
print('\tseri:{} type:mmio base:{} irq:{} bdf:"{}"'.format(ttys, base, irq, bdf), file=config)
|
||||
|
||||
|
||||
def dump_ttys(config):
|
||||
|
Reference in New Issue
Block a user