Skip to content

Instantly share code, notes, and snippets.

@danitool
Created December 21, 2016 12:20
Show Gist options
  • Save danitool/fe2a1df19e5310c9cb5f3ec770c76c46 to your computer and use it in GitHub Desktop.
Save danitool/fe2a1df19e5310c9cb5f3ec770c76c46 to your computer and use it in GitHub Desktop.
find external IRQs at GPIO lines in broadcom BCM63268
#!/bin/sh
GPIOBASE=`cat /sys/class/gpio/gpiochip*/base | head -n1`
nums=`seq 0 51`
cd /sys/class/gpio
for i in $nums; do
GPIO=`expr $i + $GPIOBASE`
echo
echo "[GPIO$i] testing ext IRQ"
echo $GPIO > export; echo out > gpio$GPIO/direction
echo 0 > gpio$GPIO/value
EI_STATUS_LOW=`devmem 0x10000018 32`
echo 1 > gpio$GPIO/value
EI_STATUS_HIGH=`devmem 0x10000018 32`
if [ $EI_STATUS_LOW != $EI_STATUS_HIGH ]; then
echo " found ext IRQ"
echo " $EI_STATUS_LOW $EI_STATUS_HIGH"
fi
echo $GPIO > unexport
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment