meta-ampere: mtmitchell: handle HIGHTEMP events
Handle HIGHTEMP assert/deassert GPIO events for both socket 0 and
socket 1.
Tested:
1. Stop fan monitor service
2. Stress CPU HOST
stress-ng.sh 600 5 max 100
4. Wait for S0_SOC_Pkg_Temp exceeds 105 degree and check for event.
5. Turn OFF CPU stress and wait for S0_SOC_Pkg_Temp goes below 105C.
Check for deassert event
Signed-off-by: Chanh Nguyen <chanh@os.amperecomputing.com>
Change-Id: I7f2528b50c9a04e7c5ccbf56e9d2e04555351bba
diff --git a/meta-ampere/meta-mitchell/conf/machine/mtmitchell.conf b/meta-ampere/meta-mitchell/conf/machine/mtmitchell.conf
index 339c7c1..aecb597 100644
--- a/meta-ampere/meta-mitchell/conf/machine/mtmitchell.conf
+++ b/meta-ampere/meta-mitchell/conf/machine/mtmitchell.conf
@@ -31,6 +31,7 @@
ampere-hostctrl \
ampere-driver-binder \
ampere-mac-update \
+ phosphor-gpio-monitor-monitor \
phosphor-ipmi-blobs \
phosphor-ipmi-blobs-binarystore \
util-linux \
diff --git a/meta-ampere/meta-mitchell/recipes-phosphor/gpio/phosphor-gpio-monitor/ampere_hightemp_start@.service b/meta-ampere/meta-mitchell/recipes-phosphor/gpio/phosphor-gpio-monitor/ampere_hightemp_start@.service
new file mode 100644
index 0000000..5f26194
--- /dev/null
+++ b/meta-ampere/meta-mitchell/recipes-phosphor/gpio/phosphor-gpio-monitor/ampere_hightemp_start@.service
@@ -0,0 +1,6 @@
+[Unit]
+Description=Ampere Computing LLC HighTempt event
+
+[Service]
+Restart=no
+ExecStart=/usr/bin/env ampere_add_redfishevent.sh OpenBMC.0.1.AmpereEvent.Warning "CPU%i HighTemp asserted"
diff --git a/meta-ampere/meta-mitchell/recipes-phosphor/gpio/phosphor-gpio-monitor/ampere_hightemp_stop@.service b/meta-ampere/meta-mitchell/recipes-phosphor/gpio/phosphor-gpio-monitor/ampere_hightemp_stop@.service
new file mode 100644
index 0000000..012b0dd
--- /dev/null
+++ b/meta-ampere/meta-mitchell/recipes-phosphor/gpio/phosphor-gpio-monitor/ampere_hightemp_stop@.service
@@ -0,0 +1,6 @@
+[Unit]
+Description=Ampere Computing LLC HighTempt event
+
+[Service]
+Restart=no
+ExecStart=/usr/bin/env ampere_add_redfishevent.sh OpenBMC.0.1.AmpereEvent.OK "CPU%i HighTemp deasserted"
diff --git a/meta-ampere/meta-mitchell/recipes-phosphor/gpio/phosphor-gpio-monitor/phosphor-multi-gpio-monitor.json b/meta-ampere/meta-mitchell/recipes-phosphor/gpio/phosphor-gpio-monitor/phosphor-multi-gpio-monitor.json
index bc039aa..38a09a6 100644
--- a/meta-ampere/meta-mitchell/recipes-phosphor/gpio/phosphor-gpio-monitor/phosphor-multi-gpio-monitor.json
+++ b/meta-ampere/meta-mitchell/recipes-phosphor/gpio/phosphor-gpio-monitor/phosphor-multi-gpio-monitor.json
@@ -26,5 +26,25 @@
"EventMon": "FALLING",
"Target": "ampere_overtemp@1.service",
"Continue": true
+ },
+ {
+ "Name": "S0_HIGHTEMP",
+ "LineName": "s0-hightemp-n",
+ "EventMon": "BOTH",
+ "Targets": {
+ "FALLING": ["ampere_hightemp_start@0.service"],
+ "RISING": ["ampere_hightemp_stop@0.service"]
+ },
+ "Continue": true
+ },
+ {
+ "Name": "S1_HIGHTEMP",
+ "LineName": "s1-hightemp-n",
+ "EventMon": "BOTH",
+ "Targets": {
+ "FALLING": ["ampere_hightemp_start@1.service"],
+ "RISING": ["ampere_hightemp_stop@1.service"]
+ },
+ "Continue": true
}
]
diff --git a/meta-ampere/meta-mitchell/recipes-phosphor/gpio/phosphor-gpio-monitor_%.bbappend b/meta-ampere/meta-mitchell/recipes-phosphor/gpio/phosphor-gpio-monitor_%.bbappend
index f98c043..60661c1 100644
--- a/meta-ampere/meta-mitchell/recipes-phosphor/gpio/phosphor-gpio-monitor_%.bbappend
+++ b/meta-ampere/meta-mitchell/recipes-phosphor/gpio/phosphor-gpio-monitor_%.bbappend
@@ -9,6 +9,8 @@
SYSTEMD_SERVICE:${PN}-monitor += " \
ampere-host-shutdown-ack@.service \
ampere_overtemp@.service \
+ ampere_hightemp_start@.service \
+ ampere_hightemp_stop@.service \
"
FILES:${PN}-monitor += " \