Support dimm loop detection for the AMD platform
Description:
- Support detection of the DIMM loop pattern for the AMD platform
Design:
- The ipmi handler netfn=0x38,cmd=0x33 handles BIC incoming
postcode and call the detection function to check if this
is the DIMM loop pattern of AMD platform and store those
patterns in an in-memory space.
Reference from Meta_BIOS_Requirement_Spec_v0.80
For AMD platform, the POST code looping pattern format should be:
(each group has 4 bytes)
●Group #0: [DDEE0000]
●Group #1: [DDEE] + Total Error Count
●Group #2: [DDEE] + Number of Error DIMM
●Group #3: [DDEE] + Dimm location
●Group #4: [DDEE] + major code
●Group #5: [DDEE] + minor code
Change-Id: I9598f71775936cea9a860a091bc74aefea8701f3
Signed-off-by: Delphine CC Chiu <Delphine_CC_Chiu@wiwynn.com>
diff --git a/include/biccommands.hpp b/include/biccommands.hpp
index dfce3a4..8466692 100644
--- a/include/biccommands.hpp
+++ b/include/biccommands.hpp
@@ -1,3 +1,5 @@
+#include <phosphor-logging/lg2.hpp>
+
#include <cstdint>
enum class fb_bic_cmds : uint8_t
@@ -8,6 +10,7 @@
CMD_OEM_SET_HOST_POWER_STATE = 0x0C,
CMD_OEM_GET_FLASH_SIZE = 0x19,
CMD_OEM_CLEAR_CMOS = 0x25,
+ CMD_OEM_1S_4BYTE_POST_BUF = 0x33,
};
// Flash size response length
diff --git a/include/types.hpp b/include/types.hpp
new file mode 100644
index 0000000..f6c0076
--- /dev/null
+++ b/include/types.hpp
@@ -0,0 +1,24 @@
+#pragma once
+
+#include <iostream>
+#include <variant>
+#include <vector>
+
+namespace ipmi
+{
+
+constexpr size_t amdFourBytesPostCode = 4;
+
+namespace dimm
+{
+using hostId = size_t;
+struct dimmLoop
+{
+ size_t totalErrorCount;
+ bool gotPattern; // It gets the whole pattern success.
+ bool startDetect; // Dimm loop detection to use. After getting the anchor
+ // tag start to detected.
+ std::vector<std::vector<uint8_t>> postCode;
+};
+} // namespace dimm
+} // namespace ipmi