mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-06-18 19:57:31 +00:00
config_tools: board_inspector: parse bdf for ioport serial controler
Add bdf infomation to ioport serial controler. Tracked-On: #8235 Signed-off-by: Yuanyuan Zhao <yuanyuan.zhao@linux.intel.com> Reviewed-by: Junjie Mao junjie.mao@intel.com
This commit is contained in:
parent
dcb0f05efc
commit
f9e16db9e1
@ -3,7 +3,8 @@
|
|||||||
# SPDX-License-Identifier: BSD-3-Clause
|
# SPDX-License-Identifier: BSD-3-Clause
|
||||||
#
|
#
|
||||||
|
|
||||||
import parser_lib
|
import parser_lib, os
|
||||||
|
from extractors.helpers import get_bdf_from_realpath
|
||||||
|
|
||||||
MEM_PATH = ['/proc/iomem', '/proc/meminfo']
|
MEM_PATH = ['/proc/iomem', '/proc/meminfo']
|
||||||
TTY_PATH = '/sys/class/tty/'
|
TTY_PATH = '/sys/class/tty/'
|
||||||
@ -91,6 +92,14 @@ def dump_ttys_info(ttys_list, config):
|
|||||||
if ttys_type[serial_type] == 'PORT':
|
if ttys_type[serial_type] == 'PORT':
|
||||||
base_path = '{}{}/port'.format(TTY_PATH, ttys_n)
|
base_path = '{}{}/port'.format(TTY_PATH, ttys_n)
|
||||||
base = read_ttys_node(base_path)
|
base = read_ttys_node(base_path)
|
||||||
|
try:
|
||||||
|
b = get_bdf_from_realpath(os.path.join(TTY_PATH, ttys_n, 'device'))
|
||||||
|
bdf = f'{b[0]}:{b[1]}.{b[2]}
|
||||||
|
except AssertionError:
|
||||||
|
bdf = ''
|
||||||
|
if bdf:
|
||||||
|
print("\tseri:{} type:portio base:{} irq:{} bdf:{}".format(ttys, base, irq, bdf), file=config)
|
||||||
|
else:
|
||||||
print("\tseri:{} type:portio base:{} irq:{}".format(ttys, base, irq), file=config)
|
print("\tseri:{} type:portio base:{} irq:{}".format(ttys, base, irq), file=config)
|
||||||
elif ttys_type[serial_type] == 'MMIO':
|
elif ttys_type[serial_type] == 'MMIO':
|
||||||
base_path = '{}{}/iomem_base'.format(TTY_PATH, ttys_n)
|
base_path = '{}{}/iomem_base'.format(TTY_PATH, ttys_n)
|
||||||
|
Loading…
Reference in New Issue
Block a user