Skip to content

Commit

Permalink
scripts: Add support for BeagleLogic standalone board
Browse files Browse the repository at this point in the history
The board has an on board logic buffer that needs to be enabled
at startup via a GPIO. There is also switchable logic level thresholds
between 1.8V and 3.3V via a GPIO and that control is exposed through
another GPIO. Add support to set both the GPIOs and also gate config-pin
(as it is not required as pinmuxing is handled in the device tree)

Signed-off-by: Kumar Abhishek <abhishek@theembeddedkitchen.net>
  • Loading branch information
abhishek-kakkar committed Oct 7, 2017
1 parent 0e17d12 commit 7a48420
Showing 1 changed file with 29 additions and 3 deletions.
32 changes: 29 additions & 3 deletions scripts/beaglelogic-startup.sh
Expand Up @@ -2,10 +2,34 @@

log='beaglelogic-startup:'
SLOTS="/sys/devices/platform/bone_capemgr/slots"
board=$(cat /proc/device-tree/model | sed "s/ /_/g" | tr -d '\000')
is_standalone="N"

if [ "x${board}" = "xTI_AM335x_BeagleLogic_Standalone" ] ; then
is_standalone="Y"

# Enable OE of 74LVCH16T245 buffer by writing a '1' to GPIO58
if [ ! -d "/sys/class/gpio/gpio58" ] ; then
echo 58 > /sys/class/gpio/export
fi
echo out > /sys/class/gpio/gpio58/direction
echo 1 > /sys/class/gpio/gpio58/value

# Switch logic level voltage threshold to 3.3V by writing a '1' to GPIO57
# Writing '0' switches the threshold to 1.8V
if [ ! -d "/sys/class/gpio/gpio57" ] ; then
echo 57 > /sys/class/gpio/export
fi
echo out > /sys/class/gpio/gpio57/direction
echo 1 > /sys/class/gpio/gpio57/value

# Ethernet interrupt pacing to improve performance
ethtool -C eth0 rx-usecs 500
fi

check_uboot_overlay=$(grep bone_capemgr.uboot_capemgr_enabled=1 /proc/cmdline || true)
if [ ! -d /sys/devices/virtual/misc/beaglelogic ] ; then
if [ "x${check_uboot_overlay}" = "x" ] ; then
if [ "x${check_uboot_overlay}" = "x" ] && [ "x${is_standalone}" = "xN" ] ; then
echo beaglelogic > "${SLOTS}"
echo cape-universalh > "${SLOTS}"
fi
Expand All @@ -19,8 +43,10 @@ if [ ! -d /sys/devices/virtual/misc/beaglelogic ] ; then
fi
fi

echo "${log} Configuring LA pins"
config-pin -f $(dirname $0)/pinconfig
if [ "x${is_standalone}" = "xN" ] ; then
echo "${log} Configuring LA pins"
config-pin -f $(dirname $0)/pinconfig
fi

echo "${log} Allocating 128MiB of logic buffer to BeagleLogic"
echo 134217728 > /sys/devices/virtual/misc/beaglelogic/memalloc
Expand Down

0 comments on commit 7a48420

Please sign in to comment.