summaryrefslogtreecommitdiff
path: root/meta-fii/meta-kudo/recipes-phosphor
diff options
context:
space:
mode:
authoravenash.thambi <avenash.thambi@fii-usa.com>2021-11-24 23:42:31 +0300
committerVivekanand Veeracholan <vveerach@google.com>2022-01-28 01:49:20 +0300
commitf2b509fc9c280ef94fe8f17912e56745c28e7116 (patch)
tree92886188ec106b5a4563223646c38b9f8d321ff3 /meta-fii/meta-kudo/recipes-phosphor
parent5488ea8d63f7479edb8213feb2d04dba68ffe4d7 (diff)
downloadopenbmc-f2b509fc9c280ef94fe8f17912e56745c28e7116.tar.xz
meta-fii/meta-kudo: Add fan pwm rate change
With the usage of new fans there is a delay in the rate of change of fan pwm from 255 to lower level so the pwm-init.sh is updated to configure the fan controller settings at boot. Signed-off-by: avenash.thambi <avenash.thambi@fii-usa.com> Change-Id: If43dd1de39702128bf61fa6483ea2d210410f67e
Diffstat (limited to 'meta-fii/meta-kudo/recipes-phosphor')
-rw-r--r--meta-fii/meta-kudo/recipes-phosphor/fans/pwm-init/bin/pwm_init.sh16
1 files changed, 15 insertions, 1 deletions
diff --git a/meta-fii/meta-kudo/recipes-phosphor/fans/pwm-init/bin/pwm_init.sh b/meta-fii/meta-kudo/recipes-phosphor/fans/pwm-init/bin/pwm_init.sh
index d559f6a31b..bd88e01c8a 100644
--- a/meta-fii/meta-kudo/recipes-phosphor/fans/pwm-init/bin/pwm_init.sh
+++ b/meta-fii/meta-kudo/recipes-phosphor/fans/pwm-init/bin/pwm_init.sh
@@ -3,4 +3,18 @@
# Set all fans to pwm mode.
# Set all pwm_enable to 1
-find /sys/class/hwmon/hwmon*/ -name 'pwm*_enable' -exec bash -c 'echo "${1}" && echo 1 > "${1}" && cat "${1}"' -- {} \; \ No newline at end of file
+find /sys/class/hwmon/hwmon*/ -name 'pwm*_enable' -exec bash -c 'echo "${1}" && echo 1 > "${1}" && cat "${1}"' -- {} \;
+
+for i in {0..5}
+do
+ fan_pwm_rate_of_change=0x$(printf '%02x' $((8 + i)) | \
+ awk '{print $1}')
+ # Set Fan PWM Rate-of-Change Bits(bits 4:2) to 000b
+ # Register 08h to 0Dh
+ oriRegVal=$(i2cget -y -f 18 0x2c \
+ "${fan_pwm_rate_of_change}")
+ updateVal=$((oriRegVal & 0xe3))
+ updateVal=0x$(printf "%x" ${updateVal})
+ i2cset -y -f 18 0x2c \
+ "${fan_pwm_rate_of_change}" "${updateVal}"
+done