Skip to content

Commit

Permalink
wedge400: set_sled.sh is ready for wedge400/wedge400-2 platform (#102)
Browse files Browse the repository at this point in the history
Summary:
As title
Pull Request resolved: facebookexternal/openbmc.celestica#102

Test Plan: Can not provide log, should test on site.

Reviewed By: joancaneus

fbshipit-source-id: 43493f480d
  • Loading branch information
joancaneus authored and facebook-github-bot committed Aug 17, 2019
1 parent ef12e82 commit 1da629b
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions meta-facebook/meta-wedge400/recipes-utils/openbmc-utils/files/set_sled.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/sh
#
# Copyright 2018-present Facebook. All Rights Reserved.
# Copyright 2019-present Facebook. All Rights Reserved.
#
# This program file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
Expand Down Expand Up @@ -34,7 +34,7 @@ usage(){
echo "Usage:"
echo " $program <dev> <color>"
echo ""
echo " <dev>: sys/smb/psu/sts"
echo " <dev>: sts/smb/psu/fan"
echo " <color>: off/red/blue/yellow"
}

Expand All @@ -59,7 +59,7 @@ esac

if [ "$3" == "0" ] || [ "$3" == "4" ]; then

if [ "$1" == "smb" ] || [ "$1" == "sys" ]; then
if [ "$1" == "smb" ] || [ "$1" == "fan" ]; then
val=$(($val << 3))
IO0_VAL=$((($IO0 & 0x7) | $val))
IO1_VAL=$((($IO1 & 0x7) | $val))
Expand All @@ -71,15 +71,15 @@ if [ "$3" == "0" ] || [ "$3" == "4" ]; then
exit -1
fi

if [ "$1" == "sts" ] || [ "$1" == "sys" ]; then
if [ "$1" == "sts" ] || [ "$1" == "fan" ]; then
i2cset -f -y 6 0x20 0x2 $IO0_VAL
else
i2cset -f -y 6 0x20 0x3 $IO1_VAL
fi

else

if [ "$1" == "sys" ] || [ "$1" == "smb" ]; then
if [ "$1" == "fan" ] || [ "$1" == "smb" ]; then
val=$(($val << 3))
IO0_VAL=$((($IO0 & 0x7) | $val))
IO1_VAL=$((($IO1 & 0x7) | $val))
Expand All @@ -91,7 +91,7 @@ else
exit -1
fi

if [ "$1" == "sys" ] || [ "$1" == "sts" ]; then
if [ "$1" == "fan" ] || [ "$1" == "sts" ]; then
i2cset -f -y 6 0x20 0x2 $IO0_VAL
else
i2cset -f -y 6 0x20 0x3 $IO1_VAL
Expand Down

0 comments on commit 1da629b

Please sign in to comment.