config-tools: check vmsix enablement for ehl-crb-b

Assign extra vbar for vmsix devive for ehl-crb-b only.

Tracked-On: #5693
Signed-off-by: Yang,Yu-chu <yu-chu.yang@intel.com>
This commit is contained in:
Yang,Yu-chu 2021-02-01 17:40:15 -08:00 committed by wenlingz
parent 1a0ab78a84
commit 0c7d8dd8cc

View File

@ -95,20 +95,21 @@ def write_vbar(i_cnt, bdf, pci_bar_dic, bar_attr, \
free = MmioWindow(0, 0) free = MmioWindow(0, 0)
is_vmsix = False is_vmsix = False
# If the device is vmsix device, find a free mmio window up to 4k size # If the device is vmsix device, find a free mmio window up to 4k size
for vm_i in pci_devs_per_vm: if board_cfg_lib.is_matched_board(('ehl-crb-b')):
if bdf in pci_devs_per_vm[vm_i]: for vm_i in pci_devs_per_vm:
if scenario_cfg_lib.VM_DB[common.VM_TYPES[vm_i]]['load_type'] == "PRE_LAUNCHED_VM": if bdf in pci_devs_per_vm[vm_i]:
is_vmsix = True if scenario_cfg_lib.VM_DB[common.VM_TYPES[vm_i]]['load_type'] == "PRE_LAUNCHED_VM":
bar_len += 1 is_vmsix = True
# For pre-launched VM, the windows range is form 2G to 4G bar_len += 1
free = get_free_mmio([MmioWindow(start=common.SIZE_2G, end=common.SIZE_4G-1)], \ # For pre-launched VM, the windows range is form 2G to 4G
mmiolist_per_vm[vm_i], VMSIX_VBAR_ALIGNMENT + VMSIX_VBAR_SIZE) free = get_free_mmio([MmioWindow(start=common.SIZE_2G, end=common.SIZE_4G-1)], \
free_vbar_start_addr = common.round_up(free.start, VMSIX_VBAR_ALIGNMENT) mmiolist_per_vm[vm_i], VMSIX_VBAR_ALIGNMENT + VMSIX_VBAR_SIZE)
free_vbar_end_addr = free_vbar_start_addr + VMSIX_VBAR_SIZE - 1 free_vbar_start_addr = common.round_up(free.start, VMSIX_VBAR_ALIGNMENT)
free = MmioWindow(free_vbar_start_addr, free_vbar_end_addr) free_vbar_end_addr = free_vbar_start_addr + VMSIX_VBAR_SIZE - 1
mmiolist_per_vm[vm_i].append(free) free = MmioWindow(free_vbar_start_addr, free_vbar_end_addr)
mmiolist_per_vm[vm_i].sort() mmiolist_per_vm[vm_i].append(free)
break mmiolist_per_vm[vm_i].sort()
break
for bar_i in bar_list: for bar_i in bar_list:
if not bar_attr.remappable: if not bar_attr.remappable:
print("/* TODO: add {} 64bit BAR support */".format(tmp_sub_name), file=config) print("/* TODO: add {} 64bit BAR support */".format(tmp_sub_name), file=config)