diff options
author | Ori Bernstein <orib@fb.com> | 2015-09-03 13:06:18 -0700 |
---|---|---|
committer | Ori Bernstein <orib@fb.com> | 2015-09-23 18:10:45 -0700 |
commit | 67f44805b41a532b7b440773f7ee6d17dc0e97f4 (patch) | |
tree | c21a66b12c4d92a765e1ee0d47b96e2a2b9cd0d2 /meta-facebook/meta-yosemite/recipes-yosemite/sensor-setup/files/sensor-setup.sh | |
parent | 2a51b7c1c2165ddb188c511e192b75f0aa0fbead (diff) | |
download | ast2050-yocto-openbmc-67f44805b41a532b7b440773f7ee6d17dc0e97f4.zip ast2050-yocto-openbmc-67f44805b41a532b7b440773f7ee6d17dc0e97f4.tar.gz |
Openbmc dev snapshot.
Diffstat (limited to 'meta-facebook/meta-yosemite/recipes-yosemite/sensor-setup/files/sensor-setup.sh')
-rw-r--r-- | meta-facebook/meta-yosemite/recipes-yosemite/sensor-setup/files/sensor-setup.sh | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/meta-facebook/meta-yosemite/recipes-yosemite/sensor-setup/files/sensor-setup.sh b/meta-facebook/meta-yosemite/recipes-yosemite/sensor-setup/files/sensor-setup.sh new file mode 100644 index 0000000..a53b316 --- /dev/null +++ b/meta-facebook/meta-yosemite/recipes-yosemite/sensor-setup/files/sensor-setup.sh @@ -0,0 +1,54 @@ +#!/bin/sh +# +# Copyright 2014-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 +# Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program in a file named COPYING; if not, write to the +# Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, +# Boston, MA 02110-1301 USA +# + +### BEGIN INIT INFO +# Provides: sensor-setup +# Required-Start: power-on +# Required-Stop: +# Default-Start: S +# Default-Stop: +# Short-Description: Power on micro-server +### END INIT INFO + +# Eventually, this will be used to configure the various (mostly +# i2c-based) sensors, once we have a kernel version that supports +# doing this more dynamically. +# +# For now, we're using it to install the lm75 and pmbus module so that it +# can detect the fourth temperature sensor, which is located +# on the uServer, which doesn't get power until power-on executes. +# +# Similarly, the pmbus sensor seems to have an easier time of +# detecting the NCP4200 buck converters after poweron. This has not +# been carefully explored. + +modprobe lm75 +modprobe pmbus + +# Enable the ADC inputs; adc0 - adc7 are connected to various voltage sensors + +echo 1 > /sys/devices/platform/ast_adc.0/adc0_en +echo 1 > /sys/devices/platform/ast_adc.0/adc1_en +echo 1 > /sys/devices/platform/ast_adc.0/adc2_en +echo 1 > /sys/devices/platform/ast_adc.0/adc3_en +echo 1 > /sys/devices/platform/ast_adc.0/adc4_en +echo 1 > /sys/devices/platform/ast_adc.0/adc5_en +echo 1 > /sys/devices/platform/ast_adc.0/adc6_en +echo 1 > /sys/devices/platform/ast_adc.0/adc7_en |