summaryrefslogtreecommitdiff
path: root/meta-ingrasys/meta-zaius/recipes-phosphor/chassis/avsbus-control
diff options
context:
space:
mode:
authorBrad Bishop <bradleyb@fuzziesquirrel.com>2019-04-20 16:59:37 +0300
committerBrad Bishop <bradleyb@fuzziesquirrel.com>2019-04-20 16:59:53 +0300
commitaddb1466f22c9d8435ad4cfebbf01106314dee74 (patch)
treeada183c317421099791077749f1ec4c87d838d98 /meta-ingrasys/meta-zaius/recipes-phosphor/chassis/avsbus-control
parent839c37546efc859282e3d1302639a5e1cffeea3c (diff)
downloadopenbmc-addb1466f22c9d8435ad4cfebbf01106314dee74.tar.xz
subtree updates
meta-aspeed: c8d791ede6..35a494ecb3: Andrew Jeffery (1): linux-aspeed: OCC, ISL68137, ASPEED spi-nor updates meta-ingrasys: 67bcaf389f..71846afdc6: Patrick Venture (5): meta-ingrasys: zaius: hwmon: udc90160 specify informative names meta-ingrasys: zaius: enable isl68137 and ir38064 meta-ingrasys: zaius: phosphor-hwmon: add vrm nodes meta-ingrasys: zaius: phosphor-hwmon: add power-brick nodes meta-ingrasys: zaius: update ipmi sensor inventory Robert Lippert (3): meta-ingrasys: zaius: remove reflock fixup recipe meta-ingrasys: zaius: avsbus-control: use linux driver instead of raw I2C commands meta-ingrasys: zaius: no longer need to set VDN VOUT_MAX during host boot Change-Id: I5dbcfae6f937e0f01e5fca4c1f686be0e82b7ee1 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
Diffstat (limited to 'meta-ingrasys/meta-zaius/recipes-phosphor/chassis/avsbus-control')
-rw-r--r--meta-ingrasys/meta-zaius/recipes-phosphor/chassis/avsbus-control/avsbus-enable@.service1
-rwxr-xr-xmeta-ingrasys/meta-zaius/recipes-phosphor/chassis/avsbus-control/zaius_avsbus.sh46
2 files changed, 3 insertions, 44 deletions
diff --git a/meta-ingrasys/meta-zaius/recipes-phosphor/chassis/avsbus-control/avsbus-enable@.service b/meta-ingrasys/meta-zaius/recipes-phosphor/chassis/avsbus-control/avsbus-enable@.service
index 24aadf5ad..f0d14d220 100644
--- a/meta-ingrasys/meta-zaius/recipes-phosphor/chassis/avsbus-control/avsbus-enable@.service
+++ b/meta-ingrasys/meta-zaius/recipes-phosphor/chassis/avsbus-control/avsbus-enable@.service
@@ -6,7 +6,6 @@ Conflicts=obmc-host-stop@%i.target
ConditionPathExists=!/run/openbmc/chassis@%i-on
[Service]
-ExecStart=/usr/bin/env zaius_avsbus.sh vdn_max
ExecStart=/usr/bin/env zaius_avsbus.sh enable
SyslogIdentifier=zaius_avsbus.sh
Type=oneshot
diff --git a/meta-ingrasys/meta-zaius/recipes-phosphor/chassis/avsbus-control/zaius_avsbus.sh b/meta-ingrasys/meta-zaius/recipes-phosphor/chassis/avsbus-control/zaius_avsbus.sh
index 45e60664a..57e7f99b2 100755
--- a/meta-ingrasys/meta-zaius/recipes-phosphor/chassis/avsbus-control/zaius_avsbus.sh
+++ b/meta-ingrasys/meta-zaius/recipes-phosphor/chassis/avsbus-control/zaius_avsbus.sh
@@ -12,29 +12,14 @@ vdn_i2c_addr_page="0x64:0x01"
vcs_i2c_addr_page="0x64:0x00"
addrs_pages="$vdd_i2c_addr_page $vdn_i2c_addr_page $vcs_i2c_addr_page"
-# Usage: vrm_set_page <bus> <i2c_address> <page>
-vrm_set_page()
-{
- i2cset -y $1 $2 0x00 $3 b
-}
+i2c_path="/sys/bus/i2c/devices/"
# Usage: vrm_avs_enable <bus> <i2c_address> <page>
# Initializes the AVSBus VOUT setpoint to the value in PMBus VOUT_COMMAND
-# Sets OPERATION PMBUS register to
-# - Enable/Disable: On
-# - VOUT Source: AVSBus Target Rail Voltage
-# - AVSBus Copy: VOUT_COMMAND remains unchanged
-# Writes to VOUT setpoint over AVSBus will persist after the VRM is switched to
-# PMBus control. Switching back to AVSBus control restores this persisted
-# setpoint rather than re-initializing to PMBus VOUT_COMMAND. This behavior is
-# known to Intersil and writing VOUT_COMMAND over PMBus is the only workaround.
vrm_avs_enable()
{
- vrm_set_page "$@"
echo Enabling AVSBus on bus $1 VRM @$2 rail $3...
- local vout_command=`i2cget -y $1 $2 0x21 w`
- i2cset -y $1 $2 0x21 $vout_command w
- i2cset -y $1 $2 0x01 0xb0 b
+ echo 1 > $(echo ${i2c_path}/$1-$(printf "%04x" $2)/hwmon/hwmon*/avs$(printf "%d" $3)_enable)
}
# Usage: vrm_avs_disable <bus> <i2c_address> <page>
@@ -44,28 +29,8 @@ vrm_avs_enable()
# - AVSBus Copy: VOUT_COMMAND remains unchanged
vrm_avs_disable()
{
- vrm_set_page "$@"
echo Disabling AVSBus on bus $1 VRM @$2 rail $3...
- i2cset -y $1 $2 0x01 0x80 b
-}
-
-# Usage: vrm_vout_max_1v1 <bus> <i2c_address> <page>
-# Sets VOUT_MAX to 1.1V
-vrm_vout_max_1v1()
-{
- vrm_set_page "$@"
- echo Setting VOUT_MAX=[1.1V] on bus $1 VRM @$2 rail $3...
- i2cset -y $1 $2 0x24 0x44c w
-}
-
-# Usage: vrm_print <bus> <i2c_address> <page>
-vrm_print()
-{
- vrm_set_page "$@"
- local operation=`i2cget -y $1 $2 0x01 b`
- local vout=`i2cget -y $1 $2 0x8b w`
- local iout=`i2cget -y $1 $2 0x8c w`
- echo VRM on bus $1 @$2 rail $3: OPERATION=$operation VOUT=$vout IOUT=$iout
+ echo 0 > $(echo ${i2c_path}/$1-$(printf "%04x" $2)/hwmon/hwmon*/avs$(printf "%d" $3)_enable)
}
# Usage: for_each_rail <command>
@@ -87,12 +52,7 @@ then
elif [ "$1" == "disable" ]
then
for_each_rail vrm_avs_disable
-elif [ "$1" == "vdn_max" ]
-then
- addrs_pages="$vdn_i2c_addr_page"
- for_each_rail vrm_vout_max_1v1
else
- for_each_rail vrm_print
echo "\"$0 <enable|disable>\" to control whether VRMs use AVSBus"
echo "\"$0 <vdn_max>\" to set VDN rails VOUT_MAX to 1.1V"
fi