blob: 5fbd81d8935cb440a1edf920a26dea31fffd811b [file] [log] [blame]
Sergey Solomin7944ec72016-11-03 15:01:08 -05001#!/bin/sh
2
3# enable VCS rail with OPERATION
4# A side
5i2cset -y 4 0x70 0x00 0x01 b
6i2cset -y 4 0x70 0x02 0x1A b #respond to OPERATION
7i2cset -y 4 0x70 0x00 0x00 b
8# B side
9i2cset -y 5 0x70 0x00 0x01 b
10i2cset -y 5 0x70 0x02 0x1A b #respond to OPERATION
11i2cset -y 5 0x70 0x00 0x00 b
Andrew Geisslerba9d64a2017-07-29 16:06:05 -050012
Andrew Geissler8375eac2017-08-24 08:20:08 -050013# This causes CFAM operations to second processor to fail
14# TODO openbmc/openbmc#2204
15
Andrew Geisslerba9d64a2017-07-29 16:06:05 -050016# unbind ucd driver to permit i2cset
Andrew Geissler8375eac2017-08-24 08:20:08 -050017#ucd_retries=5
18#ucd=
Andrew Geisslerba9d64a2017-07-29 16:06:05 -050019
Andrew Geissler8375eac2017-08-24 08:20:08 -050020#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 Geisslerba9d64a2017-07-29 16:06:05 -050029
30# re-enable VCS in system PGOOD
Andrew Geissler8375eac2017-08-24 08:20:08 -050031#sleep 1
Andrew Geisslerba9d64a2017-07-29 16:06:05 -050032#SYSTEM_RESET_CONFIG
Andrew Geissler8375eac2017-08-24 08:20:08 -050033#i2cset -y 11 0x64 0xD2 0x09 0xFF 0xFF 0x27 0x0A 0x00 0x06 0x00 0x00 0x02 i
Andrew Geisslerba9d64a2017-07-29 16:06:05 -050034
35# re-bind ucd driver only if we unbound it (i.e. ucd has been set with a value)
Andrew Geissler8375eac2017-08-24 08:20:08 -050036#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