summaryrefslogtreecommitdiff
path: root/meta-qualcomm/meta-centriq2400-rep/recipes-phosphor/chassis/ir38163-workaround
diff options
context:
space:
mode:
authorDave Cobbley <david.j.cobbley@linux.intel.com>2018-08-23 04:40:54 +0300
committerBrad Bishop <bradleyb@fuzziesquirrel.com>2018-08-23 19:39:42 +0300
commit194ff4f1f5d44b12e9cb06ddafa6adb20174a13c (patch)
tree823835cd29daf8901a31ac14c7e6534abf199be3 /meta-qualcomm/meta-centriq2400-rep/recipes-phosphor/chassis/ir38163-workaround
parent4feb727cd6b77a68bdaca63e121b378d814f5eaf (diff)
downloadopenbmc-194ff4f1f5d44b12e9cb06ddafa6adb20174a13c.tar.xz
[Subtree] Bring openbmc machines to top level
The new subtree model brings the subtrees up from the openbmc-machines layer. Change-Id: I58a03ae1be374bc79ae1438e65e888375d12d0c0 Signed-off-by: Dave Cobbley <david.j.cobbley@linux.intel.com> Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
Diffstat (limited to 'meta-qualcomm/meta-centriq2400-rep/recipes-phosphor/chassis/ir38163-workaround')
-rw-r--r--meta-qualcomm/meta-centriq2400-rep/recipes-phosphor/chassis/ir38163-workaround/ir-add@.service16
-rw-r--r--meta-qualcomm/meta-centriq2400-rep/recipes-phosphor/chassis/ir38163-workaround/ir-remove@.service13
-rw-r--r--meta-qualcomm/meta-centriq2400-rep/recipes-phosphor/chassis/ir38163-workaround/ir38163_workaround.sh19
3 files changed, 48 insertions, 0 deletions
diff --git a/meta-qualcomm/meta-centriq2400-rep/recipes-phosphor/chassis/ir38163-workaround/ir-add@.service b/meta-qualcomm/meta-centriq2400-rep/recipes-phosphor/chassis/ir38163-workaround/ir-add@.service
new file mode 100644
index 000000000..0b3574b2c
--- /dev/null
+++ b/meta-qualcomm/meta-centriq2400-rep/recipes-phosphor/chassis/ir38163-workaround/ir-add@.service
@@ -0,0 +1,16 @@
+[Unit]
+Description=Add IR38163 device
+Wants=obmc-power-start@%i.target
+Before=obmc-power-start@%i.target
+Conflicts=obmc-chassis-poweroff@%i.target
+ConditionPathExists=!/run/openbmc/chassis@%i-on
+
+[Service]
+ExecStart=/usr/bin/env ir38163_workaround.sh add
+SyslogIdentifier=ir38163_workaround.sh
+Type=oneshot
+RemainAfterExit=yes
+
+[Install]
+WantedBy=obmc-host-start@%i.target
+
diff --git a/meta-qualcomm/meta-centriq2400-rep/recipes-phosphor/chassis/ir38163-workaround/ir-remove@.service b/meta-qualcomm/meta-centriq2400-rep/recipes-phosphor/chassis/ir38163-workaround/ir-remove@.service
new file mode 100644
index 000000000..15e8d0108
--- /dev/null
+++ b/meta-qualcomm/meta-centriq2400-rep/recipes-phosphor/chassis/ir38163-workaround/ir-remove@.service
@@ -0,0 +1,13 @@
+[Unit]
+Description=Remove IR38163 device
+After=obmc-power-off@%i.target
+Conflicts=obmc-chassis-poweron@%i.target
+
+[Service]
+ExecStart=/usr/bin/env ir38163_workaround.sh rm
+SyslogIdentifier=ir38163_workaround.sh
+Type=oneshot
+RemainAfterExit=yes
+
+[Install]
+WantedBy=obmc-host-stop@%i.target
diff --git a/meta-qualcomm/meta-centriq2400-rep/recipes-phosphor/chassis/ir38163-workaround/ir38163_workaround.sh b/meta-qualcomm/meta-centriq2400-rep/recipes-phosphor/chassis/ir38163-workaround/ir38163_workaround.sh
new file mode 100644
index 000000000..60120cf0d
--- /dev/null
+++ b/meta-qualcomm/meta-centriq2400-rep/recipes-phosphor/chassis/ir38163-workaround/ir38163_workaround.sh
@@ -0,0 +1,19 @@
+#!/bin/sh -e
+# For one of the IR38163 device on i2c bus 5, address 0x42
+# Because the device only work when DC-ON, so when BMC during the DC-OFF state
+# the device will probe fail, need the workaround for this HW design..
+
+if [ "$1" == "add" ]; then
+ echo Add the 0x42 device on i2c bus 5....
+ sleep 2
+ echo 5-0042 > /sys/bus/i2c/drivers/ir38163/bind
+ sleep 1
+elif [ "$1" == "rm" ]; then
+ echo Remove the 0x42 deivce
+ sleep 2
+ echo 5-0042 > /sys/bus/i2c/drivers/ir38163/unbind
+ sleep 1
+else
+ echo "$0 <add|rm>" to set state
+fi
+