Skip to content

Instantly share code, notes, and snippets.

@nuumio
Created June 1, 2019 21:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nuumio/678443ec7298448af821bf31745810aa to your computer and use it in GitHub Desktop.
Save nuumio/678443ec7298448af821bf31745810aa to your computer and use it in GitHub Desktop.
RockPro64 trigger PCIe probe
# FILE: /etc/udev/rules.d/99-rockchip-pcie.rules
# Trigger Rockchip PCIe probe
ACTION=="add", KERNEL=="f8000000.pcie", SUBSYSTEM=="platform", RUN+="/usr/local/sbin/rockpro64_pcie_probe.sh"
#!/bin/bash
# FILE: /usr/local/sbin/rockpro64_pcie_probe.sh
PROBE_TRIGGER=/sys/devices/platform/f8000000.pcie/pcie_deferred
if [ ! -f ${PROBE_TRIGGER} ]; then
echo "Missing PCIe probe trigger file: ${PROBE_TRIGGER}"
echo "Your kernel may not support userspace triggered PCIe probe."
exit 1
fi
if [[ $EUID -ne 0 ]]; then
echo "This script must be run as root"
exit 1
fi
echo "1" > ${PROBE_TRIGGER}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment