summaryrefslogtreecommitdiff
path: root/meta-facebook
diff options
context:
space:
mode:
authorPotin Lai <potin.lai@quantatw.com>2022-01-04 09:04:06 +0300
committerPatrick Williams <patrick@stwcx.xyz>2022-02-18 23:19:25 +0300
commit0761536683f2bb6d714144b68f362a0a8954c6dc (patch)
tree749adc3edeb9c2a2951aadb56c83b477fe5a8a87 /meta-facebook
parentd5c716dc3add128301ec4ba8ebb21bb6eb7856fd (diff)
downloadopenbmc-0761536683f2bb6d714144b68f362a0a8954c6dc.tar.xz
meta-bletchley: phosphor-virtual-sensor: add virtual sensors
- Virtual_CFM_Sensor Airflow which calculated from inlet fan tach - Virtual_Inlet_Temp Apply calibration equation to adjust inlet temperature Signed-off-by: Potin Lai <potin.lai@quantatw.com> Change-Id: Ia4021871a64bec34a3f309b3305bf1c9e6886753
Diffstat (limited to 'meta-facebook')
-rw-r--r--meta-facebook/meta-bletchley/recipes-phosphor/images/fb-bletchley-phosphor-image.inc1
-rw-r--r--meta-facebook/meta-bletchley/recipes-phosphor/sensors/phosphor-virtual-sensor/virtual_sensor_config.json106
-rw-r--r--meta-facebook/meta-bletchley/recipes-phosphor/sensors/phosphor-virtual-sensor_%.bbappend8
3 files changed, 115 insertions, 0 deletions
diff --git a/meta-facebook/meta-bletchley/recipes-phosphor/images/fb-bletchley-phosphor-image.inc b/meta-facebook/meta-bletchley/recipes-phosphor/images/fb-bletchley-phosphor-image.inc
index 6636f5090b..396e557702 100644
--- a/meta-facebook/meta-bletchley/recipes-phosphor/images/fb-bletchley-phosphor-image.inc
+++ b/meta-facebook/meta-bletchley/recipes-phosphor/images/fb-bletchley-phosphor-image.inc
@@ -2,4 +2,5 @@ OBMC_IMAGE_EXTRA_INSTALL:append = " \
phosphor-nvme \
plat-svc \
motor-ctrl \
+ phosphor-virtual-sensor \
"
diff --git a/meta-facebook/meta-bletchley/recipes-phosphor/sensors/phosphor-virtual-sensor/virtual_sensor_config.json b/meta-facebook/meta-bletchley/recipes-phosphor/sensors/phosphor-virtual-sensor/virtual_sensor_config.json
new file mode 100644
index 0000000000..c1b5e16766
--- /dev/null
+++ b/meta-facebook/meta-bletchley/recipes-phosphor/sensors/phosphor-virtual-sensor/virtual_sensor_config.json
@@ -0,0 +1,106 @@
+[
+ {
+ "Desc":
+ {
+ "Name": "Virtual_CFM_Sensor",
+ "SensorType": "airflow"
+ },
+ "Params":
+ {
+ "DbusParam":
+ [
+ {
+ "ParamName": "fan0",
+ "Desc":
+ {
+ "Name": "FAN0_TACH_IL",
+ "SensorType": "fan_tach"
+ }
+ },
+ {
+ "ParamName": "fan1",
+ "Desc":
+ {
+ "Name": "FAN1_TACH_IL",
+ "SensorType": "fan_tach"
+ }
+ },
+ {
+ "ParamName": "fan2",
+ "Desc":
+ {
+ "Name": "FAN2_TACH_IL",
+ "SensorType": "fan_tach"
+ }
+ },
+ {
+ "ParamName": "fan3",
+ "Desc":
+ {
+ "Name": "FAN3_TACH_IL",
+ "SensorType": "fan_tach"
+ }
+ }
+ ]
+ },
+ "Expression": "max(0, (avg(fan0, fan1, fan2, fan3) * 0.0478) - 11.467)"
+ },
+ {
+ "Desc":
+ {
+ "Name": "Virtual_Inlet_Temp",
+ "SensorType": "temperature"
+ },
+ "Threshold":{
+ "CriticalHigh": 40,
+ "CriticalLow": 0
+ },
+ "Params":
+ {
+ "DbusParam":
+ [
+ {
+ "ParamName": "inlet_temp",
+ "Desc":
+ {
+ "Name": "FRONT_PANEL_TEMP",
+ "SensorType": "temperature"
+ }
+ },
+ {
+ "ParamName": "fan0",
+ "Desc":
+ {
+ "Name": "FAN0_TACH_IL",
+ "SensorType": "fan_tach"
+ }
+ },
+ {
+ "ParamName": "fan1",
+ "Desc":
+ {
+ "Name": "FAN1_TACH_IL",
+ "SensorType": "fan_tach"
+ }
+ },
+ {
+ "ParamName": "fan2",
+ "Desc":
+ {
+ "Name": "FAN2_TACH_IL",
+ "SensorType": "fan_tach"
+ }
+ },
+ {
+ "ParamName": "fan3",
+ "Desc":
+ {
+ "Name": "FAN3_TACH_IL",
+ "SensorType": "fan_tach"
+ }
+ }
+ ]
+ },
+ "Expression": "if(avg(fan0, fan1, fan2, fan3) > 0, inlet_temp - (((avg(fan0, fan1, fan2, fan3)^2) * (5e-8)) - (avg(fan0, fan1, fan2, fan3) * (6e-4)) + 1.5841), inlet_temp)"
+ }
+]
diff --git a/meta-facebook/meta-bletchley/recipes-phosphor/sensors/phosphor-virtual-sensor_%.bbappend b/meta-facebook/meta-bletchley/recipes-phosphor/sensors/phosphor-virtual-sensor_%.bbappend
new file mode 100644
index 0000000000..9c853669f2
--- /dev/null
+++ b/meta-facebook/meta-bletchley/recipes-phosphor/sensors/phosphor-virtual-sensor_%.bbappend
@@ -0,0 +1,8 @@
+FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:"
+SRC_URI += " \
+ file://virtual_sensor_config.json \
+"
+
+do_install:append() {
+ install -m 0644 -D ${WORKDIR}/virtual_sensor_config.json ${D}${datadir}/phosphor-virtual-sensor/
+}