pfr-manager: update pfr cpld error codes
Add support to update the cpld error codes in new platform.
Remove the IBB and OBB watchdog expired events as they are no longer
reported from CPLD.
Tested:
Update BMC firmware with mismatched SVN.
POST: https://<BMC_IP>/redfish/v1/UpdateService/
with <BMC_Update_Capsule> binary file
Update failed and event log received.
Command: GET: https://<BMC_IP>/redfish/v1/Systems/system/LogServices/
EventLog/Entries
Response:
{
"@odata.id": "/redfish/v1/Systems/system/LogServices/
EventLog/Entries/1621435142_1",
"@odata.type": "#LogEntry.v1_4_0.LogEntry",
"Created": "2021-05-19T14:39:02+00:00",
"EntryType": "Event",
"Id": "1621435142_1",
"Message": "Firmware resiliency error. Error reason:
Firmware update failed(MinorCode:0x02).",
"MessageArgs": [
"Firmware update failed(MinorCode:0x02)"
],
"MessageId": "OpenBMC.0.1.FirmwareResiliencyError",
"Name": "System Event Log Entry",
"Severity": "Critical"
},
Signed-off-by: Chalapathi Venkataramashetty <chalapathix.venkataramashetty@intel.com>
Change-Id: I406cb50695bd77b1beddb0788677af3657dca334
diff --git a/libpfr/inc/pfr.hpp b/libpfr/inc/pfr.hpp
index d088f4e..6dbf455 100644
--- a/libpfr/inc/pfr.hpp
+++ b/libpfr/inc/pfr.hpp
@@ -43,7 +43,8 @@
panicCount,
panicReason,
majorError,
- minorError
+ minorError,
+ readRoTRev
};
std::string toHexString(const uint8_t val);
diff --git a/libpfr/src/pfr.cpp b/libpfr/src/pfr.cpp
index 36f0113..abced98 100644
--- a/libpfr/src/pfr.cpp
+++ b/libpfr/src/pfr.cpp
@@ -491,6 +491,9 @@
switch (action)
{
+ case (ActionType::readRoTRev):
+ cpldReg = cpldROTVersion;
+ break;
case (ActionType::recoveryCount):
cpldReg = recoveryCount;
break;
diff --git a/service/inc/pfr_mgr.hpp b/service/inc/pfr_mgr.hpp
index 6f55eb9..c8211d4 100644
--- a/service/inc/pfr_mgr.hpp
+++ b/service/inc/pfr_mgr.hpp
@@ -84,4 +84,11 @@
bool ufmSupport;
};
+// Firmware resiliency major map.
+// {<CPLD association>, {<Redfish MessageID>, <Error reason> })
+static const boost::container::flat_map<uint8_t,
+ std::pair<std::string, std::string>>
+ majorErrorCodeMapRev2 = {
+ {0x03, {"FirmwareResiliencyError", "Firmware update failed"}}};
+
} // namespace pfr
diff --git a/service/src/mainapp.cpp b/service/src/mainapp.cpp
index bf6cbef..8a91dab 100644
--- a/service/src/mainapp.cpp
+++ b/service/src/mainapp.cpp
@@ -90,8 +90,6 @@
{0x04, {"BMCFirmwarePanicReason", "BMC watchdog expired"}},
{0x05, {"MEFirmwarePanicReason", "ME watchdog expired"}},
{0x06, {"BIOSFirmwarePanicReason", "ACM watchdog expired"}},
- {0x07, {"BIOSFirmwarePanicReason", "IBB watchdog expired"}},
- {0x08, {"BIOSFirmwarePanicReason", "OBB watchdog expired"}},
{0x09,
{"BIOSFirmwarePanicReason",
"ACM or IBB or OBB authentication failure"}}};
@@ -168,8 +166,27 @@
static void logResiliencyErrorEvent(const uint8_t majorErrorCode,
const uint8_t minorErrorCode)
{
+ uint8_t cpldRoTRev = 0;
+ if (0 != readCpldReg(ActionType::readRoTRev, cpldRoTRev))
+ {
+ return;
+ }
+
auto it = majorErrorCodeMap.find(majorErrorCode);
- if (it == majorErrorCodeMap.end())
+ if (cpldRoTRev == 0x02)
+ {
+ auto itRev2 = majorErrorCodeMapRev2.find(majorErrorCode);
+ if (itRev2 != majorErrorCodeMapRev2.end())
+ {
+ it = itRev2;
+ }
+ else if (it == majorErrorCodeMap.end())
+ {
+ // No matching found. So just return without logging event.
+ return;
+ }
+ }
+ else if (it == majorErrorCodeMap.end())
{
// No matching found. So just return without logging event.
return;