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/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;