Skip to content

Commit

Permalink
meta-ampere: Support chassis bootdev clear-cmos
Browse files Browse the repository at this point in the history
Implement the set/get the CMOS clear data 2 of the boot option
parameters boot flags(0x05).

Tested:
1. Set the clear-cmos to yes
   # ipmitool chassis bootdev none clear-cmos=yes
2. Get the bootparam 0x05
   # ipmitool chassis bootparam get 5
   Boot parameter version: 1
   Boot parameter 5 is valid/unlocked
   Boot parameter data: a080000000
    Boot Flags :
      - Boot Flag Valid
      - Options apply to only next boot
      - BIOS EFI boot
      - CMOS Clear
      - Boot Device Selector : No override
      - BIOS verbosity : System Default
      - Console Redirection control : Console redirection occurs per BIOS configuration setting (default)
      - BIOS Mux Control Override : BIOS uses recommended setting of the mux at the end of POST

Signed-off-by: Hieu Huynh <[email protected]>
  • Loading branch information
hieuhuynh-ampere authored and thangqn-ampere committed Sep 29, 2021
1 parent 5f13ee1 commit 1ec2e5d
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
From 1279ea34e9436eb7a33b8561eaf1dd9646de5a91 Mon Sep 17 00:00:00 2001
From: Hieu Huynh <[email protected]>
Date: Wed, 22 Sep 2021 05:55:46 +0000
Subject: [PATCH] Support chassis bootdev clear-cmos

Implement the set/get the CMOS clear data 2 of the boot option
parameters boot flags(0x05).

Signed-off-by: Hieu Huynh <[email protected]>
Change-Id: I6f9a4870036c7965fbfa9031661a411af27ab790
---
chassishandler.cpp | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/chassishandler.cpp b/chassishandler.cpp
index 580ccc0..25fb9d6 100644
--- a/chassishandler.cpp
+++ b/chassishandler.cpp
@@ -1676,6 +1676,7 @@ static constexpr uint8_t setComplete = 0x0;
static constexpr uint8_t setInProgress = 0x1;
static uint8_t transferStatus = setComplete;
static uint5_t bootInitiatorAckData = 0x0;
+static bool cmosClear = false;

/** @brief implements the Get Chassis system boot option
* @param bootOptionParameter - boot option parameter selector
@@ -1794,8 +1795,9 @@ ipmi::RspType<ipmi::message::Payload>
? setParmBootFlagsValidOneTime
: setParmBootFlagsValidPermanent;
response.pack(bootOptionParameter, reserved1, bootOptionParam,
- uint2_t{}, uint4_t{bootOption}, uint2_t{}, uint8_t{},
- uint8_t{}, uint8_t{});
+ uint2_t{}, uint4_t{bootOption}, uint1_t{},
+ uint1_t{cmosClear}, uint8_t{}, uint8_t{},
+ uint8_t{});
return ipmi::responseSuccess(std::move(response));
}
catch (InternalFailure& e)
@@ -1885,7 +1887,6 @@ ipmi::RspType<> ipmiChassisSetSysBootOptions(ipmi::Context::ptr ctx,
bool screenBlank;
uint4_t bootDeviceSelector;
bool lockKeyboard;
- bool cmosClear;
uint8_t data3;
uint4_t biosInfo;
uint4_t rsvd1;
--
2.25.1

Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ SRC_URI += "file://0001-mtjade-FRU-Updated-the-phosphor-host-ipmid-to-handle.pat
file://ampere.xyz.openbmc_project.Ipmi.Internal.SoftPowerOff.service \
file://0007-sensor-Response-thresholds-for-Get-SDR-command.patch \
file://0008-Change-revision-to-decimal-number.patch \
file://0009-Support-chassis-bootdev-clear-cmos.patch \
"

AMPERE_SOFTPOWEROFF_TMPL = "ampere.xyz.openbmc_project.Ipmi.Internal.SoftPowerOff.service"
Expand Down

0 comments on commit 1ec2e5d

Please sign in to comment.