support BMC boot flag valid bit clearing
Set/Get system boot options commands don't support
BMC boot flag valid bit clearing, add it.
Tested: it test by ipmi commands:
set BIOS boot option with parameter 3
ipmitool raw 0x00 0x08 0x03 xx
get boot option with parameter 3
ipmitool raw 0x00 0x09 0x03 0 0
for example:
ipmitool raw 0x00 0x08 0x03 2
no response, without error response
ipmitool raw 0x00 0x09 0x03 0 0
01 03 02
the third response datum is the value by setting boot option.
Change-Id: I7db3c7d9f52b107b5b07d94fe58f3c7ada761460
Signed-off-by: Chen Yugang <yugang.chen@linux.intel.com>
diff --git a/chassishandler.cpp b/chassishandler.cpp
index a4e98f8..fb3d644 100644
--- a/chassishandler.cpp
+++ b/chassishandler.cpp
@@ -1711,6 +1711,7 @@
static constexpr uint8_t setComplete = 0x0;
static constexpr uint8_t setInProgress = 0x1;
static uint8_t transferStatus = setComplete;
+static uint8_t bootFlagValidBitClr = 0;
/** @brief implements the Get Chassis system boot option
* @param ctx - context pointer
@@ -1764,6 +1765,14 @@
return ipmi::responseSuccess(std::move(response));
}
+ if (types::enum_cast<BootOptionParameter>(bootOptionParameter) ==
+ BootOptionParameter::bootFlagValidClr)
+ {
+ response.pack(bootOptionParameter, reserved1,
+ uint5_t{bootFlagValidBitClr}, uint3_t{});
+ return ipmi::responseSuccess(std::move(response));
+ }
+
/*
* Parameter #5 means boot flags. Please refer to 28.13 of ipmi doc.
* This is the only parameter used by petitboot.
@@ -2100,6 +2109,28 @@
data.trailingOk = true;
return ipmi::responseSuccess();
}
+ else if (types::enum_cast<BootOptionParameter>(parameterSelector) ==
+ BootOptionParameter::bootFlagValidClr)
+ {
+ uint5_t bootFlagValidClr;
+ uint3_t rsvd;
+
+ if (data.unpack(bootFlagValidClr, rsvd) != 0 || !data.fullyUnpacked())
+ {
+ return ipmi::responseReqDataLenInvalid();
+ }
+ if (rsvd)
+ {
+ return ipmi::responseInvalidFieldRequest();
+ }
+ // store boot flag valid bits clear value
+ bootFlagValidBitClr = static_cast<uint8_t>(bootFlagValidClr);
+ log<level::INFO>(
+ "ipmiChassisSetSysBootOptions: bootFlagValidBits parameter set "
+ "successfully",
+ entry("value=0x%x", bootFlagValidBitClr));
+ return ipmi::responseSuccess();
+ }
else
{
if ((parameterSelector >= static_cast<uint7_t>(oemParmStart)) &&
diff --git a/chassishandler.hpp b/chassishandler.hpp
index 4d7d450..2957127 100644
--- a/chassishandler.hpp
+++ b/chassishandler.hpp
@@ -48,6 +48,7 @@
enum class BootOptionParameter : size_t
{
setInProgress = 0x0,
+ bootFlagValidClr = 0x3,
bootInfo = 0x4,
bootFlags = 0x5,
opalNetworkSettings = 0x61