Skip to content

Commit 89f53a4

Browse files
Wei Liuacrnsi
authored andcommitted
acrn-config: supply optional passthrough device for vm
To match launch config xml, supply more optional passthrough device to vm. Tracked-On: #3812 Signed-off-by: Wei Liu <weix.w.liu@intel.com>
1 parent 8260946 commit 89f53a4

File tree

3 files changed

+8
-42
lines changed

3 files changed

+8
-42
lines changed

misc/acrn-config/launch_config/com.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,6 @@ def launch_end(names, args, vmid, config):
362362

363363
def set_dm_pt(names, sel, vmid, config):
364364

365-
#cap_pt = launch_cfg_lib.get_board_pt_dev(names, vmid)
366365
uos_type = names['uos_types'][vmid]
367366

368367
if sel.bdf['usb_xdci'][vmid] and sel.slot['usb_xdci'][vmid]:

misc/acrn-config/launch_config/pt.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ def media_pt(uos_type, sel, cap_pt, vmid, config):
196196
def gen_pt(names, sel, vmid, config):
197197

198198
pt_none = True
199-
cap_pt = launch_cfg_lib.get_board_pt_dev(names, vmid)
199+
cap_pt = launch_cfg_lib.get_pt_dev()
200200
uos_type = names['uos_types'][vmid]
201201
for pt_dev in cap_pt:
202202
if sel.bdf[pt_dev][vmid]:
@@ -214,8 +214,7 @@ def gen_pt(names, sel, vmid, config):
214214

215215
def gen_pt_head(names, sel, vmid, config):
216216

217-
# get passthrough device for specify board and uos
218-
cap_pt = launch_cfg_lib.get_board_pt_dev(names, vmid)
217+
cap_pt = launch_cfg_lib.get_pt_dev()
219218
uos_type = names['uos_types'][vmid]
220219
pt_none = True
221220

misc/acrn-config/library/launch_cfg_lib.py

Lines changed: 6 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -38,15 +38,9 @@
3838
PT_SUB_PCI['sata'] = ['SATA controller']
3939
PT_SUB_PCI['nvme'] = ['Non-Volatile memory controller']
4040

41-
# passthrough device of board and uos sepcify
42-
NUC_RT_PASSTHRU = ['ethernet', 'nvme', 'sata']
43-
NUC_WIN_PASSTHRU = ['audio', 'audio_codec']
44-
NUC_CLR_PASSTHRU = ['usb_xdci', 'ipu', 'ipu_i2c', 'cse', 'audio', 'audio_codec', 'sd_card', 'ethernet', 'bluetooth']
45-
UP2_CLR_PASSTHRU = ['usb_xdci', 'ipu', 'ipu_i2c', 'cse']
46-
UP2_ADR_PASSTHRU = ['usb_xdci', 'audio', 'audio_codec']
47-
MRB_CLR_PASSTHRU = ['usb_xdci', 'ipu', 'ipu_i2c', 'cse', 'sd_card']
48-
MRB_ADR_PASSTHRU = ['usb_xdci', 'audio', 'audio_codec', 'sd_card', 'wifi', 'bluetooth']
49-
GENERIC_PASSTHRU = ['usb_xdci', 'ipu', 'ipu_i2c', 'cse', 'audio', 'sata', 'nvme', 'audio_codec', 'sd_card', 'ethernet', 'wifi', 'bluetooth']
41+
# passthrough devices for board
42+
PASSTHRU_DEVS = ['usb_xdci', 'ipu', 'ipu_i2c', 'cse', 'audio', 'sata',
43+
'nvme', 'audio_codec', 'sd_card', 'ethernet', 'wifi', 'bluetooth']
5044

5145
PT_SLOT = {
5246
"hostbridge":0,
@@ -499,34 +493,8 @@ def get_slot(bdf_list, dev):
499493
return slot_list
500494

501495

502-
def get_board_pt_dev(names, vmid):
503-
504-
board_name = names['board_name']
505-
uos_type = names['uos_types'][vmid]
506-
cap_pt = []
507-
508-
if 'mrb' in board_name:
509-
if uos_type == "CLEARLINUX":
510-
cap_pt = MRB_CLR_PASSTHRU
511-
if uos_type == "ANDROID":
512-
cap_pt = MRB_ADR_PASSTHRU
513-
elif 'up2' in board_name:
514-
if uos_type == "CLEARLINUX":
515-
cap_pt = UP2_CLR_PASSTHRU
516-
if uos_type == "ANDROID":
517-
cap_pt = UP2_ADR_PASSTHRU
518-
elif 'nuc' in board_name:
519-
if uos_type == "CLEARLINUX":
520-
cap_pt = NUC_CLR_PASSTHRU
521-
elif uos_type == "PREEMPT-RT LINUX":
522-
cap_pt = NUC_RT_PASSTHRU
523-
elif uos_type == "WINDOWS":
524-
cap_pt = NUC_WIN_PASSTHRU
525-
else:
526-
# zephyr/vxworks have no passthroug device
527-
cap_pt = []
528-
else:
529-
# new board passthrough the generic device
530-
cap_pt = GENERIC_PASSTHRU
496+
def get_pt_dev():
497+
""" Get passthrough device list """
498+
cap_pt = PASSTHRU_DEVS
531499

532500
return cap_pt

0 commit comments

Comments
 (0)