1
0
Fork 0
mirror of https://git.rwth-aachen.de/acs/public/villas/node/ synced 2025-03-09 00:00:00 +01:00
VILLASnode/tools/pci-reset-device.sh

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

19 lines
472 B
Bash
Raw Permalink Normal View History

#!/usr/bin/env bash
#
# Reset PCI devices like FPGAs after a reflash
#
# Author: Steffen Vogel <post@steffenvogel.de>
# SPDX-FileCopyrightText: 2017 Institute for Automation of Complex Power Systems, RWTH Aachen University
# SPDX-License-Identifier: Apache-2.0
if [ "$#" -ne 1 ]; then
2022-10-28 08:07:13 -04:00
echo "usage: $0 BUS:DEV.FNC"
exit 1
fi
BDF=$1
2022-10-28 08:07:13 -04:00
echo "1" > /sys/bus/pci/devices/${BDF}/remove
echo "1" > /sys/bus/pci/rescan
2022-10-28 08:07:13 -04:00
echo "1" > /sys/bus/pci/devices/${BDF}/reset