meta-ibm:implement phosphor-power for Mihawk platform
Implement power-sequencer of phosphor-power for mihawk.
(From meta-ibm rev: 65dbe8b7c2ed9507ea5842e6e91b637a9069b947)
Change-Id: I00ee20fbcfcd6dc34724c2f7caf50cf7ae94d124
Signed-off-by: Andy YF Wang <Andy_YF_Wang@wistron.com>
Signed-off-by: Andrew Geissler <geissonator@yahoo.com>
diff --git a/meta-ibm/recipes-phosphor/packagegroups/packagegroup-obmc-apps.bbappend b/meta-ibm/recipes-phosphor/packagegroups/packagegroup-obmc-apps.bbappend
index bb73a80..8faad96 100644
--- a/meta-ibm/recipes-phosphor/packagegroups/packagegroup-obmc-apps.bbappend
+++ b/meta-ibm/recipes-phosphor/packagegroups/packagegroup-obmc-apps.bbappend
@@ -25,7 +25,7 @@
RDEPENDS_${PN}-fan-control_append_rainier = " fan-watchdog"
RDEPENDS_${PN}-extras_append_ibm-ac-server = " ${POWER_SERVICE_PACKAGES_AC_SERVER} witherspoon-power-supply-sync phosphor-webui"
RDEPENDS_${PN}-extras_append_rainier = " ${POWER_SERVICE_PACKAGES_RAINIER} phosphor-webui"
-RDEPENDS_${PN}-extras_append_mihawk = " phosphor-webui phosphor-image-signing wistron-ipmi-oem"
+RDEPENDS_${PN}-extras_append_mihawk = " phosphor-webui phosphor-image-signing wistron-ipmi-oem ${POWER_SERVICE_PACKAGES_AC_SERVER}"
RDEPENDS_${PN}-extras_remove_rainier = "obmc-ikvm liberation-fonts uart-render-controller"
RDEPENDS_${PN}-extras_remove_swift = "obmc-ikvm"
RDEPENDS_${PN}-extras_remove_witherspoon-tacoma = "obmc-ikvm liberation-fonts uart-render-controller"
diff --git a/meta-ibm/recipes-phosphor/power/phosphor-power/mihawk/obmc/power-supply-monitor/power-supply-monitor-0.conf b/meta-ibm/recipes-phosphor/power/phosphor-power/mihawk/obmc/power-supply-monitor/power-supply-monitor-0.conf
new file mode 100644
index 0000000..04f169d
--- /dev/null
+++ b/meta-ibm/recipes-phosphor/power/phosphor-power/mihawk/obmc/power-supply-monitor/power-supply-monitor-0.conf
@@ -0,0 +1,3 @@
+DEVPATH=/sys/bus/i2c/devices/3-005b
+INSTANCE=0
+INVENTORY=/system/chassis/motherboard/powersupply0
diff --git a/meta-ibm/recipes-phosphor/power/phosphor-power/mihawk/obmc/power-supply-monitor/power-supply-monitor-1.conf b/meta-ibm/recipes-phosphor/power/phosphor-power/mihawk/obmc/power-supply-monitor/power-supply-monitor-1.conf
new file mode 100644
index 0000000..af19bf2
--- /dev/null
+++ b/meta-ibm/recipes-phosphor/power/phosphor-power/mihawk/obmc/power-supply-monitor/power-supply-monitor-1.conf
@@ -0,0 +1,3 @@
+DEVPATH=/sys/bus/i2c/devices/3-0058
+INSTANCE=1
+INVENTORY=/system/chassis/motherboard/powersupply1
diff --git a/meta-ibm/recipes-phosphor/power/phosphor-power/mihawk/pseq-monitor-pgood.service b/meta-ibm/recipes-phosphor/power/phosphor-power/mihawk/pseq-monitor-pgood.service
new file mode 100644
index 0000000..af748cb
--- /dev/null
+++ b/meta-ibm/recipes-phosphor/power/phosphor-power/mihawk/pseq-monitor-pgood.service
@@ -0,0 +1,13 @@
+[Unit]
+Description=Power Sequencer Power-on Monitor
+Wants=op-power-start@0.service
+After=op-power-start@0.service
+Wants=power-workarounds@0.service
+After=power-workarounds@0.service
+Conflicts=obmc-chassis-poweroff@0.target
+ConditionPathExists=!/run/openbmc/chassis@0-on
+
+[Service]
+Type=oneshot
+ExecStart=/usr/bin/env pseq-monitor -a pgood-monitor -i 10000
+SyslogIdentifier=pseq-monitor
diff --git a/meta-ibm/recipes-phosphor/power/phosphor-power/mihawk/psu.json b/meta-ibm/recipes-phosphor/power/phosphor-power/mihawk/psu.json
new file mode 100644
index 0000000..31ead82
--- /dev/null
+++ b/meta-ibm/recipes-phosphor/power/phosphor-power/mihawk/psu.json
@@ -0,0 +1,29 @@
+{
+ "inventoryPMBusAccessType": "HwmonDeviceDebug",
+ "fruConfigs": [
+ {
+ "propertyName": "PartNumber",
+ "fileName": "part_number",
+ "interface": "xyz.openbmc_project.Inventory.Decorator.Asset"
+ },
+ {
+ "propertyName": "SerialNumber",
+ "fileName": "serial_number",
+ "interface": "xyz.openbmc_project.Inventory.Decorator.Asset"
+ },
+ {
+ "propertyName": "Model",
+ "fileName": "ccin",
+ "interface": "xyz.openbmc_project.Inventory.Decorator.Asset"
+ },
+ {
+ "propertyName": "Version",
+ "fileName": "fw_version",
+ "interface": "xyz.openbmc_project.Software.Version"
+ }
+ ],
+ "psuDevices": {
+ "/xyz/openbmc_project/inventory/system/chassis/motherboard/powersupply0" : "/sys/bus/i2c/devices/3-005b",
+ "/xyz/openbmc_project/inventory/system/chassis/motherboard/powersupply1" : "/sys/bus/i2c/devices/3-0058"
+ }
+}
diff --git a/meta-ibm/recipes-phosphor/power/phosphor-power_%.bbappend b/meta-ibm/recipes-phosphor/power/phosphor-power_%.bbappend
index 5cc839a..3c652ce 100644
--- a/meta-ibm/recipes-phosphor/power/phosphor-power_%.bbappend
+++ b/meta-ibm/recipes-phosphor/power/phosphor-power_%.bbappend
@@ -6,8 +6,10 @@
EXTRA_OEMESON_append_ibm-ac-server = " -Ducd90160-yaml=${STAGING_DIR_HOST}${datadir}/power-sequencer/ucd90160.yaml"
EXTRA_OEMESON_append_rainier = " -Ducd90160-yaml=${STAGING_DIR_HOST}${datadir}/power-sequencer/ucd90160.yaml -Dibm-vpd=true"
+EXTRA_OEMESON_append_mihawk = " -Dpower_sequencer=mihawk-cpld"
-DEPENDS += " power-sequencer"
+DEPENDS_append_ibm-ac-server = " power-sequencer"
+DEPENDS_append_rainier = " power-sequencer"
do_install_append(){
install -D ${WORKDIR}/psu.json ${D}${datadir}/phosphor-power/psu.json
diff --git a/meta-ibm/recipes-phosphor/power/power-sequencer.bb b/meta-ibm/recipes-phosphor/power/power-sequencer.bb
index be5035e..cd58222 100644
--- a/meta-ibm/recipes-phosphor/power/power-sequencer.bb
+++ b/meta-ibm/recipes-phosphor/power/power-sequencer.bb
@@ -5,13 +5,21 @@
inherit allarch
-SRC_URI = "file://ucd90160.yaml"
+SRC_URI_append_ibm-ac-server = " file://ucd90160.yaml"
+SRC_URI_append_rainier = " file://ucd90160.yaml"
-FILES_${PN} += "${datadir}/power-sequencer/ucd90160.yaml"
+FILES_${PN}_append_ibm-ac-server = " ${datadir}/power-sequencer/ucd90160.yaml"
+FILES_${PN}_append_rainier = " ${datadir}/power-sequencer/ucd90160.yaml"
S = "${WORKDIR}"
-do_install() {
+do_install_append_ibm-ac-server() {
+ DEST=${D}${datadir}/power-sequencer
+
+ install -D ucd90160.yaml ${DEST}/ucd90160.yaml
+}
+
+do_install_append_rainier() {
DEST=${D}${datadir}/power-sequencer
install -D ucd90160.yaml ${DEST}/ucd90160.yaml