diff --git a/misc/acrn-config/library/board_cfg_lib.py b/misc/acrn-config/library/board_cfg_lib.py index 5375af51b..b9c0ec4d2 100644 --- a/misc/acrn-config/library/board_cfg_lib.py +++ b/misc/acrn-config/library/board_cfg_lib.py @@ -375,9 +375,14 @@ def get_board_private_vuart(branch_tag, tag_console): vuart0_console_dic[ttys_n] = NATIVE_CONSOLE_DIC[ttys_n] # VUART1 - if len(vuart1_valid_console) == 4: - vuart1_console_dic[ttys_n] = alloc_irq() + if len(NATIVE_CONSOLE_DIC) >= 2: + # There are more than 1 serial port in native, we need to use native ttyS1 info for vuart1 which include + # base ioport and irq number. + if 'ttyS1' in NATIVE_CONSOLE_DIC.keys(): + vuart1_console_dic['ttyS1'] = NATIVE_CONSOLE_DIC['ttyS1'] else: + # There is only one native serial port. We hardcode base ioport for vuart1 and allocate a irq which is + # free in native env and use it for vuart1 irq number vuart1_console_dic[vuart1_valid_console[0]] = alloc_irq() return (err_dic, vuart0_console_dic, vuart1_console_dic)