Hi,
We have compared GPIO bit toggling performance between TX1 & TX2. We are seeing no difference in their performance. Attaching gpio_perf_debugfs script which toggles the bit value. Attaching script and results which are seen.
In gpio_perf_debugfs script,you will need to provide gpio and count values. For ex.
In TX1: gpio=187 count=100000
In TX2: gpio=387 count=100000
You can use any gpio number which is not being used by the driver.
gpio_perg_debugfs.sh
#!/bin/bash
echo "GPIO Performance Analysis Test"
echo -e "******************************\n"
gpio=$1
count=$2
echo $gpio > /sys/class/gpio/export
if [ $? -eq 0 ]; then
echo "Exported GPIO-$gpio"
else
echo "Failed to export GPIO-$gpio"
echo $gpio > /sys/class/gpio/unexport
echo "Unexported GPIO-$gpio"
echo $gpio > /sys/class/gpio/export
echo "Exported GPIO-$gpio"
fi
echo out > /sys/class/gpio/gpio$gpio/direction
SECONDS=0
echo "Started Bit-Banging"
for i in $(seq 1 $count)
do
sec=SECONDS
echo 1 > /sys/class/gpio/gpio$gpio/value > /dev/null
echo 0 > /sys/class/gpio/gpio$gpio/value > /dev/null
done
echo "Ended Bit-Banging"
echo -e "\tToggled $i times"
echo -e "\tTotal Time taken $SECONDS"
if [ $SECONDS -eq 0 ]; then
echo "Increase count"
else
echo -e "frequency of the toggle $(( $i / $SECONDS ))"
fi
echo $gpio > /sys/class/gpio/unexport
echo -e "Unexported GPIO-$gpio\n"
echo "******************************"
Thanks & Regards,
Shubhi
Bit_banging_results.txt (4.48 KB)