summaryrefslogtreecommitdiffstats
path: root/meta-openbmc-machines
diff options
context:
space:
mode:
authorAndrew Jeffery <andrew@aj.id.au>2017-03-23 10:54:24 +1030
committerPatrick Williams <patrick@stwcx.xyz>2017-03-24 18:49:22 +0000
commitfdd4b9b44c5b46cfd2e0a50e0d9b3ee5d4a1cb60 (patch)
treec35c9cf06a1ea3465ec8f601a30e87e6ece2f5c9 /meta-openbmc-machines
parent8346f544e57faf03ace5c205f65213e495a6038e (diff)
downloadtalos-openbmc-fdd4b9b44c5b46cfd2e0a50e0d9b3ee5d4a1cb60.tar.gz
talos-openbmc-fdd4b9b44c5b46cfd2e0a50e0d9b3ee5d4a1cb60.zip
witherspoon: Only rebind ucd9000 if we unbound it
This makes way for an incoming kernel patch affecting Witherspoon[1], where we disable the UCD90160 device in the devicetree. If the driver hasn't been bound to the device we can immediately proceed to invoking i2c{g,s}et. Finally if it wasn't bound before the script was executed then don't try to rebind it, as it was disabled for a reason [1] https://lists.ozlabs.org/pipermail/openbmc/2017-March/007015.html Change-Id: Icc1fd1aa978e1a5cd62f1609bae97aa7dbfcde41 Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
Diffstat (limited to 'meta-openbmc-machines')
-rw-r--r--meta-openbmc-machines/meta-openpower/meta-ibm/meta-witherspoon/recipes-phosphor/chassis/vcs-pre-post/ucd_disable_vcs.sh12
1 files changed, 8 insertions, 4 deletions
diff --git a/meta-openbmc-machines/meta-openpower/meta-ibm/meta-witherspoon/recipes-phosphor/chassis/vcs-pre-post/ucd_disable_vcs.sh b/meta-openbmc-machines/meta-openpower/meta-ibm/meta-witherspoon/recipes-phosphor/chassis/vcs-pre-post/ucd_disable_vcs.sh
index b52a68bb8..e529049d5 100644
--- a/meta-openbmc-machines/meta-openpower/meta-ibm/meta-witherspoon/recipes-phosphor/chassis/vcs-pre-post/ucd_disable_vcs.sh
+++ b/meta-openbmc-machines/meta-openpower/meta-ibm/meta-witherspoon/recipes-phosphor/chassis/vcs-pre-post/ucd_disable_vcs.sh
@@ -6,13 +6,17 @@
# 11/10/16 PGR - unbind/bind UCD driver
ucd_retries=5
+ucd=
# unbind ucd driver to permit i2cset
ucdpath="/sys/bus/i2c/drivers/ucd9000"
if [ -e $ucdpath ]
then
- ucd=`ls $ucdpath | grep 64`
- echo $ucd > $ucdpath/unbind
+ ucd=`ls -1 $ucdpath | grep 64`
+ if [ -n "$ucd" ]
+ then
+ echo $ucd > $ucdpath/unbind
+ fi
fi
# Setup UCD module (in standby) to disable VCS rails from power-on:
@@ -28,8 +32,8 @@ i2cset -y 11 0x64 0x02 0x1A i
i2cset -y 11 0x64 0x00 0x0F i
i2cset -y 11 0x64 0x02 0x1A i
-# re-bind ucd driver
-if [ -e $ucdpath ]; then
+# re-bind ucd driver only if we unbound it (i.e. ucd has been set with a value)
+if [ -e $ucdpath -a -n "$ucd" ]; then
j=0
until [ $j -ge $ucd_retries ] || [ -e $ucdpath/$ucd ]; do
j=$((j+1))
OpenPOWER on IntegriCloud