diff options
Diffstat (limited to 'meta-yadro/meta-nicole/recipes-phosphor/chassis')
3 files changed, 76 insertions, 0 deletions
diff --git a/meta-yadro/meta-nicole/recipes-phosphor/chassis/avsbus-control.bb b/meta-yadro/meta-nicole/recipes-phosphor/chassis/avsbus-control.bb new file mode 100644 index 000000000..854795be3 --- /dev/null +++ b/meta-yadro/meta-nicole/recipes-phosphor/chassis/avsbus-control.bb @@ -0,0 +1,25 @@ +SUMMARY = "Nicole AVSBus control" +PR = "r1" +LICENSE = "Apache-2.0" +LIC_FILES_CHKSUM = "file://${YADROBASE}/COPYING.apache-2.0;md5=34400b68072d710fecd0a2940a0d1658" + +inherit obmc-phosphor-systemd + +RDEPENDS_${PN} += "i2c-tools" + +S = "${WORKDIR}" +SRC_URI += "file://avsbus-control.sh" + +do_install() { + install -d ${D}${bindir} + install -m 0755 ${WORKDIR}/avsbus-control.sh \ + ${D}${bindir}/avsbus-control.sh +} + +TMPL= "avsbus-control@.service" +INSTFMT= "avsbus-control@{0}.service" +TGTFMT = "obmc-chassis-poweron@{0}.target" +FMT = "../${TMPL}:${TGTFMT}.requires/${INSTFMT}" + +SYSTEMD_SERVICE_${PN} += "${TMPL}" +SYSTEMD_LINK_${PN} += "${@compose_list(d, 'FMT', 'OBMC_CHASSIS_INSTANCES')}" diff --git a/meta-yadro/meta-nicole/recipes-phosphor/chassis/avsbus-control/avsbus-control.sh b/meta-yadro/meta-nicole/recipes-phosphor/chassis/avsbus-control/avsbus-control.sh new file mode 100755 index 000000000..0330b221f --- /dev/null +++ b/meta-yadro/meta-nicole/recipes-phosphor/chassis/avsbus-control/avsbus-control.sh @@ -0,0 +1,31 @@ +#!/bin/sh -eu + +function override_avs_settings() +{ + BUS=$1 + + i2cset -y ${BUS} 0x44 0x00 0x00 b # VCS + i2cset -y ${BUS} 0x44 0x24 0x044C w # VOUT_MAX 1100mV + i2cset -y ${BUS} 0x44 0x40 0x0456 w # VOUT_OV_FAULT_LIMIT 1110mV + i2cset -y ${BUS} 0x44 0x25 0x0438 w # VOUT_MARGING_HIGH 1080mV + i2cset -y ${BUS} 0x44 0x26 0x03D4 w # VOUT_MARGING_LOW 980mV + i2cset -y ${BUS} 0x44 0x44 0x024E w # VOUT_UV_FAULT_LIMIT 590mV + i2cset -y ${BUS} 0x44 0x2B 0x0258 w # VOUT_MIN 600mV + + i2cset -y ${BUS} 0x44 0x00 0x01 b # VDD + i2cset -y ${BUS} 0x44 0x24 0x044C w # VOUT_MAX 1100mV + i2cset -y ${BUS} 0x44 0x40 0x0456 w # VOUT_OV_FAULT_LIMIT 1110mV + i2cset -y ${BUS} 0x44 0x25 0x041A w # VOUT_MARGING_HIGH 1050mV + i2cset -y ${BUS} 0x44 0x26 0x03B6 w # VOUT_MARGING_LOW 950mV + i2cset -y ${BUS} 0x44 0x44 0x024E w # VOUT_UV_FAULT_LIMIT 590mV + i2cset -y ${BUS} 0x44 0x2B 0x0258 w # VOUT_MIN 600mV + + i2cset -y ${BUS} 0x44 0x00 0xFF b # All pages (VCS & VDD) + i2cset -y ${BUS} 0x44 0x01 0xB0 b # Enable + + i2cset -y ${BUS} 0x46 0x00 0x01 b # VDN + i2cset -y ${BUS} 0x46 0x01 0xB0 b # Enable +} + +override_avs_settings 4 +override_avs_settings 5 diff --git a/meta-yadro/meta-nicole/recipes-phosphor/chassis/avsbus-control/avsbus-control@.service b/meta-yadro/meta-nicole/recipes-phosphor/chassis/avsbus-control/avsbus-control@.service new file mode 100644 index 000000000..247c506b7 --- /dev/null +++ b/meta-yadro/meta-nicole/recipes-phosphor/chassis/avsbus-control/avsbus-control@.service @@ -0,0 +1,20 @@ +[Unit] +Description=Enable the AVS bus on VRMs +Wants=obmc-host-start-pre@%i.target +Before=obmc-host-start-pre@%i.target +Wants=obmc-power-on@%i.target +After=obmc-power-on@%i.target +Wants=fsi-scan@%i.service +After=fsi-scan@%i.service +Conflicts=obmc-chassis-poweroff@%i.target +ConditionPathExists=!/run/openbmc/chassis@%i-on + +[Service] +ExecStart=/usr/bin/avsbus-control.sh +SyslogIdentifier=avsbus-control.sh +Type=oneshot +RemainAfterExit=yes + +[Install] +WantedBy=obmc-chassis-poweron@%i.target + |