fp5280g2: Add phosphor-power recipe
Add psu.json and power-supply-monitor-*.conf for fp5280g2.
Parsed PSUs asset information via pmbus driver and exposed properties to
D-BUS interface.
Tested: Verified and built successfully on fp5280g2 and obtained correct
PSUs asset information by busctl command.
busctl --no-pager introspect xyz.openbmc_project.Inventory.Manager
/xyz/openbmc_project/inventory/system/chassis/motherboard/powersupply0
xyz.openbmc_project.Inventory.Decorator.Asset interface - - -
.BuildDate property s "" emits-change writable
.Manufacturer property s "" emits-change writable
.Model property s "PS-2162-5L" emits-change writable
.PartNumber property s "" emits-change writable
.SerialNumber property s "6L5LX01173722Z" emits-change writable
xyz.openbmc_project.Inventory.Item interface - - -
.Present property b true emits-change writable
.PrettyName property s "powersupply0" emits-change writable
xyz.openbmc_project.Inventory.Item.PowerSupply interface - - -
xyz.openbmc_project.Software.Version interface - - -
.Purpose property s "xyz.openbmc_project.Software.Version.V… emits-change writable
.Version property s "1.000-1.00" emits-change writable
Signed-off-by: George Liu <liuxiwei@inspur.com>
Change-Id: Ida1e7864f157f8f1530554eb8e0e6bf9c25dbf98
diff --git a/meta-fp5280g2/recipes-phosphor/packagegroups/packagegroup-obmc-apps.bbappend b/meta-fp5280g2/recipes-phosphor/packagegroups/packagegroup-obmc-apps.bbappend
index 0cd358a..9f8035b 100644
--- a/meta-fp5280g2/recipes-phosphor/packagegroups/packagegroup-obmc-apps.bbappend
+++ b/meta-fp5280g2/recipes-phosphor/packagegroups/packagegroup-obmc-apps.bbappend
@@ -1,2 +1,2 @@
RDEPENDS_${PN}-inventory_append_fp5280g2 = " openpower-fru-vpd openpower-occ-control phosphor-cooling-type virtual/obmc-gpio-presence"
-RDEPENDS_${PN}-extras_append_fp5280g2 = " phosphor-webui"
+RDEPENDS_${PN}-extras_append_fp5280g2 = " phosphor-power phosphor-power-systemd-links phosphor-webui"
diff --git a/meta-fp5280g2/recipes-phosphor/power/phosphor-power/obmc/power-supply-monitor/power-supply-monitor-0.conf b/meta-fp5280g2/recipes-phosphor/power/phosphor-power/obmc/power-supply-monitor/power-supply-monitor-0.conf
new file mode 100644
index 0000000..fa80045
--- /dev/null
+++ b/meta-fp5280g2/recipes-phosphor/power/phosphor-power/obmc/power-supply-monitor/power-supply-monitor-0.conf
@@ -0,0 +1,3 @@
+DEVPATH=/sys/bus/i2c/devices/11-0058
+INSTANCE=0
+INVENTORY=/system/chassis/motherboard/powersupply0
diff --git a/meta-fp5280g2/recipes-phosphor/power/phosphor-power/obmc/power-supply-monitor/power-supply-monitor-1.conf b/meta-fp5280g2/recipes-phosphor/power/phosphor-power/obmc/power-supply-monitor/power-supply-monitor-1.conf
new file mode 100644
index 0000000..de4b119
--- /dev/null
+++ b/meta-fp5280g2/recipes-phosphor/power/phosphor-power/obmc/power-supply-monitor/power-supply-monitor-1.conf
@@ -0,0 +1,3 @@
+DEVPATH=/sys/bus/i2c/devices/11-0059
+INSTANCE=1
+INVENTORY=/system/chassis/motherboard/powersupply1
diff --git a/meta-fp5280g2/recipes-phosphor/power/phosphor-power/psu.json b/meta-fp5280g2/recipes-phosphor/power/phosphor-power/psu.json
new file mode 100644
index 0000000..3669ea3
--- /dev/null
+++ b/meta-fp5280g2/recipes-phosphor/power/phosphor-power/psu.json
@@ -0,0 +1,34 @@
+{
+ "inventoryPMBusAccessType": "Hwmon",
+ "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": "Manufacturer",
+ "fileName": "manufacturer",
+ "interface": "xyz.openbmc_project.Inventory.Decorator.Asset"
+ },
+ {
+ "propertyName": "Model",
+ "fileName": "model",
+ "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/11-0058",
+ "/xyz/openbmc_project/inventory/system/chassis/motherboard/powersupply1" : "/sys/bus/i2c/devices/11-0059"
+ }
+}
diff --git a/meta-fp5280g2/recipes-phosphor/power/phosphor-power_%.bbappend b/meta-fp5280g2/recipes-phosphor/power/phosphor-power_%.bbappend
new file mode 100644
index 0000000..ad1232a
--- /dev/null
+++ b/meta-fp5280g2/recipes-phosphor/power/phosphor-power_%.bbappend
@@ -0,0 +1,12 @@
+FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
+
+SRC_URI += "file://psu.json"
+
+PSU_MONITOR_ENV_FMT = "obmc/power-supply-monitor/power-supply-monitor-{0}.conf"
+SYSTEMD_ENVIRONMENT_FILE_${PN} += "${@compose_list(d, 'PSU_MONITOR_ENV_FMT', 'OBMC_POWER_SUPPLY_INSTANCES')}"
+
+do_install_append() {
+ install -D ${WORKDIR}/psu.json ${D}${datadir}/phosphor-power/psu.json
+}
+
+FILES_${PN} += "${datadir}/phosphor-power/psu.json"