diff options
author | Peter Yin <peter.yin@quantatw.com> | 2024-06-13 13:01:58 +0300 |
---|---|---|
committer | Patrick Williams <patrick@stwcx.xyz> | 2024-06-15 10:22:04 +0300 |
commit | 5eb9ba3c3a3440df185712589ceae2922b0225bc (patch) | |
tree | d943615662c4f0f8a184c2df20c1f9cb929fad89 | |
parent | 6a339a98cb54f0a7157ba0ec2f6fc15a3ff5db25 (diff) | |
download | openbmc-5eb9ba3c3a3440df185712589ceae2922b0225bc.tar.xz |
meta-facebook: harma: probe pca9546 device.
The hardware changes involve the SITV and PTTV I2C bus from 9 to 11,
so we need to probe the I2C mux in the script
to ensure compatibility with EVT and DVT.
Change-Id: I0c559589d2edbec5c184efc05aad24d7ed59a916
Signed-off-by: Peter Yin <peter.yin@quantatw.com>
3 files changed, 36 insertions, 1 deletions
diff --git a/meta-facebook/meta-harma/recipes-phosphor/configuration/entity-manager/device-driver-probe b/meta-facebook/meta-harma/recipes-phosphor/configuration/entity-manager/device-driver-probe new file mode 100644 index 0000000000..6eb9643fc1 --- /dev/null +++ b/meta-facebook/meta-harma/recipes-phosphor/configuration/entity-manager/device-driver-probe @@ -0,0 +1,22 @@ +#!/bin/bash + +read_mux_dev() { + for _ in {1..3}; do + if /usr/sbin/i2cget -f -y "$1" "$2" 2>/dev/null; then + return 0 + fi + done + return 1 +} + +probe_sitv_pttv_mux() { + if read_mux_dev 9 0x71; then + echo pca9546 0x71 > /sys/bus/i2c/devices/i2c-9/new_device + else + echo pca9546 0x71 > /sys/bus/i2c/devices/i2c-11/new_device + fi +} + +probe_sitv_pttv_mux + +exit 0 diff --git a/meta-facebook/meta-harma/recipes-phosphor/configuration/entity-manager/xyz.openbmc_project.EntityManager.conf b/meta-facebook/meta-harma/recipes-phosphor/configuration/entity-manager/xyz.openbmc_project.EntityManager.conf new file mode 100644 index 0000000000..e3f79cee63 --- /dev/null +++ b/meta-facebook/meta-harma/recipes-phosphor/configuration/entity-manager/xyz.openbmc_project.EntityManager.conf @@ -0,0 +1,3 @@ +[Service] +ExecStartPre=/usr/libexec/entity-manager/device-driver-probe + diff --git a/meta-facebook/meta-harma/recipes-phosphor/configuration/entity-manager_%.bbappend b/meta-facebook/meta-harma/recipes-phosphor/configuration/entity-manager_%.bbappend index 6e89557dec..23e7ed4c3b 100644 --- a/meta-facebook/meta-harma/recipes-phosphor/configuration/entity-manager_%.bbappend +++ b/meta-facebook/meta-harma/recipes-phosphor/configuration/entity-manager_%.bbappend @@ -1,9 +1,19 @@ FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:" -SRC_URI:append = " \ +inherit obmc-phosphor-systemd systemd + +SRC_URI += "\ file://blacklist.json \ + file://device-driver-probe \ " +RDEPENDS:${PN}:append = " bash" + +SYSTEMD_OVERRIDE:${PN} += "xyz.openbmc_project.EntityManager.conf:xyz.openbmc_project.EntityManager.service.d/xyz.openbmc_project.EntityManager.conf" + do_install:append() { install -m 0644 -D ${WORKDIR}/blacklist.json ${D}${datadir}/${PN}/blacklist.json + + install -d ${D}${libexecdir}/${PN} + install -m 0755 ${WORKDIR}/device-driver-probe ${D}${libexecdir}/${PN}/ } |