1
0
Fork 0
mirror of https://git.rwth-aachen.de/acs/public/villas/node/ synced 2025-03-30 00:00:11 +01:00

add platform device bind script

Signed-off-by: Pascal Bauer <pascal.bauer@rwth-aachen.de>
This commit is contained in:
Pascal Bauer 2024-07-24 10:03:37 +00:00
parent 54796d11b2
commit 845e658d2c

25
tools/fpga-platform-bind.sh Executable file
View file

@ -0,0 +1,25 @@
#!/bin/bash
#
# Bind ips to vfio
# Pass the device tree names e.g. "a0000000.dma a291229.switch ..." (space seperated) as comandline arguments.
#
# Author: Pascal Bauer <pascal.bauer@rwth-aachen.de>
# SPDX-FileCopyrightText: 2023-2024 Pascal Bauer <pascal.bauer@rwth-aachen.de>
# SPDX-License-Identifier: Apache-2.0
modprobe vfio_platform reset_required=0
i=1;
for device in "$@"
do
echo "Device - $device";
# Unbind Device from driver
echo "$device > /sys/bus/platform/drivers/xilinx-vdma/unbind";
# Bind device
echo "vfio-platform > /sys/bus/platform/devices/$device/driver_override";
echo "$device > /sys/bus/platform/drivers/vfio-platform/bind";
i=$((i + 1));
done