meta-facebook: yosemite4: Revise HSC OCP setting
Revise HSC OCP setting between T1/T2 configuration.
Tested: Tested and verified on yosemite4.
Change-Id: I36f832dc6c3bc91b3f3339f638872735be9c5a2e
Signed-off-by: PeterHo-wiwynn <peter.ho.wiwynn@gmail.com>
diff --git a/meta-facebook/meta-yosemite4/recipes-phosphor/gpio/phosphor-gpio-monitor/rescan-fru-device b/meta-facebook/meta-yosemite4/recipes-phosphor/gpio/phosphor-gpio-monitor/rescan-fru-device
deleted file mode 100644
index 611d5e9..0000000
--- a/meta-facebook/meta-yosemite4/recipes-phosphor/gpio/phosphor-gpio-monitor/rescan-fru-device
+++ /dev/null
@@ -1,6 +0,0 @@
-#!/bin/bash
-
-bus=$(($1 + 15))
-
-# rescan eeprom for fru information
-busctl call xyz.openbmc_project.FruDevice /xyz/openbmc_project/FruDevice xyz.openbmc_project.FruDeviceManager ReScanBus q $bus
diff --git a/meta-facebook/meta-yosemite4/recipes-phosphor/gpio/phosphor-gpio-monitor/rescan-fru-device@.service b/meta-facebook/meta-yosemite4/recipes-phosphor/gpio/phosphor-gpio-monitor/rescan-fru-device@.service
deleted file mode 100644
index 8b4438e..0000000
--- a/meta-facebook/meta-yosemite4/recipes-phosphor/gpio/phosphor-gpio-monitor/rescan-fru-device@.service
+++ /dev/null
@@ -1,7 +0,0 @@
-[Unit]
-Description=Rescan FruDevice for slot %i
-
-[Service]
-Type=oneshot
-ExecStart=/usr/libexec/phosphor-gpio-monitor/rescan-fru-device %i
-SyslogIdentifier=rescan-fru-device%i
diff --git a/meta-facebook/meta-yosemite4/recipes-phosphor/gpio/phosphor-gpio-monitor/rescan-fru-ocp-setting b/meta-facebook/meta-yosemite4/recipes-phosphor/gpio/phosphor-gpio-monitor/rescan-fru-ocp-setting
new file mode 100644
index 0000000..e09fabc
--- /dev/null
+++ b/meta-facebook/meta-yosemite4/recipes-phosphor/gpio/phosphor-gpio-monitor/rescan-fru-ocp-setting
@@ -0,0 +1,34 @@
+#!/bin/bash
+# shellcheck source=meta-facebook/meta-yosemite4/recipes-yosemite4/plat-tool/files/yosemite4-common-functions
+source /usr/libexec/yosemite4-common-functions
+
+bus=$(($1 + 15))
+
+# rescan eeprom for fru information
+busctl call xyz.openbmc_project.FruDevice /xyz/openbmc_project/FruDevice xyz.openbmc_project.FruDeviceManager ReScanBus q $bus
+# wait for fru device to be ready
+sleep 10
+# check if Wailua Falls is present
+wailua_falls_present=$(busctl tree xyz.openbmc_project.FruDevice | grep Wailua_Falls)
+# set 48V/12V HSC OCP values
+if [ -n "$wailua_falls_present" ]; then
+ set_gpio P48V_OCP_GPIO1 0
+ set_gpio P48V_OCP_GPIO2 0
+ set_gpio P48V_OCP_GPIO3 0
+ set_gpio HSC_OCP_SLOT_ODD_GPIO1 1
+ set_gpio HSC_OCP_SLOT_ODD_GPIO2 0
+ set_gpio HSC_OCP_SLOT_ODD_GPIO3 0
+ set_gpio HSC_OCP_SLOT_EVEN_GPIO1 1
+ set_gpio HSC_OCP_SLOT_EVEN_GPIO2 0
+ set_gpio HSC_OCP_SLOT_EVEN_GPIO3 0
+else
+ set_gpio P48V_OCP_GPIO1 1
+ set_gpio P48V_OCP_GPIO2 0
+ set_gpio P48V_OCP_GPIO3 0
+ set_gpio HSC_OCP_SLOT_ODD_GPIO1 0
+ set_gpio HSC_OCP_SLOT_ODD_GPIO2 1
+ set_gpio HSC_OCP_SLOT_ODD_GPIO3 0
+ set_gpio HSC_OCP_SLOT_EVEN_GPIO1 0
+ set_gpio HSC_OCP_SLOT_EVEN_GPIO2 1
+ set_gpio HSC_OCP_SLOT_EVEN_GPIO3 0
+fi
diff --git a/meta-facebook/meta-yosemite4/recipes-phosphor/gpio/phosphor-gpio-monitor/rescan-fru-ocp-setting@.service b/meta-facebook/meta-yosemite4/recipes-phosphor/gpio/phosphor-gpio-monitor/rescan-fru-ocp-setting@.service
new file mode 100644
index 0000000..2d6f868
--- /dev/null
+++ b/meta-facebook/meta-yosemite4/recipes-phosphor/gpio/phosphor-gpio-monitor/rescan-fru-ocp-setting@.service
@@ -0,0 +1,7 @@
+[Unit]
+Description=Rescan FruDevice for slot and set HSC OCP values %i
+
+[Service]
+Type=oneshot
+ExecStart=/usr/libexec/phosphor-gpio-monitor/rescan-fru-ocp-setting %i
+SyslogIdentifier=rescan-fru-ocp-settinge%i
diff --git a/meta-facebook/meta-yosemite4/recipes-phosphor/gpio/phosphor-gpio-monitor/yosemite4-phosphor-multi-gpio-monitor.json b/meta-facebook/meta-yosemite4/recipes-phosphor/gpio/phosphor-gpio-monitor/yosemite4-phosphor-multi-gpio-monitor.json
index 17a6cb1..50d0d65 100644
--- a/meta-facebook/meta-yosemite4/recipes-phosphor/gpio/phosphor-gpio-monitor/yosemite4-phosphor-multi-gpio-monitor.json
+++ b/meta-facebook/meta-yosemite4/recipes-phosphor/gpio/phosphor-gpio-monitor/yosemite4-phosphor-multi-gpio-monitor.json
@@ -13,8 +13,8 @@
"LineName": "PWRGD_SLOT1_STBY",
"EventMon": "BOTH",
"Targets": {
- "RISING": ["probe-slot-device@1.service", "rescan-fru-device@1.service", "rescan-wf-bic@1.service"],
- "FALLING": ["rescan-fru-device@1.service"]
+ "RISING": ["probe-slot-device@1.service", "rescan-fru-ocp-setting@1.service", "rescan-wf-bic@1.service"],
+ "FALLING": ["rescan-fru-ocp-setting@1.service"]
},
"Continue": true
},
@@ -23,8 +23,8 @@
"LineName": "PWRGD_SLOT2_STBY",
"EventMon": "BOTH",
"Targets": {
- "RISING": ["probe-slot-device@2.service", "rescan-fru-device@2.service", "rescan-wf-bic@2.service"],
- "FALLING": ["rescan-fru-device@2.service"]
+ "RISING": ["probe-slot-device@2.service", "rescan-fru-ocp-setting@2.service", "rescan-wf-bic@2.service"],
+ "FALLING": ["rescan-fru-ocp-setting@2.service"]
},
"Continue": true
},
@@ -33,8 +33,8 @@
"LineName": "PWRGD_SLOT3_STBY",
"EventMon": "BOTH",
"Targets": {
- "RISING": ["probe-slot-device@3.service", "rescan-fru-device@3.service", "rescan-wf-bic@3.service"],
- "FALLING": ["rescan-fru-device@3.service"]
+ "RISING": ["probe-slot-device@3.service", "rescan-fru-ocp-setting@3.service", "rescan-wf-bic@3.service"],
+ "FALLING": ["rescan-fru-ocp-setting@3.service"]
},
"Continue": true
},
@@ -43,8 +43,8 @@
"LineName": "PWRGD_SLOT4_STBY",
"EventMon": "BOTH",
"Targets": {
- "RISING": ["probe-slot-device@4.service", "rescan-fru-device@4.service", "rescan-wf-bic@4.service"],
- "FALLING": ["rescan-fru-device@4.service"]
+ "RISING": ["probe-slot-device@4.service", "rescan-fru-ocp-setting@4.service", "rescan-wf-bic@4.service"],
+ "FALLING": ["rescan-fru-ocp-setting@4.service"]
},
"Continue": true
},
@@ -53,8 +53,8 @@
"LineName": "PWRGD_SLOT5_STBY",
"EventMon": "BOTH",
"Targets": {
- "RISING": ["probe-slot-device@5.service", "rescan-fru-device@5.service", "rescan-wf-bic@5.service"],
- "FALLING": ["rescan-fru-device@5.service"]
+ "RISING": ["probe-slot-device@5.service", "rescan-fru-ocp-setting@5.service", "rescan-wf-bic@5.service"],
+ "FALLING": ["rescan-fru-ocp-setting@5.service"]
},
"Continue": true
},
@@ -63,8 +63,8 @@
"LineName": "PWRGD_SLOT6_STBY",
"EventMon": "BOTH",
"Targets": {
- "RISING": ["probe-slot-device@6.service", "rescan-fru-device@6.service", "rescan-wf-bic@6.service"],
- "FALLING": ["rescan-fru-device@6.service"]
+ "RISING": ["probe-slot-device@6.service", "rescan-fru-ocp-setting@6.service", "rescan-wf-bic@6.service"],
+ "FALLING": ["rescan-fru-ocp-setting@6.service"]
},
"Continue": true
},
@@ -73,8 +73,8 @@
"LineName": "PWRGD_SLOT7_STBY",
"EventMon": "BOTH",
"Targets": {
- "RISING": ["probe-slot-device@7.service", "rescan-fru-device@7.service", "rescan-wf-bic@7.service"],
- "FALLING": ["rescan-fru-device@7.service"]
+ "RISING": ["probe-slot-device@7.service", "rescan-fru-ocp-setting@7.service", "rescan-wf-bic@7.service"],
+ "FALLING": ["rescan-fru-ocp-setting@7.service"]
},
"Continue": true
},
@@ -83,8 +83,8 @@
"LineName": "PWRGD_SLOT8_STBY",
"EventMon": "BOTH",
"Targets": {
- "RISING": ["probe-slot-device@8.service", "rescan-fru-device@8.service", "rescan-wf-bic@8.service"],
- "FALLING": ["rescan-fru-device@8.service"]
+ "RISING": ["probe-slot-device@8.service", "rescan-fru-ocp-setting@8.service", "rescan-wf-bic@8.service"],
+ "FALLING": ["rescan-fru-ocp-setting@8.service"]
},
"Continue": true
},
diff --git a/meta-facebook/meta-yosemite4/recipes-phosphor/gpio/phosphor-gpio-monitor_%.bbappend b/meta-facebook/meta-yosemite4/recipes-phosphor/gpio/phosphor-gpio-monitor_%.bbappend
index ca442c7..38e6943 100644
--- a/meta-facebook/meta-yosemite4/recipes-phosphor/gpio/phosphor-gpio-monitor_%.bbappend
+++ b/meta-facebook/meta-yosemite4/recipes-phosphor/gpio/phosphor-gpio-monitor_%.bbappend
@@ -11,8 +11,8 @@
file://probe-slot-device \
file://reconfig-net-interface@.service \
file://reconfig-net-interface \
- file://rescan-fru-device@.service \
- file://rescan-fru-device \
+ file://rescan-fru-ocp-setting@.service \
+ file://rescan-fru-ocp-setting \
file://slot-hot-plug@.service \
file://rescan-wf-bic \
file://rescan-wf-bic@.service \
@@ -35,7 +35,7 @@
SYSTEMD_SERVICE:${PN} += " \
set-button-sled.service \
probe-slot-device@.service \
- rescan-fru-device@.service \
+ rescan-fru-ocp-setting@.service \
slot-hot-plug@.service \
setup-nic-endpoint-slot@.service \
remove-nic-endpoint-slot@.service \
@@ -56,7 +56,7 @@
${D}${datadir}/phosphor-gpio-monitor/phosphor-multi-gpio-monitor.json
install -m 0644 ${WORKDIR}/set-button-sled.service ${D}${systemd_system_unitdir}/set-button-sled.service
install -m 0644 ${WORKDIR}/probe-slot-device@.service ${D}${systemd_system_unitdir}/probe-slot-device@.service
- install -m 0644 ${WORKDIR}/rescan-fru-device@.service ${D}${systemd_system_unitdir}/rescan-fru-device@.service
+ install -m 0644 ${WORKDIR}/rescan-fru-ocp-setting@.service ${D}${systemd_system_unitdir}/rescan-fru-ocp-setting@.service
install -m 0644 ${WORKDIR}/slot-hot-plug@.service ${D}${systemd_system_unitdir}/slot-hot-plug@.service
install -m 0644 ${WORKDIR}/setup-nic-endpoint-slot@.service ${D}${systemd_system_unitdir}/
install -m 0644 ${WORKDIR}/reconfig-net-interface@.service ${D}${systemd_system_unitdir}/reconfig-net-interface@.service
@@ -70,7 +70,7 @@
install -d ${D}${libexecdir}/${PN}
install -m 0755 ${WORKDIR}/probe-slot-device ${D}${libexecdir}/${PN}/
install -m 0755 ${WORKDIR}/reconfig-net-interface ${D}${libexecdir}/${PN}/
- install -m 0755 ${WORKDIR}/rescan-fru-device ${D}${libexecdir}/${PN}/
+ install -m 0755 ${WORKDIR}/rescan-fru-ocp-setting ${D}${libexecdir}/${PN}/
install -m 0755 ${WORKDIR}/rescan-wf-bic ${D}${libexecdir}/${PN}/
install -m 0755 ${WORKDIR}/slot-hsc-fault ${D}${libexecdir}/${PN}/
install -m 0755 ${WORKDIR}/slot-power-fault ${D}${libexecdir}/${PN}/