diff options
author | Daniel Hsu <Daniel-Hsu@quantatw.com> | 2024-04-15 11:51:02 +0300 |
---|---|---|
committer | Patrick Williams <patrick@stwcx.xyz> | 2024-04-15 17:33:24 +0300 |
commit | abeb6aa1c7c9796f28467115a80e9b72d6472a04 (patch) | |
tree | eec92721f1e55ad67b841687f9c4d1ddf289e86f /meta-facebook | |
parent | 1ff89e9dc71603c2208223691b6b2e505a22d5c7 (diff) | |
download | openbmc-abeb6aa1c7c9796f28467115a80e9b72d6472a04.tar.xz |
harma: gpio monitor: Add logging function
Summary:
1. Add general gpio logging function
2. Add gpio pins to monitor
Test Plan:
Trigger a new GPIO pin (leakage-detect-alert) and
check SEL by Redfish command
Testing:
{
"@odata.id": "/.../EventLog/Entries",
"@odata.type": "#LogEntryCollection.LogEntryCollection",
"Description": "Collection of System Event Log Entries",
"Members": [
{
"@odata.id": "/.../EventLog/Entries/1",
"@odata.type": "#LogEntry.v1_9_0.LogEntry",
"AdditionalDataURI": "/.../EventLog/Entries/1/attachment",
"Created": "2024-04-15T08:13:36.320+00:00",
"EntryType": "Event",
"Id": "1",
"Message": "xyz.openbmc_project.Logging.Error.LogsCleared",
"Modified": "2024-04-15T08:13:36.320+00:00",
"Name": "System Event Log Entry",
"Resolved": false,
"Severity": "OK"
}
],
"Members@odata.count": 1,
"Name": "System Event Log Entries"
}
{
"@odata.id": "/.../EventLog/Entries",
"@odata.type": "#LogEntryCollection.LogEntryCollection",
"Description": "Collection of System Event Log Entries",
"Members": [
{
"@odata.id": "/.../EventLog/Entries/1",
"@odata.type": "#LogEntry.v1_9_0.LogEntry",
"AdditionalDataURI": "/.../EventLog/Entries/1/attachment",
"Created": "2024-04-15T08:13:36.320+00:00",
"EntryType": "Event",
"Id": "1",
"Message": "xyz.openbmc_project.Logging.Error.LogsCleared",
"Modified": "2024-04-15T08:13:36.320+00:00",
"Name": "System Event Log Entry",
"Resolved": false,
"Severity": "OK"
},
{
"@odata.id": "/.../EventLog/Entries/2",
"@odata.type": "#LogEntry.v1_9_0.LogEntry",
"AdditionalDataURI": "/.../EventLog/Entries/2/attachment",
"Created": "2024-04-15T08:14:07.446+00:00",
"EntryType": "Event",
"Id": "2",
"Message": "leakage-detect-alert gpio assert",
"Modified": "2024-04-15T08:14:07.446+00:00",
"Name": "System Event Log Entry",
"Resolved": false,
"Severity": "Critical"
}
],
"Members@odata.count": 2,
"Name": "System Event Log Entries"
Change-Id: I341c9ba0ee8434da41f4a6535c0253de01cf42e5
Signed-off-by: Daniel Hsu <Daniel-Hsu@quantatw.com>
Diffstat (limited to 'meta-facebook')
5 files changed, 164 insertions, 8 deletions
diff --git a/meta-facebook/meta-harma/recipes-phosphor/gpio/phosphor-gpio-monitor/assert-gpio-log@.service b/meta-facebook/meta-harma/recipes-phosphor/gpio/phosphor-gpio-monitor/assert-gpio-log@.service new file mode 100644 index 0000000000..e04c5c6981 --- /dev/null +++ b/meta-facebook/meta-harma/recipes-phosphor/gpio/phosphor-gpio-monitor/assert-gpio-log@.service @@ -0,0 +1,7 @@ +[Unit] +Description=%i GPIO Assert + +[Service] +Type=oneshot +ExecStart=/usr/libexec/phosphor-gpio-monitor/logging "%i gpio assert" "GPIO" "%i" +SyslogIdentifier=%i-gpio-assert diff --git a/meta-facebook/meta-harma/recipes-phosphor/gpio/phosphor-gpio-monitor/deassert-gpio-log@.service b/meta-facebook/meta-harma/recipes-phosphor/gpio/phosphor-gpio-monitor/deassert-gpio-log@.service new file mode 100644 index 0000000000..5dde6851e1 --- /dev/null +++ b/meta-facebook/meta-harma/recipes-phosphor/gpio/phosphor-gpio-monitor/deassert-gpio-log@.service @@ -0,0 +1,7 @@ +[Unit] +Description=%i GPIO Deassert + +[Service] +Type=oneshot +ExecStart=/usr/libexec/phosphor-gpio-monitor/logging "%i gpio deassert" "GPIO" "%i" +SyslogIdentifier=%i-gpio-deassert diff --git a/meta-facebook/meta-harma/recipes-phosphor/gpio/phosphor-gpio-monitor/logging b/meta-facebook/meta-harma/recipes-phosphor/gpio/phosphor-gpio-monitor/logging new file mode 100644 index 0000000000..ce69c4e12f --- /dev/null +++ b/meta-facebook/meta-harma/recipes-phosphor/gpio/phosphor-gpio-monitor/logging @@ -0,0 +1,10 @@ +#!/bin/bash + +MESSAGE=$1 +ARG=$2 +VAL=$3 + +busctl call \ + xyz.openbmc_project.Logging /xyz/openbmc_project/logging \ + xyz.openbmc_project.Logging.Create Create "ssa{ss}" "$MESSAGE" \ + xyz.openbmc_project.Logging.Entry.Level.Error 1 "$ARG" "$VAL" diff --git a/meta-facebook/meta-harma/recipes-phosphor/gpio/phosphor-gpio-monitor/plat-phosphor-multi-gpio-monitor.json b/meta-facebook/meta-harma/recipes-phosphor/gpio/phosphor-gpio-monitor/plat-phosphor-multi-gpio-monitor.json index c46e2ab608..18593a0b1c 100644 --- a/meta-facebook/meta-harma/recipes-phosphor/gpio/phosphor-gpio-monitor/plat-phosphor-multi-gpio-monitor.json +++ b/meta-facebook/meta-harma/recipes-phosphor/gpio/phosphor-gpio-monitor/plat-phosphor-multi-gpio-monitor.json @@ -5,34 +5,162 @@ "GpioNum": 122, "EventMon": "BOTH", "Targets": { - "RISING": ["deassert-reset-button.service"], - "FALLING": ["assert-reset-button.service"] + "RISING": ["deassert-gpio-log@reset-button.service","deassert-reset-button.service"], + "FALLING": ["assert-gpio-log@reset-button.service","assert-reset-button.service"] }, "Continue": true }, { + "Name": "power-button", + "ChipId": "0", + "GpioNum": 120, + "EventMon": "BOTH", + "Targets": { + "RISING": ["deassert-gpio-log@power-button.service"], + "FALLING": ["assert-gpio-log@power-button.service"] + }, + "Continue": true + }, + { + "Name": "presence-post-card", + "ChipId": "0", + "GpioNum": 206, + "EventMon": "BOTH", + "Targets": { + "RISING": ["deassert-gpio-log@presence-post-card.service"], + "FALLING": ["assert-gpio-log@presence-post-card.service"] + }, + "Continue": true + }, + { + "Name": "ac-power-button", + "ChipId": "1", + "GpioNum": 0, + "EventMon": "FALLING", + "Targets": { + "FALLING": ["assert-gpio-log@ac-power-button.service"] + }, + "Continue": true + }, + { + "Name": "irq-uv-detect-alert", + "ChipId": "2", + "GpioNum": 174, + "EventMon": "FALLING", + "Targets": { + "FALLING": ["assert-gpio-log@irq-uv-detect-alert.service"] + }, + "Continue": true + }, + { + "Name": "irq-hsc-alert", + "ChipId": "2", + "GpioNum": 176, + "EventMon": "BOTH", + "Targets": { + "RISING": ["deassert-gpio-log@irq-hsc-alert.service"], + "FALLING": ["assert-gpio-log@irq-hsc-alert.service"] + }, + "Continue": true + }, + { + "Name": "cpu0-prochot-alert", + "ChipId": "2", + "GpioNum": 178, + "EventMon": "BOTH", + "Targets": { + "RISING": ["deassert-gpio-log@cpu0-prochot-alert.service"], + "FALLING": ["assert-gpio-log@cpu0-prochot-alert.service"] + }, + "Continue": true + }, + { + "Name": "cpu0-thermtrip-alert", + "ChipId": "2", + "GpioNum": 180, + "EventMon": "FALLING", + "Targets": { + "FALLING": ["assert-gpio-log@cpu0-thermtrip-alert.service"] + }, + "Continue": true + }, + { + "Name": "cpu0-err-alert", + "ChipId": "0", + "GpioNum": 21, + "EventMon": "FALLING", + "Targets": { + "FALLING": ["assert-gpio-log@cpu0-err-alert.service"] + }, + "Continue": true + }, + { + "Name": "reset-cause-platrst", + "ChipId": "0", + "GpioNum": 16, + "EventMon": "BOTH", + "Targets": { + "RISING": ["deassert-gpio-log@reset-cause-platrst.service"], + "FALLING": ["assert-gpio-log@reset-cause-platrst.service"] + }, + "Continue": true + }, + { "Name": "power-host-good", "ChipId": "2", "GpioNum": 60, "EventMon": "BOTH", "Targets": { - "RISING": ["deassert-power-good.service"], - "FALLING": ["assert-power-good.service"] + "RISING": ["deassert-power-good.service", "deassert-gpio-log@power-host-good.service"], + "FALLING": ["assert-power-good.service", "assert-gpio-log@power-host-good.service"] }, "Continue": true }, { - "Name": "post-end-n", + "Name": "reset-cause-pcie", + "ChipId": "2", + "GpioNum": 182, + "EventMon": "BOTH", + "Targets": { + "RISING": ["deassert-gpio-log@reset-cause-pcie.service"], + "FALLING": ["assert-gpio-log@reset-cause-pcie.service"] + }, + "Continue": true + }, + { + "Name": "pvdd11-ocp-alert", + "ChipId": "2", + "GpioNum": 184, + "EventMon": "BOTH", + "Targets": { + "RISING": ["deassert-gpio-log@pvdd11-ocp-alert.service"], + "FALLING": ["assert-gpio-log@pvdd11-ocp-alert.service"] + }, + "Continue": true + }, + { + "Name": "host-ready-n", "ChipId": "2", "GpioNum": 66, "EventMon": "BOTH", "Targets": { - "RISING": ["deassert-post-end.service"], - "FALLING": ["assert-post-end.service"] + "RISING": ["deassert-post-end.service","deassert-gpio-log@host-ready-n.service"], + "FALLING": ["assert-post-end.service","assert-gpio-log@host-ready-n.service"] }, "Continue": true + }, + { + "Name": "leakage-detect-alert", + "ChipId": "0", + "GpioNum": 92, + "EventMon": "BOTH", + "Targets": { + "RISING": ["deassert-gpio-log@leakage-detect-alert.service"], + "FALLING": ["assert-gpio-log@leakage-detect-alert.service"] + }, + "Continue": true } -] +]
\ No newline at end of file diff --git a/meta-facebook/meta-harma/recipes-phosphor/gpio/phosphor-gpio-monitor_%.bbappend b/meta-facebook/meta-harma/recipes-phosphor/gpio/phosphor-gpio-monitor_%.bbappend index 6a8fe3f518..2eeee68c74 100644 --- a/meta-facebook/meta-harma/recipes-phosphor/gpio/phosphor-gpio-monitor_%.bbappend +++ b/meta-facebook/meta-harma/recipes-phosphor/gpio/phosphor-gpio-monitor_%.bbappend @@ -17,6 +17,9 @@ SRC_URI += "file://plat-phosphor-multi-gpio-monitor.json \ file://deassert-post-end \ file://assert-reset-button \ file://deassert-reset-button \ + file://assert-gpio-log@.service \ + file://deassert-gpio-log@.service \ + file://logging \ " RDEPENDS:${PN}:append = " bash" @@ -44,6 +47,7 @@ do_install:append:() { install -m 0644 ${WORKDIR}/*.service ${D}${systemd_system_unitdir}/ install -d ${D}${libexecdir}/${PN} + install -m 0755 ${WORKDIR}/logging ${D}${libexecdir}/${PN}/ install -m 0755 ${WORKDIR}/multi-gpios-sys-init ${D}${libexecdir}/${PN}/ install -m 0755 ${WORKDIR}/assert-reset-button ${D}${libexecdir}/${PN}/ |