diff options
Diffstat (limited to 'meta-quanta/meta-gbs/recipes-phosphor')
7 files changed, 158 insertions, 15 deletions
diff --git a/meta-quanta/meta-gbs/recipes-phosphor/images/obmc-phosphor-image.bbappend b/meta-quanta/meta-gbs/recipes-phosphor/images/obmc-phosphor-image.bbappend index 3b83932e7..27c3c9fdd 100644 --- a/meta-quanta/meta-gbs/recipes-phosphor/images/obmc-phosphor-image.bbappend +++ b/meta-quanta/meta-gbs/recipes-phosphor/images/obmc-phosphor-image.bbappend @@ -21,3 +21,4 @@ OBMC_IMAGE_EXTRA_INSTALL_append_gbs = " openssl-bin" OBMC_IMAGE_EXTRA_INSTALL_append_gbs = " phosphor-ipmi-blobs-binarystore" OBMC_IMAGE_EXTRA_INSTALL_append_gbs = " gbs-nvme-pwr-ctrl" OBMC_IMAGE_EXTRA_INSTALL_append_gbs = " read-margin-temp" +OBMC_IMAGE_EXTRA_INSTALL_append_gbs = " phosphor-virtual-sensor" diff --git a/meta-quanta/meta-gbs/recipes-phosphor/sensors/phosphor-hwmon/obmc/hwmon/ahb/apb/i2c@85000/i2c-switch@71/i2c@0/max31725@54.conf b/meta-quanta/meta-gbs/recipes-phosphor/sensors/phosphor-hwmon/obmc/hwmon/ahb/apb/i2c@85000/i2c-switch@71/i2c@0/max31725@54.conf index 839a7c610..1e3f5f354 100644 --- a/meta-quanta/meta-gbs/recipes-phosphor/sensors/phosphor-hwmon/obmc/hwmon/ahb/apb/i2c@85000/i2c-switch@71/i2c@0/max31725@54.conf +++ b/meta-quanta/meta-gbs/recipes-phosphor/sensors/phosphor-hwmon/obmc/hwmon/ahb/apb/i2c@85000/i2c-switch@71/i2c@0/max31725@54.conf @@ -1,8 +1,4 @@ -LABEL_temp1 = "i2cool_0" -CRITHI_temp1 = "35000" -CRITLO_temp1 = "0" -WARNHI_temp1 = "35000" -WARNLO_temp1 = "0" +LABEL_temp1 = "inlet" MINVALUE_temp1 = "-128" MAXVALUE_temp1 = "127" ASYNC_READ_TIMEOUT_temp1 = "500" diff --git a/meta-quanta/meta-gbs/recipes-phosphor/sensors/phosphor-hwmon/obmc/hwmon/ahb/apb/i2c@85000/i2c-switch@71/i2c@1/max31725@55.conf b/meta-quanta/meta-gbs/recipes-phosphor/sensors/phosphor-hwmon/obmc/hwmon/ahb/apb/i2c@85000/i2c-switch@71/i2c@1/max31725@55.conf index 174c62b98..d13bfab32 100644 --- a/meta-quanta/meta-gbs/recipes-phosphor/sensors/phosphor-hwmon/obmc/hwmon/ahb/apb/i2c@85000/i2c-switch@71/i2c@1/max31725@55.conf +++ b/meta-quanta/meta-gbs/recipes-phosphor/sensors/phosphor-hwmon/obmc/hwmon/ahb/apb/i2c@85000/i2c-switch@71/i2c@1/max31725@55.conf @@ -1,8 +1,4 @@ -LABEL_temp1 = "i2cool_1" -CRITHI_temp1 = "70000" -CRITLO_temp1 = "0" -WARNHI_temp1 = "70000" -WARNLO_temp1 = "0" +LABEL_temp1 = "outlet_0" MINVALUE_temp1 = "-128" MAXVALUE_temp1 = "127" ASYNC_READ_TIMEOUT_temp1 = "500" diff --git a/meta-quanta/meta-gbs/recipes-phosphor/sensors/phosphor-hwmon/obmc/hwmon/ahb/apb/i2c@85000/i2c-switch@71/i2c@2/max31725@5d.conf b/meta-quanta/meta-gbs/recipes-phosphor/sensors/phosphor-hwmon/obmc/hwmon/ahb/apb/i2c@85000/i2c-switch@71/i2c@2/max31725@5d.conf index 3fb0ceeeb..e8bcd693f 100644 --- a/meta-quanta/meta-gbs/recipes-phosphor/sensors/phosphor-hwmon/obmc/hwmon/ahb/apb/i2c@85000/i2c-switch@71/i2c@2/max31725@5d.conf +++ b/meta-quanta/meta-gbs/recipes-phosphor/sensors/phosphor-hwmon/obmc/hwmon/ahb/apb/i2c@85000/i2c-switch@71/i2c@2/max31725@5d.conf @@ -1,8 +1,4 @@ -LABEL_temp1 = "i2cool_2" -CRITHI_temp1 = "70000" -CRITLO_temp1 = "0" -WARNHI_temp1 = "70000" -WARNLO_temp1 = "0" +LABEL_temp1 = "outlet_1" MINVALUE_temp1 = "-128" MAXVALUE_temp1 = "127" ASYNC_READ_TIMEOUT_temp1 = "500" diff --git a/meta-quanta/meta-gbs/recipes-phosphor/sensors/phosphor-virtual-sensor/config-virtual-sensor.json b/meta-quanta/meta-gbs/recipes-phosphor/sensors/phosphor-virtual-sensor/config-virtual-sensor.json new file mode 100644 index 000000000..6e729108a --- /dev/null +++ b/meta-quanta/meta-gbs/recipes-phosphor/sensors/phosphor-virtual-sensor/config-virtual-sensor.json @@ -0,0 +1,123 @@ +[ + { + "Desc": { + "Name": "i2cool_0", + "SensorType": "temperature" + }, + "Threshold": { + "CriticalHigh": 35, + "CriticalLow": 0, + "WarningHigh": 35, + "WarningLow": 0 + }, + "Params": { + "DbusParam": [ + { + "ParamName": "inlet", + "Desc": { + "Name": "inlet", + "SensorType": "temperature" + } + }, + { + "ParamName": "fan0", + "Desc": { + "Name": "fan0", + "SensorType": "fan_tach" + } + }, + { + "ParamName": "fan1", + "Desc": { + "Name": "fan1", + "SensorType": "fan_tach" + } + } + ] + }, + "Expression": "round(inlet - 1 - (1.8 * 3700 / avg(fan0, fan1)))" + }, + { + "Desc": { + "Name": "i2cool_1", + "SensorType": "temperature" + }, + "Threshold": { + "CriticalHigh": 70, + "CriticalLow": 0, + "WarningHigh": 70, + "WarningLow": 0 + }, + "Params": { + "DbusParam": [ + { + "ParamName": "outlet_0", + "Desc": { + "Name": "outlet_0", + "SensorType": "temperature" + } + }, + { + "ParamName": "fan0", + "Desc": { + "Name": "fan0", + "SensorType": "fan_tach" + } + }, + { + "ParamName": "fan1", + "Desc": { + "Name": "fan1", + "SensorType": "fan_tach" + } + } + ] + }, + "Expression": "round(outlet_0 - if(avg(fan0, fan1) >= 7400, 3 * 9558 / avg(fan0, fan1), 7 * 3700 / avg(fan0, fan1) - 2))" + }, + { + "Desc": { + "Name": "i2cool_2", + "SensorType": "temperature" + }, + "Threshold": { + "CriticalHigh": 70, + "CriticalLow": 0, + "WarningHigh": 70, + "WarningLow": 0 + }, + "Params": { + "DbusParam": [ + { + "ParamName": "outlet_1", + "Desc": { + "Name": "outlet_1", + "SensorType": "temperature" + } + }, + { + "ParamName": "fb_fan0", + "Desc": { + "Name": "fb_fan0", + "SensorType": "fan_tach" + } + }, + { + "ParamName": "fb_fan1", + "Desc": { + "Name": "fb_fan1", + "SensorType": "fan_tach" + } + }, + { + "ParamName": "fb_fan2", + "Desc": { + "Name": "fb_fan2", + "SensorType": "fan_tach" + } + } + ] + }, + "Expression": "round(outlet_1 - if(avg(fb_fan0, fb_fan1, fb_fan2) >= 7400, 1 * 9558 / avg(fb_fan0, fb_fan1, fb_fan2), 1))" + } +] diff --git a/meta-quanta/meta-gbs/recipes-phosphor/sensors/phosphor-virtual-sensor/phosphor-virtual-sensor.service.replace b/meta-quanta/meta-gbs/recipes-phosphor/sensors/phosphor-virtual-sensor/phosphor-virtual-sensor.service.replace new file mode 100644 index 000000000..8068d3bd2 --- /dev/null +++ b/meta-quanta/meta-gbs/recipes-phosphor/sensors/phosphor-virtual-sensor/phosphor-virtual-sensor.service.replace @@ -0,0 +1,16 @@ +[Unit] +Description=Virtual sensors +Wants=obmc-mapper.target +After=obmc-mapper.target + +[Service] +ExecStartPre=mapper wait /xyz/openbmc_project/sensors/temperature/inlet +ExecStartPre=mapper wait /xyz/openbmc_project/sensors/temperature/outlet_0 +ExecStartPre=mapper wait /xyz/openbmc_project/sensors/temperature/outlet_1 +ExecStart=/usr/bin/virtual-sensor +Type=dbus +BusName=xyz.openbmc_project.VirtualSensor +SyslogIdentifier=phosphor-virtual-sensor + +[Install] +WantedBy=multi-user.target diff --git a/meta-quanta/meta-gbs/recipes-phosphor/sensors/phosphor-virtual-sensor_%.bbappend b/meta-quanta/meta-gbs/recipes-phosphor/sensors/phosphor-virtual-sensor_%.bbappend new file mode 100644 index 000000000..aadafeb2d --- /dev/null +++ b/meta-quanta/meta-gbs/recipes-phosphor/sensors/phosphor-virtual-sensor_%.bbappend @@ -0,0 +1,15 @@ +FILESEXTRAPATHS_prepend_gbs := "${THISDIR}/${PN}:" + +SRC_URI_append_gbs = " file://config-virtual-sensor.json \ + file://phosphor-virtual-sensor.service.replace \ + " + +do_install_append_gbs() { + install -d ${D}${datadir}/${PN} + install -m 0644 -D ${WORKDIR}/config-virtual-sensor.json \ + ${D}${datadir}/${PN}/virtual_sensor_config.json + + install -d ${D}${systemd_system_unitdir} + install -m 0644 ${WORKDIR}/${PN}.service.replace \ + ${D}${systemd_system_unitdir}/${PN}.service +} |