Skip to content

Commit 24d2b92

Browse files
shiqinggjren1
authored andcommitted
dm: enable IPU passthrough for Android UOS
enable IPU passthrough for Android UOS on MRB by default v1 -> v2: * add comments for i2c controller passthrough * add indentation for 'if' statements Signed-off-by: Shiqing Gao <shiqing.gao@intel.com> Reviewed-by: Jack Ren <jack.ren@intel.com> Reviewed-by: Zhao Yakui <yakui.zhao@intel.com> Reviewed-by: Binbin Wu <binbin.wu@intel.com>
1 parent 8f9ef10 commit 24d2b92

File tree

1 file changed

+30
-8
lines changed

1 file changed

+30
-8
lines changed

devicemodel/samples/apl-mrb/launch_uos.sh

Lines changed: 30 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -65,18 +65,20 @@ echo "0000:00:0f.0" > /sys/bus/pci/drivers/pci-stub/bind
6565
boot_ipu_option=""
6666
# for ipu passthrough - ipu device 0:3.0
6767
if [ -d "/sys/bus/pci/devices/0000:00:03.0" ]; then
68-
echo "8086 5a88" > /sys/bus/pci/drivers/pci-stub/new_id
69-
echo "0000:00:03.0" > /sys/bus/pci/devices/0000:00:03.0/driver/unbind
70-
echo "0000:00:03.0" > /sys/bus/pci/drivers/pci-stub/bind
71-
boot_ipu_option="$boot_ipu_option"" -s 12,passthru,0/3/0 "
68+
echo "8086 5a88" > /sys/bus/pci/drivers/pci-stub/new_id
69+
echo "0000:00:03.0" > /sys/bus/pci/devices/0000:00:03.0/driver/unbind
70+
echo "0000:00:03.0" > /sys/bus/pci/drivers/pci-stub/bind
71+
boot_ipu_option="$boot_ipu_option"" -s 12,passthru,0/3/0 "
7272
fi
7373

7474
# for ipu passthrough - ipu related i2c 0:16.0
75+
# please use virtual slot 22 for i2c 0:16.0 to make sure that the i2c controller
76+
# could get the same virtaul BDF as physical BDF
7577
if [ -d "/sys/bus/pci/devices/0000:00:16.0" ]; then
76-
echo "8086 5aac" > /sys/bus/pci/drivers/pci-stub/new_id
77-
echo "0000:00:16.0" > /sys/bus/pci/devices/0000:00:16.0/driver/unbind
78-
echo "0000:00:16.0" > /sys/bus/pci/drivers/pci-stub/bind
79-
boot_ipu_option="$boot_ipu_option"" -s 22,passthru,0/16/0 "
78+
echo "8086 5aac" > /sys/bus/pci/drivers/pci-stub/new_id
79+
echo "0000:00:16.0" > /sys/bus/pci/devices/0000:00:16.0/driver/unbind
80+
echo "0000:00:16.0" > /sys/bus/pci/drivers/pci-stub/bind
81+
boot_ipu_option="$boot_ipu_option"" -s 22,passthru,0/16/0 "
8082
fi
8183

8284
# for sd card passthrough - SDXC/MMC Host Controller 00:1b.0
@@ -227,6 +229,25 @@ echo "8086 5abc" > /sys/bus/pci/drivers/pci-stub/new_id
227229
echo "0000:00:18.0" > /sys/bus/pci/devices/0000:00:18.0/driver/unbind
228230
echo "0000:00:18.0" > /sys/bus/pci/drivers/pci-stub/bind
229231

232+
boot_ipu_option=""
233+
# for ipu passthrough - ipu device 0:3.0
234+
if [ -d "/sys/bus/pci/devices/0000:00:03.0" ]; then
235+
echo "8086 5a88" > /sys/bus/pci/drivers/pci-stub/new_id
236+
echo "0000:00:03.0" > /sys/bus/pci/devices/0000:00:03.0/driver/unbind
237+
echo "0000:00:03.0" > /sys/bus/pci/drivers/pci-stub/bind
238+
boot_ipu_option="$boot_ipu_option"" -s 12,passthru,0/3/0 "
239+
fi
240+
241+
# for ipu passthrough - ipu related i2c 0:16.0
242+
# please use virtual slot 22 for i2c 0:16.0 to make sure that the i2c controller
243+
# could get the same virtaul BDF as physical BDF
244+
if [ -d "/sys/bus/pci/devices/0000:00:16.0" ]; then
245+
echo "8086 5aac" > /sys/bus/pci/drivers/pci-stub/new_id
246+
echo "0000:00:16.0" > /sys/bus/pci/devices/0000:00:16.0/driver/unbind
247+
echo "0000:00:16.0" > /sys/bus/pci/drivers/pci-stub/bind
248+
boot_ipu_option="$boot_ipu_option"" -s 22,passthru,0/16/0 "
249+
fi
250+
230251
#for memsize setting
231252
memsize=`cat /proc/meminfo|head -n 1|awk '{print $2}'`
232253
if [ $memsize -gt 4000000 ];then
@@ -301,6 +322,7 @@ fi
301322
-s 27,passthru,0/1b/0 \
302323
-s 24,passthru,0/18/0 \
303324
-s 18,passthru,4/0/0 \
325+
$boot_ipu_option \
304326
-i /run/acrn/ioc_$vm_name,0x20 \
305327
-l com2,/run/acrn/ioc_$vm_name \
306328
-M \

0 commit comments

Comments
 (0)