Skip to content

Commit

Permalink
Javaisland: check post complete status before updating the pldm retimer
Browse files Browse the repository at this point in the history
Summary:
The server needs to POST complete before updating the PLDM retimer in javaisland, therefore check the POST complete status before updating the PLDM retimer.

X-link: facebookexternal/openbmc.quanta#4376

Test Plan:
1. Build passed and update BMC on javaisland.
2. Update the retimer before/after POST complete.

Tested on javaisland:
```
root@bmc-oob:~# power-util slot1 cycle
Power cycling fru 1...
root@bmc-oob:~#
root@bmc-oob:~# kv get fru1_host_ready
0
root@bmc-oob:~# fw-util slot1 --update retimer /tmp/ds160pt801_08.pldm
The server must POST complete before updating the retimer
Upgrade of slot1 : retimer failed
root@bmc-oob:~#
root@bmc-oob:~# kv get fru1_host_ready
1
root@bmc-oob:~#
root@bmc-oob:~# fw-util slot1 --update retimer /tmp/ds160pt801_08.pldm
RequestUpdate Success.
PassComponentTable Success.
UpdateComponent Success.
Download offset : 0x00001340/0x0000134d, size : 0x00000020
TransferComplete.
VerifyComplete.
ApplyComplete.
ActivateFirmwareComplete.
Upgrade of slot1 : retimer succeeded
```

Reviewed By: amithash

Differential Revision: D59937538

fbshipit-source-id: 551f0be524fcf6683d40e09f0537491422ffd1d7
  • Loading branch information
kevintungquanta authored and facebook-github-bot committed Jul 19, 2024
1 parent d380bd1 commit befd008
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,21 @@ int PldmRetimerComponent::update_internal(string image, bool force) {
try {
server.ready();
uint8_t status;
char host_ready_value[8] = {0};
auto host_ready_key = fmt::format("fru{}_host_ready", slot_id);

if (pal_get_server_power(slot_id, &status)) {
throw string("Failed to get server power");
}
if (status != SERVER_POWER_ON) {
throw string("The server power is not turned on");
}
if (kv_get(host_ready_key.c_str(), host_ready_value, NULL, 0)) {
throw string("Failed to get POST complete status");
}
if (string(host_ready_value) != "1") {
throw string("The server must POST complete before updating the retimer");
}
} catch (const string& e) {
cerr << e << endl;
return FW_STATUS_FAILURE;
Expand Down

0 comments on commit befd008

Please sign in to comment.