Sergey Solomin | 7944ec7 | 2016-11-03 15:01:08 -0500 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | |
| 3 | # enable VCS rail with OPERATION |
| 4 | # A side |
| 5 | i2cset -y 4 0x70 0x00 0x01 b |
| 6 | i2cset -y 4 0x70 0x02 0x1A b #respond to OPERATION |
| 7 | i2cset -y 4 0x70 0x00 0x00 b |
| 8 | # B side |
| 9 | i2cset -y 5 0x70 0x00 0x01 b |
| 10 | i2cset -y 5 0x70 0x02 0x1A b #respond to OPERATION |
| 11 | i2cset -y 5 0x70 0x00 0x00 b |
Andrew Geissler | ba9d64a | 2017-07-29 16:06:05 -0500 | [diff] [blame] | 12 | |
Andrew Geissler | 8375eac | 2017-08-24 08:20:08 -0500 | [diff] [blame] | 13 | # This causes CFAM operations to second processor to fail |
| 14 | # TODO openbmc/openbmc#2204 |
| 15 | |
Andrew Geissler | ba9d64a | 2017-07-29 16:06:05 -0500 | [diff] [blame] | 16 | # unbind ucd driver to permit i2cset |
Andrew Geissler | 8375eac | 2017-08-24 08:20:08 -0500 | [diff] [blame] | 17 | #ucd_retries=5 |
| 18 | #ucd= |
Andrew Geissler | ba9d64a | 2017-07-29 16:06:05 -0500 | [diff] [blame] | 19 | |
Andrew Geissler | 8375eac | 2017-08-24 08:20:08 -0500 | [diff] [blame] | 20 | #ucdpath="/sys/bus/i2c/drivers/ucd9000" |
| 21 | #if [ -e $ucdpath ] |
| 22 | #then |
| 23 | # ucd=`ls -1 $ucdpath | grep 64` |
| 24 | # if [ -n "$ucd" ] |
| 25 | # then |
| 26 | # echo $ucd > $ucdpath/unbind |
| 27 | # fi |
| 28 | #fi |
Andrew Geissler | ba9d64a | 2017-07-29 16:06:05 -0500 | [diff] [blame] | 29 | |
| 30 | # re-enable VCS in system PGOOD |
Andrew Geissler | 8375eac | 2017-08-24 08:20:08 -0500 | [diff] [blame] | 31 | #sleep 1 |
Andrew Geissler | ba9d64a | 2017-07-29 16:06:05 -0500 | [diff] [blame] | 32 | #SYSTEM_RESET_CONFIG |
Andrew Geissler | 8375eac | 2017-08-24 08:20:08 -0500 | [diff] [blame] | 33 | #i2cset -y 11 0x64 0xD2 0x09 0xFF 0xFF 0x27 0x0A 0x00 0x06 0x00 0x00 0x02 i |
Andrew Geissler | ba9d64a | 2017-07-29 16:06:05 -0500 | [diff] [blame] | 34 | |
| 35 | # re-bind ucd driver only if we unbound it (i.e. ucd has been set with a value) |
Andrew Geissler | 8375eac | 2017-08-24 08:20:08 -0500 | [diff] [blame] | 36 | #if [ -e $ucdpath -a -n "$ucd" ]; then |
| 37 | # j=0 |
| 38 | # until [ $j -ge $ucd_retries ] || [ -e $ucdpath/$ucd ]; do |
| 39 | # j=$((j+1)) |
| 40 | # echo $ucd > $ucdpath/bind || ret=$? |
| 41 | # if [ $j -gt 1 ]; then |
| 42 | # echo "rebinding UCD driver. Retry number $j" |
| 43 | # sleep 1 |
| 44 | # fi |
| 45 | # done |
| 46 | # if [ ! -e $ucdpath/$ucd ]; then exit $ret; fi |
| 47 | #fi |