summaryrefslogtreecommitdiff
path: root/meta-bytedance
diff options
context:
space:
mode:
authorLei YU <yulei.sh@bytedance.com>2020-12-15 11:48:41 +0300
committerLei YU <yulei.sh@bytedance.com>2021-08-20 12:37:19 +0300
commit07382e87e7273836322e0c3abf617bb0b08c2ea1 (patch)
treee6d059780ba01addbea5029c1cc2c0f1959f91ec /meta-bytedance
parent28443cbe6f0ff3417ed16505a7aed25090731ba0 (diff)
downloadopenbmc-07382e87e7273836322e0c3abf617bb0b08c2ea1.tar.xz
bytedance: g220a: Add virtual-sensor package
Add phosphor-virtual-sensor pakcage and configure it to enable "total_power" sensor that is the sum of PSU0/1's input power. Tested: Verify the Total_Power sensor is on DBus and the value is the sum or PSU0 and PSU1's input power. Signed-off-by: Lei YU <yulei.sh@bytedance.com> Change-Id: Ie8f61800299bef01a8bb74256c24d1f0a90df258
Diffstat (limited to 'meta-bytedance')
-rw-r--r--meta-bytedance/meta-g220a/recipes-phosphor/images/obmc-phosphor-image.bbappend1
-rw-r--r--meta-bytedance/meta-g220a/recipes-phosphor/sensors/phosphor-virtual-sensor/virtual_sensor_config.json32
-rw-r--r--meta-bytedance/meta-g220a/recipes-phosphor/sensors/phosphor-virtual-sensor_%.bbappend8
3 files changed, 41 insertions, 0 deletions
diff --git a/meta-bytedance/meta-g220a/recipes-phosphor/images/obmc-phosphor-image.bbappend b/meta-bytedance/meta-g220a/recipes-phosphor/images/obmc-phosphor-image.bbappend
index 6369a8311..038e65ec8 100644
--- a/meta-bytedance/meta-g220a/recipes-phosphor/images/obmc-phosphor-image.bbappend
+++ b/meta-bytedance/meta-g220a/recipes-phosphor/images/obmc-phosphor-image.bbappend
@@ -3,4 +3,5 @@ OBMC_IMAGE_EXTRA_INSTALL:append:g220a = " \
me-time-sync \
static-mac-addr \
phosphor-node-manager-proxy \
+ phosphor-virtual-sensor \
"
diff --git a/meta-bytedance/meta-g220a/recipes-phosphor/sensors/phosphor-virtual-sensor/virtual_sensor_config.json b/meta-bytedance/meta-g220a/recipes-phosphor/sensors/phosphor-virtual-sensor/virtual_sensor_config.json
new file mode 100644
index 000000000..0aacc030f
--- /dev/null
+++ b/meta-bytedance/meta-g220a/recipes-phosphor/sensors/phosphor-virtual-sensor/virtual_sensor_config.json
@@ -0,0 +1,32 @@
+[
+ {
+ "Desc":
+ {
+ "Name": "total_power",
+ "SensorType": "power"
+ },
+ "Params":
+ {
+ "DbusParam":
+ [
+ {
+ "ParamName": "T0",
+ "Desc":
+ {
+ "Name": "PSU0_Input_Power",
+ "SensorType": "power"
+ }
+ },
+ {
+ "ParamName": "T1",
+ "Desc":
+ {
+ "Name": "PSU1_Input_Power",
+ "SensorType": "power"
+ }
+ }
+ ]
+ },
+ "Expression": "T0 + T1"
+ }
+]
diff --git a/meta-bytedance/meta-g220a/recipes-phosphor/sensors/phosphor-virtual-sensor_%.bbappend b/meta-bytedance/meta-g220a/recipes-phosphor/sensors/phosphor-virtual-sensor_%.bbappend
new file mode 100644
index 000000000..9c853669f
--- /dev/null
+++ b/meta-bytedance/meta-g220a/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/
+}