Skip to content

Commit

Permalink
acrn-config: hide non-legacy serial port as SOS console
Browse files Browse the repository at this point in the history
SOS vm only support legacy serial port emulation, so we need to
hide non-legacy serial ports from webUI when user want to select
serial port as SOS console.

Tracked-On: #3854
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
  • Loading branch information
Wei Liu authored and wenlingz committed Dec 12, 2019
1 parent deb5ed1 commit 67b416d
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 8 deletions.
4 changes: 2 additions & 2 deletions misc/acrn-config/board_config/misc_cfg_h.py
Expand Up @@ -92,10 +92,10 @@ def generate_file(config):

if vuart0_dic:
# parse to get poart/base of vuart0/vuart1
vuart0_port_base = board_cfg_lib.TTY_CONSOLE[list(vuart0_dic.keys())[0]]
vuart0_port_base = board_cfg_lib.LEGACY_TTYS[list(vuart0_dic.keys())[0]]
vuart0_irq = vuart0_dic[list(vuart0_dic.keys())[0]]

vuart1_port_base = board_cfg_lib.TTY_CONSOLE[list(vuart1_dic.keys())[0]]
vuart1_port_base = board_cfg_lib.LEGACY_TTYS[list(vuart1_dic.keys())[0]]
vuart1_irq = vuart1_dic[list(vuart1_dic.keys())[0]]

# parse the setting ttys vuatx dic: {vmid:base/irq}
Expand Down
6 changes: 1 addition & 5 deletions misc/acrn-config/library/board_cfg_lib.py
Expand Up @@ -18,7 +18,7 @@
BOARD_NAMES = ['apl-mrb', 'apl-nuc', 'apl-up2', 'dnv-cb2', 'nuc6cayh',
'nuc7i7dnb', 'kbl-nuc-i7', 'icl-rvp']

TTY_CONSOLE = {
LEGACY_TTYS = {
'ttyS0':'0x3F8',
'ttyS1':'0x2F8',
'ttyS2':'0x3E8',
Expand Down Expand Up @@ -354,10 +354,6 @@ def get_board_private_vuart(branch_tag, tag_console):

if ttys_n:

if ttys_n not in list(TTY_CONSOLE.keys()):
err_dic["board config: ttyS not available"] = "console should be set in scenario.xml of board_private section"
return (err_dic, vuart0_console_dic, vuart1_console_dic)

(vuart0_valid_console, vuart1_valid_console, show_vuart1) = console_to_show(BOARD_INFO_FILE)

# VUART0
Expand Down
12 changes: 11 additions & 1 deletion misc/acrn-config/library/scenario_cfg_lib.py
Expand Up @@ -44,6 +44,13 @@
}
KATA_VM_COUNT = 0

LEGACY_TTYS = {
'ttyS0':'0x3F8',
'ttyS1':'0x2F8',
'ttyS2':'0x3E8',
'ttyS3':'0x2E8',
}

def prepare(check_git):
""" Check environment """
return common.check_env(check_git)
Expand Down Expand Up @@ -178,8 +185,11 @@ def get_ttys_info(board_info):
if not ttys_line:
break

#ttys_dev = " ".join(ttys_line.strip().split()[:-2])
ttys_dev = ttys_line.split()[0].split(':')[1]
ttysn = ttys_dev.split('/')[-1]
# currently SOS console can only support legacy serial port
if ttysn not in list(LEGACY_TTYS.keys()):
continue
ttys_list.append(ttys_dev)

return ttys_list
Expand Down

0 comments on commit 67b416d

Please sign in to comment.