Skip to content

Commit

Permalink
am335x: cmdline check for cape_universal=enable
Browse files Browse the repository at this point in the history
Signed-off-by: Robert Nelson <robertcnelson@gmail.com>
  • Loading branch information
RobertCNelson committed Oct 14, 2015
1 parent c3edb9e commit 7730db5
Showing 1 changed file with 68 additions and 64 deletions.
132 changes: 68 additions & 64 deletions boot/am335x_evm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -200,74 +200,78 @@ if [ "x${abi}" = "x" ] ; then
fi
fi

#loading cape-universal...
if [ -f /sys/devices/platform/bone_capemgr/slots ] ; then

#cape-universal Exports all pins not used by HDMIN and eMMC (including audio)
#cape-universaln Exports all pins not used by HDMI and eMMC (no audio pins are exported)
#cape-univ-emmc Exports pins used by eMMC, load if eMMC is disabled
#cape-univ-hdmi Exports pins used by HDMI video, load if HDMI is disabled
#cape-univ-audio Exports pins used by HDMI audio

unset stop_cape_load

#Make sure bone_capemgr.enable_partno wasn't passed to cmdline...
if [ "x${stop_cape_load}" = "x" ] ; then
check_enable_partno=$(grep bone_capemgr.enable_partno /proc/cmdline || true)
if [ ! "x${check_enable_partno}" = "x" ] ; then
stop_cape_load="stop"
unset enable_cape_universal
enable_cape_universal=$(grep 'cape_universal=enable' /proc/cmdline || true)
if [ ! "x${enable_cape_universal}" = "x" ] ; then
#loading cape-universal...
if [ -f /sys/devices/platform/bone_capemgr/slots ] ; then

#cape-universal Exports all pins not used by HDMIN and eMMC (including audio)
#cape-universaln Exports all pins not used by HDMI and eMMC (no audio pins are exported)
#cape-univ-emmc Exports pins used by eMMC, load if eMMC is disabled
#cape-univ-hdmi Exports pins used by HDMI video, load if HDMI is disabled
#cape-univ-audio Exports pins used by HDMI audio

unset stop_cape_load

#Make sure bone_capemgr.enable_partno wasn't passed to cmdline...
if [ "x${stop_cape_load}" = "x" ] ; then
check_enable_partno=$(grep bone_capemgr.enable_partno /proc/cmdline || true)
if [ ! "x${check_enable_partno}" = "x" ] ; then
stop_cape_load="stop"
fi
fi
fi

#Make sure no custom overlays are loaded...
if [ "x${stop_cape_load}" = "x" ] ; then
check_cape_loaded=$(cat /sys/devices/platform/bone_capemgr/slots | awk '{print $3}' | grep 0 | tail -1 || true)
if [ ! "x${check_cape_loaded}" = "x" ] ; then
stop_cape_load="stop"
#Make sure no custom overlays are loaded...
if [ "x${stop_cape_load}" = "x" ] ; then
check_cape_loaded=$(cat /sys/devices/platform/bone_capemgr/slots | awk '{print $3}' | grep 0 | tail -1 || true)
if [ ! "x${check_cape_loaded}" = "x" ] ; then
stop_cape_load="stop"
fi
fi
fi

#Make sure we load the correct overlay based on lack/custom dtb's...
if [ "x${stop_cape_load}" = "x" ] ; then
unset overlay
check_dtb=$(cat /boot/uEnv.txt | grep -v '#' | grep dtb | tail -1 | awk -F '=' '{print $2}' || true)
if [ ! "x${check_dtb}" = "x" ] ; then
case "${check_dtb}" in
am335x-boneblack-overlay.dtb)
overlay="univ-all"
;;
am335x-boneblack-emmc-overlay.dtb)
overlay="univ-emmc"
;;
am335x-boneblack-hdmi-overlay.dtb)
overlay="univ-hdmi"
;;
am335x-boneblack-nhdmi-overlay.dtb)
overlay="univ-nhdmi"
;;
am335x-bonegreen-overlay.dtb)
overlay="univ-all"
;;
esac
else
machine=$(cat /proc/device-tree/model | sed "s/ /_/g")
case "${machine}" in
TI_AM335x_BeagleBone)
overlay="univ-all"
;;
TI_AM335x_BeagleBone_Black)
overlay="cape-universaln"
;;
TI_AM335x_BeagleBone_Green)
overlay="univ-emmc"
;;
esac
fi
if [ ! "x${overlay}" = "x" ] ; then
dtbo="${overlay}-00A0.dtbo"
if [ -f /lib/firmware/${dtbo} ] ; then
if [ -f /usr/local/bin/config-pin ] ; then
config-pin overlay ${overlay}
#Make sure we load the correct overlay based on lack/custom dtb's...
if [ "x${stop_cape_load}" = "x" ] ; then
unset overlay
check_dtb=$(cat /boot/uEnv.txt | grep -v '#' | grep dtb | tail -1 | awk -F '=' '{print $2}' || true)
if [ ! "x${check_dtb}" = "x" ] ; then
case "${check_dtb}" in
am335x-boneblack-overlay.dtb)
overlay="univ-all"
;;
am335x-boneblack-emmc-overlay.dtb)
overlay="univ-emmc"
;;
am335x-boneblack-hdmi-overlay.dtb)
overlay="univ-hdmi"
;;
am335x-boneblack-nhdmi-overlay.dtb)
overlay="univ-nhdmi"
;;
am335x-bonegreen-overlay.dtb)
overlay="univ-all"
;;
esac
else
machine=$(cat /proc/device-tree/model | sed "s/ /_/g")
case "${machine}" in
TI_AM335x_BeagleBone)
overlay="univ-all"
;;
TI_AM335x_BeagleBone_Black)
overlay="cape-universaln"
;;
TI_AM335x_BeagleBone_Green)
overlay="univ-emmc"
;;
esac
fi
if [ ! "x${overlay}" = "x" ] ; then
dtbo="${overlay}-00A0.dtbo"
if [ -f /lib/firmware/${dtbo} ] ; then
if [ -f /usr/local/bin/config-pin ] ; then
config-pin overlay ${overlay}
fi
fi
fi
fi
Expand Down

0 comments on commit 7730db5

Please sign in to comment.