Initial commit

This commit is contained in:
Your Name
2026-04-23 17:07:55 +08:00
commit b7e39e063b
16725 changed files with 1625565 additions and 0 deletions
@@ -0,0 +1,25 @@
SUMMARY = "Nicole AVSBus control"
PR = "r1"
LICENSE = "Apache-2.0"
LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10"
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')}"
@@ -0,0 +1,31 @@
#!/bin/sh -eu
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
@@ -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