From e9e3d5c76872873b8debdfc80ce7ab42317461b8 Mon Sep 17 00:00:00 2001 From: "Thang Q. Nguyen" Date: Tue, 29 Dec 2020 07:18:26 +0000 Subject: meta-ampere: mtjade: Enable Redfish support for on-board sensors Map FAN, temperature and voltage sensors with Redfish chassis instance and enables association feature in phosphor-inventory-manager. The bmcweb looks for the sensors associated with a chassis instance in the association list. The list, which is associations.json file in phosphor-inventory-manager, maps the dbus sensor objects to a chassis inventory. Tested: 1. Check power/voltage sensors reported in redfish/v1/Chassis/chassis/Power. 2. Check FANs/thermal sensors reported in redfish/v1/Chassis/chassis/Thermal. Signed-off-by: Thang Q. Nguyen Change-Id: Ie62a1c1a4edeaf165f834f7456c26711b4b42701 --- .../inventory/inventory-cleanup.bb | 17 +++++ .../inventory-cleanup/inventory-cleanup.yaml | 16 +++++ .../phosphor-inventory-manager/associations.json | 72 ++++++++++++++++++++++ .../phosphor-inventory-manager_%.bbappend | 10 +++ 4 files changed, 115 insertions(+) create mode 100644 meta-ampere/meta-jade/recipes-phosphor/inventory/inventory-cleanup.bb create mode 100644 meta-ampere/meta-jade/recipes-phosphor/inventory/inventory-cleanup/inventory-cleanup.yaml create mode 100644 meta-ampere/meta-jade/recipes-phosphor/inventory/phosphor-inventory-manager/associations.json create mode 100644 meta-ampere/meta-jade/recipes-phosphor/inventory/phosphor-inventory-manager_%.bbappend (limited to 'meta-ampere/meta-jade/recipes-phosphor/inventory') diff --git a/meta-ampere/meta-jade/recipes-phosphor/inventory/inventory-cleanup.bb b/meta-ampere/meta-jade/recipes-phosphor/inventory/inventory-cleanup.bb new file mode 100644 index 000000000..0c4b56f72 --- /dev/null +++ b/meta-ampere/meta-jade/recipes-phosphor/inventory/inventory-cleanup.bb @@ -0,0 +1,17 @@ +SUMMARY = "Copy the inventory cleanup yaml for inventory manager" +PR = "r1" +LICENSE = "Apache-2.0" +LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10" + +inherit allarch +inherit phosphor-inventory-manager + +S = "${WORKDIR}" + +SRC_URI = "file://inventory-cleanup.yaml" + +do_install() { + install -D inventory-cleanup.yaml ${D}${base_datadir}/events.d/inventory-cleanup.yaml +} + +FILES_${PN} += "${base_datadir}/events.d/inventory-cleanup.yaml" diff --git a/meta-ampere/meta-jade/recipes-phosphor/inventory/inventory-cleanup/inventory-cleanup.yaml b/meta-ampere/meta-jade/recipes-phosphor/inventory/inventory-cleanup/inventory-cleanup.yaml new file mode 100644 index 000000000..e900ad789 --- /dev/null +++ b/meta-ampere/meta-jade/recipes-phosphor/inventory/inventory-cleanup/inventory-cleanup.yaml @@ -0,0 +1,16 @@ +description: > + Mt.Jade inventory fixups + +events: + - name: Add Chassis interface + description: > + Add the chassis interface on the chassis inventory path + type: startup + actions: + - name: createObjects + objs: + /system/chassis: + xyz.openbmc_project.Inventory.Item.Chassis: + Type: + value: "RackMount" + type: string diff --git a/meta-ampere/meta-jade/recipes-phosphor/inventory/phosphor-inventory-manager/associations.json b/meta-ampere/meta-jade/recipes-phosphor/inventory/phosphor-inventory-manager/associations.json new file mode 100644 index 000000000..bc9cfee32 --- /dev/null +++ b/meta-ampere/meta-jade/recipes-phosphor/inventory/phosphor-inventory-manager/associations.json @@ -0,0 +1,72 @@ +[ + { + "path": "system/chassis", + "endpoints": + [ + { + "types": + { + "rType": "chassis", + "fType": "all_sensors" + }, + "paths": + [ + "/xyz/openbmc_project/sensors/fan_tach/FAN3_1", + "/xyz/openbmc_project/sensors/fan_tach/FAN3_2", + "/xyz/openbmc_project/sensors/fan_tach/FAN4_1", + "/xyz/openbmc_project/sensors/fan_tach/FAN4_2", + "/xyz/openbmc_project/sensors/fan_tach/FAN5_1", + "/xyz/openbmc_project/sensors/fan_tach/FAN5_2", + "/xyz/openbmc_project/sensors/fan_tach/FAN6_1", + "/xyz/openbmc_project/sensors/fan_tach/FAN6_2", + "/xyz/openbmc_project/sensors/fan_tach/FAN7_1", + "/xyz/openbmc_project/sensors/fan_tach/FAN7_2", + "/xyz/openbmc_project/sensors/fan_tach/FAN8_1", + "/xyz/openbmc_project/sensors/fan_tach/FAN8_2", + "/xyz/openbmc_project/sensors/fan_tach/PSU0_fan1", + "/xyz/openbmc_project/sensors/fan_tach/PSU1_fan1", + + "/xyz/openbmc_project/sensors/temperature/TS1_Temp", + "/xyz/openbmc_project/sensors/temperature/TS2_Temp", + "/xyz/openbmc_project/sensors/temperature/TS3_Temp", + "/xyz/openbmc_project/sensors/temperature/TS4_Temp", + "/xyz/openbmc_project/sensors/temperature/TS5_Temp", + "/xyz/openbmc_project/sensors/temperature/TS6_Temp", + "/xyz/openbmc_project/sensors/temperature/PSU0_TEMP", + "/xyz/openbmc_project/sensors/temperature/PSU1_TEMP", + + "/xyz/openbmc_project/sensors/voltage/S0_0V6_VTT0123", + "/xyz/openbmc_project/sensors/voltage/S0_0V6_VTT4567", + "/xyz/openbmc_project/sensors/voltage/S0_0V75_PCP", + "/xyz/openbmc_project/sensors/voltage/S0_0V8_VDDC_SOC", + "/xyz/openbmc_project/sensors/voltage/S0_0V85_RCA", + "/xyz/openbmc_project/sensors/voltage/S0_1V2_VDDQ0123", + "/xyz/openbmc_project/sensors/voltage/S0_1V2_VDDQ4567", + "/xyz/openbmc_project/sensors/voltage/S0_1V5_VDDH", + "/xyz/openbmc_project/sensors/voltage/S0_1V8_VDDH", + "/xyz/openbmc_project/sensors/voltage/S0_1V8_SOC", + "/xyz/openbmc_project/sensors/voltage/S0_1V8_PCP", + "/xyz/openbmc_project/sensors/voltage/S0_2V5_VPP0123", + "/xyz/openbmc_project/sensors/voltage/S0_2V5_VPP4567", + "/xyz/openbmc_project/sensors/voltage/S0_3V3_SOC", + "/xyz/openbmc_project/sensors/voltage/S1_0V6_VTT0123", + "/xyz/openbmc_project/sensors/voltage/S1_0V6_VTT4567", + "/xyz/openbmc_project/sensors/voltage/S1_0V75_PCP", + "/xyz/openbmc_project/sensors/voltage/S1_0V8_VDDC_SOC", + "/xyz/openbmc_project/sensors/voltage/S1_0V85_RCA", + "/xyz/openbmc_project/sensors/voltage/S1_1V2_VDDQ0123", + "/xyz/openbmc_project/sensors/voltage/S1_1V2_VDDQ4567", + "/xyz/openbmc_project/sensors/voltage/S1_1V5_VDDH", + "/xyz/openbmc_project/sensors/voltage/S1_1V8_VDDH", + "/xyz/openbmc_project/sensors/voltage/S1_1V8_SOC", + "/xyz/openbmc_project/sensors/voltage/S1_1V8_PCP", + "/xyz/openbmc_project/sensors/voltage/S1_2V5_VPP0123", + "/xyz/openbmc_project/sensors/voltage/S1_2V5_VPP4567", + "/xyz/openbmc_project/sensors/voltage/S1_3V3_SOC", + "/xyz/openbmc_project/sensors/voltage/3V3_SB", + "/xyz/openbmc_project/sensors/voltage/VBAT_RTC" + ] + } + ] + } +] diff --git a/meta-ampere/meta-jade/recipes-phosphor/inventory/phosphor-inventory-manager_%.bbappend b/meta-ampere/meta-jade/recipes-phosphor/inventory/phosphor-inventory-manager_%.bbappend new file mode 100644 index 000000000..a8856809b --- /dev/null +++ b/meta-ampere/meta-jade/recipes-phosphor/inventory/phosphor-inventory-manager_%.bbappend @@ -0,0 +1,10 @@ +DEPENDS_append_mtjade = " inventory-cleanup" + +FILESEXTRAPATHS_prepend_mtjade := "${THISDIR}/${PN}:" +PACKAGECONFIG_append_mtjade = " associations" +SRC_URI_append_mtjade = " file://associations.json" + +do_install_append_mtjade() { + install -d ${D}${base_datadir} + install -m 0755 ${WORKDIR}/associations.json ${D}${base_datadir} +} -- cgit v1.2.3