diff options
author | Ken Chen <chen.kenyy@inventec.com> | 2018-01-30 04:51:50 +0300 |
---|---|---|
committer | Brad Bishop <bradleyb@fuzziesquirrel.com> | 2018-01-31 17:50:52 +0300 |
commit | 811e6b72fe3ef44ae73a6e9ab2b1a7e82c513f17 (patch) | |
tree | 3a659b848cd3d14f93b5648b2c8297e5c9078a5d /meta-openbmc-machines/meta-arm/meta-qualcomm/meta-centriq2400-rep/recipes-phosphor | |
parent | bfdc337f68fbc6d3719cd624777b0f45190c4ba2 (diff) | |
download | openbmc-811e6b72fe3ef44ae73a6e9ab2b1a7e82c513f17.tar.xz |
Add IR38163 re-probe workaround
IR38163 work on DC on state, need re-probe for centriq2400 HW design
Change-Id: I8f2bf997d3fdd9c223367c96b4bd38768c006cdb
Signed-off-by: Ken Chen <chen.kenyy@inventec.com>
Diffstat (limited to 'meta-openbmc-machines/meta-arm/meta-qualcomm/meta-centriq2400-rep/recipes-phosphor')
4 files changed, 78 insertions, 0 deletions
diff --git a/meta-openbmc-machines/meta-arm/meta-qualcomm/meta-centriq2400-rep/recipes-phosphor/chassis/ir38163-workaround.bb b/meta-openbmc-machines/meta-arm/meta-qualcomm/meta-centriq2400-rep/recipes-phosphor/chassis/ir38163-workaround.bb new file mode 100644 index 000000000..85c2e93b0 --- /dev/null +++ b/meta-openbmc-machines/meta-arm/meta-qualcomm/meta-centriq2400-rep/recipes-phosphor/chassis/ir38163-workaround.bb @@ -0,0 +1,30 @@ +SUMMARY = "centriq2400 VR sensor Re-Probe" +DESCRIPTION = "IR38163 work on DC on state, need re-probe for centriq2400 HW design" +PR = "r0" + +inherit obmc-phosphor-systemd +inherit obmc-phosphor-license + +PROVIDES += 'virtual/ir38163-workaround' +RPROVIDES_${PN} += 'virtual-ir38163-workaround' + +IR_REMOVE = "ir-remove@.service" +IR_ADD = "ir-add@.service" +INSTIR_REMOVE = "ir-remove@{0}.service" +INSTIR_ADD = "ir-add@{0}.service" +TGTFMT_OFF = "obmc-chassis-poweroff@{0}.target" +TGTFMT_ON = "obmc-chassis-poweron@{0}.target" +FMT_REMOVE = "../${IR_REMOVE}:${TGTFMT_OFF}.wants/${INSTIR_REMOVE}" +FMT_ADD = "../${IR_ADD}:${TGTFMT_ON}.requires/${INSTIR_ADD}" + +SYSTEMD_SERVICE_${PN} += "${IR_REMOVE}" +SYSTEMD_LINK_${PN} += "${@compose_list(d, 'FMT_REMOVE', 'OBMC_CHASSIS_INSTANCES')}" +SYSTEMD_SERVICE_${PN} += "${IR_ADD}" +SYSTEMD_LINK_${PN} += "${@compose_list(d, 'FMT_ADD', 'OBMC_CHASSIS_INSTANCES')}" + +SRC_URI += "file://ir38163_workaround.sh" + +do_install() { + install -d ${D}${bindir} + install -m 0755 ${WORKDIR}/ir38163_workaround.sh ${D}${bindir}/ir38163_workaround.sh +} diff --git a/meta-openbmc-machines/meta-arm/meta-qualcomm/meta-centriq2400-rep/recipes-phosphor/chassis/ir38163-workaround/ir-add@.service b/meta-openbmc-machines/meta-arm/meta-qualcomm/meta-centriq2400-rep/recipes-phosphor/chassis/ir38163-workaround/ir-add@.service new file mode 100644 index 000000000..0b3574b2c --- /dev/null +++ b/meta-openbmc-machines/meta-arm/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-openbmc-machines/meta-arm/meta-qualcomm/meta-centriq2400-rep/recipes-phosphor/chassis/ir38163-workaround/ir-remove@.service b/meta-openbmc-machines/meta-arm/meta-qualcomm/meta-centriq2400-rep/recipes-phosphor/chassis/ir38163-workaround/ir-remove@.service new file mode 100644 index 000000000..15e8d0108 --- /dev/null +++ b/meta-openbmc-machines/meta-arm/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-openbmc-machines/meta-arm/meta-qualcomm/meta-centriq2400-rep/recipes-phosphor/chassis/ir38163-workaround/ir38163_workaround.sh b/meta-openbmc-machines/meta-arm/meta-qualcomm/meta-centriq2400-rep/recipes-phosphor/chassis/ir38163-workaround/ir38163_workaround.sh new file mode 100644 index 000000000..60120cf0d --- /dev/null +++ b/meta-openbmc-machines/meta-arm/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 + |