SBMR Get/Send Boot Progress Code support
Implement IPMI commands for boot progress codes by following
DEN0069E_SBMR_2.1. Add configure option `arm-sbmr` to enable
SBMR IPMI commands. Boot progress code will update to Redfish
BootProgress property.
1. Send boot progress code (NetFn 0x2C, Command 0x2)
2. Get boot progress code (NetFn 0x2C, Command 0x3)
Test:
1. Send boot progress code
$> ipmitool raw 0x2C 0x02 0xAE 0x1 0x00 0x00 0x00 \
0x01 0x10 0x01 0x02 0x00
ae
2. Get boot progress code
$> ipmitool raw 0x2C 0x3 0xAE
ae 01 00 00 00 01 10 01 02 00
3. Redfish BootProgess LastState - /redfish/v1/Systems/system
{
...
"BootProgress": {
"LastState": "PCIResourceConfigStarted",
"LastStateTime": "2024-11-14T19:14:22.432272+00:00"
}
}
Signed-off-by: John Chung <john.chung@arm.com>
Change-Id: I58e6e322006039fceb8d4212c4f9f6a4b4f9e225
diff --git a/include/ipmid/api-types.hpp b/include/ipmid/api-types.hpp
index 92432e0..52c68ee 100644
--- a/include/ipmid/api-types.hpp
+++ b/include/ipmid/api-types.hpp
@@ -31,6 +31,9 @@
constexpr Group groupDMTG = 0x01;
constexpr Group groupSSI = 0x02;
constexpr Group groupVSO = 0x03;
+#ifdef ARM_SBMR_SUPPORT
+constexpr Group groupSBMR = 0xAE;
+#endif
constexpr Group groupDCMI = 0xDC;
/*
@@ -327,6 +330,14 @@
constexpr Cmd cmdGetDcmiConfigParameters = 0x13;
} // namespace dcmi
+#ifdef ARM_SBMR_SUPPORT
+namespace sbmr
+{
+constexpr Cmd cmdSendBootProgressCode = 0x02;
+constexpr Cmd cmdGetBootProgressCode = 0x03;
+} // namespace sbmr
+#endif
+
// These are the command network functions, the response
// network functions are the function + 1. So to determine
// the proper network function which issued the command
diff --git a/include/ipmid/message.hpp b/include/ipmid/message.hpp
index 7a709e4..6698581 100644
--- a/include/ipmid/message.hpp
+++ b/include/ipmid/message.hpp
@@ -48,7 +48,7 @@
Privilege priv, int rqSA, int hostIdx,
boost::asio::yield_context& yield) :
bus(bus), netFn(netFn), lun(lun), cmd(cmd), channel(channel),
- userId(userId), sessionId(sessionId), priv(priv), rqSA(rqSA),
+ userId(userId), sessionId(sessionId), priv(priv), group(0), rqSA(rqSA),
hostIdx(hostIdx), yield(yield)
{}
@@ -61,6 +61,8 @@
int userId;
uint32_t sessionId;
Privilege priv;
+ // defining body code for netFnGroup
+ Group group;
// srcAddr is only set on IPMB requests because
// Platform Event Message needs it to determine the incoming format
int rqSA;
diff --git a/include/ipmid/types.hpp b/include/ipmid/types.hpp
index f7306e2..91ff346 100644
--- a/include/ipmid/types.hpp
+++ b/include/ipmid/types.hpp
@@ -19,12 +19,13 @@
using DbusProperty = std::string;
using Association = std::tuple<std::string, std::string, std::string>;
+using BootProgressCode = std::tuple<std::vector<uint8_t>, std::vector<uint8_t>>;
-using Value =
- std::variant<bool, uint8_t, int16_t, uint16_t, int32_t, uint32_t, int64_t,
- uint64_t, double, std::string, std::vector<uint8_t>,
- std::vector<uint16_t>, std::vector<uint32_t>,
- std::vector<std::string>, std::vector<Association>>;
+using Value = std::variant<bool, uint8_t, int16_t, uint16_t, int32_t, uint32_t,
+ int64_t, uint64_t, double, std::string,
+ std::vector<uint8_t>, std::vector<uint16_t>,
+ std::vector<uint32_t>, std::vector<std::string>,
+ std::vector<Association>, BootProgressCode>;
using PropertyMap = std::map<DbusProperty, Value>;