History log of /openbmc/phosphor-power/tools/power-utils/aei_updater.cpp (Results 1 – 4 of 4)
Revision Date Author Comments
# 5ace9fb7 07-Jan-2025 Faisal Awada <faisal@us.ibm.com>

psutils: Add necessary firmware update functions

doUpdate: Adds the main logic for orchestrating the PSU firmware update
process, including ISP setup, firmware download, and verification.

performI2

psutils: Add necessary firmware update functions

doUpdate: Adds the main logic for orchestrating the PSU firmware update
process, including ISP setup, firmware download, and verification.

performI2cWriteReadWithRetries: Introduces functionality to perform I2C
write-read operations with configurable retries, and error handling for
robustness.

performI2cReadWrite: Provides the implementation for direct I2C
write-read operations with a customizable delay to ensure timing
requirements are met.

downloadPsuFirmware: Implements the functionality to read and process
PSU firmware in blocks, ensuring data integrity during transfer.

verifyDownloadFwStatus: Adds a mechanism to validate the success of
firmware downloads by checking the PSU's checksum status register.

getClassInstance: Add logic to dynamically instantiate updater class
based on PSU model.

Test:
Placed latest firmware and MANIFEST files in "/usr/share/obmc/51E9"
then retrieved the current PSU FW level. Ran "psutils" on the command
line as follow:
/usr/bin/psutils --update
/xyz/openbmc_project/inventory/system/chassis/motherboard/powersupply1
/usr/share/obmc/51E9

Retrieved the FW level and verified the PSU FW was updated as
expected.

Signed-off-by: Faisal Awada <faisal@us.ibm.com>
Change-Id: I65d0c015eab0322110e85b954a38590332aaa67a
Signed-off-by: Faisal Awada <faisal@us.ibm.com>

show more ...


# f0c0c47b 07-Dec-2024 Jayanth Othayoth <ojayanth@gmail.com>

clang-tidy: Suppress unused variable warnings

The following errors were reported during clang-tidy enablement due to
multiple unused variables. This temporary fix suppresses the warnings
using a pra

clang-tidy: Suppress unused variable warnings

The following errors were reported during clang-tidy enablement due to
multiple unused variables. This temporary fix suppresses the warnings
using a pragma approach until a permanent solution is
implemented.

Changes:
- Commented out unused variables to suppress the -Wunused-variable
warnings.

'''
../tools/power-utils/aei_updater.cpp:36:15: error: unused variable 'MEM_STRETCH_DELAY' [-Werror
../tools/power-utils/aei_updater.cpp:40:19: error: unused variable 'I2C_SMBUS_BLOCK_MAX' [-Werror
../tools/power-utils/aei_updater.cpp:41:19: error: unused variable 'FW_READ_BLOCK_SIZE' [-Werror
../tools/power-utils/aei_updater.cpp:43:19: error: unused variable 'READ_SEQ_ST_CML_SIZE' [-Werror
../tools/power-utils/aei_updater.cpp:45:19: error: unused variable 'START_SEQUENCE_INDEX' [-Werror
../tools/power-utils/aei_updater.cpp:46:19: error: unused variable 'STATUS_CML_INDEX' [-Werror
../tools/power-utils/aei_updater.cpp:63:19: error: unused variable 'B_CHKSUM_ERR' [-Werror
../tools/power-utils/aei_updater.cpp:64:19: error: unused variable 'B_CHKSUM_SUCCESS' [-Werror
../tools/power-utils/aei_updater.cpp:66:19: error: unused variable 'B_MEM_ERR' [-Werror
../tools/power-utils/aei_updater.cpp:67:19: error: unused variable 'B_ALIGN_ERR' [-Werror
../tools/power-utils/aei_updater.cpp:68:19: error: unused variable 'B_KEY_ERR' [-Werror
../tools/power-utils/aei_updater.cpp:69:19: error: unused variable 'B_START_ERR' [-Werror
../tools/power-utils/aei_updater.cpp:70:19: error: unused variable 'B_IMG_MISSMATCH_ERR' [-Werror
../tools/power-utils/aei_updater.cpp:73:19: error: unused variable 'B_ISP_MODE_CHKSUM_GOOD' [-Werror
../tools/power-utils/aei_updater.cpp:74:19: error: unused variable 'B_PRGM_BUSY' [-Werror
../tools/power-utils/aei_updater.cpp:35:15: error: unused variable 'MEM_WRITE_DELAY' [-Werror
'''

Tested: Build and unit testing verified.

Change-Id: Idbe50bfc465f12f0cf4fd7e382a6f04879f08dba
Signed-off-by: Jayanth Othayoth <ojayanth@gmail.com>

show more ...


# 8dca5075 23-Nov-2024 Faisal Awada <faisal@us.ibm.com>

psutils: Add new functions to AEI Updater class

The following functions handle the critical stages of firmware update,
including validation, reading, preparation, and reboot verification.
Error han

psutils: Add new functions to AEI Updater class

The following functions handle the critical stages of firmware update,
including validation, reading, preparation, and reboot verification.
Error handling and logging are incorporated to isolate issues during the
update.

getFirmwarePath()
Retrieves the firmware file path from the image directory. Uses
getFWFilenamePath to fetch the path. Logs an error if the firmware path
is not found and returns an empty string otherwise returns firmware
path.

isFirmwareFileValid()
Validates the firmware file at the given path using validateFWFile.
Ensure the firmware file exists and meets requirements before proceeding
with the update. Logs an error if validation fails.

openFirmwareFile()
Opens the firmware file at the specified path for reading in binary
mode. Logs an error if the file cannot be opened.

readFirmwareBlock()
Reads a block of data from the firmware file.Uses readFirmwareBytes to
read the specified number of bytes.

prepareCommandBlock()
Prepares a command block for writing firmware data to the PSU. Adds
metadata, data, and a CRC8 checksum. Packages firmware data in a format
suitable for I2C transmission.

ispReboot()
Sends a reboot command to the status register to apply new firmware.

ispReadRebootStatus()
Reads the reboot status from ISP, returns true for success otherwise
false.

Tested:
- Validated that the firmware path retrieves the correct file.
- A validation error is logged when the file is empty or path is
incorrect.
- Removed read permission on the firmware file and verified that an
error was logged.
- Verify the block of data read as specified in the specification.
- Printed the command block and verified that the command and data are
ready to be sent to the PSU via I2C.
- Downloaded the firmware and verified that the command block, ISP
reboot and reboot status are working as expected.

Change-Id: I097b4aeefc0967d5591b8fb6aefb3c600c9f77f8
Signed-off-by: Faisal Awada <faisal@us.ibm.com>

show more ...


# 5a582d3c 15-Nov-2024 Faisal Awada <faisal@us.ibm.com>

psutils: Partial AEI Updater class

The AeiUpdater class within the aeiUpdater namespace, responsible for
updating AEI PSU firmware via I2C communication. The code focuses on
executing various stage

psutils: Partial AEI Updater class

The AeiUpdater class within the aeiUpdater namespace, responsible for
updating AEI PSU firmware via I2C communication. The code focuses on
executing various stages of the firmware update process, ensuring each
step performed and validated correctly. The following partial functions
of the key component of the class:

doUpdate()
This method initiates the firmware update process. It checks and sets
the ISP (In-System Programming) mode using writeIspKey(),
writeIspMode(), and writeIspStatusReset().

writeIspKey()
Unlocks the ISP by writing a specific key to the KEY_REGISTER. Handles
exceptions for any I2C communication errors and logs the failure.

writeIspMode()
Sends a command to enter ISP mode and checks the status register.
Retries on failure, with a maximum retry limit. Checks the status
register to confirm the mode has been set. Logs any I2C errors
encountered.

writeIspStatusReset()
Resets ISP status register, clearing any existing status flags. Verifies
the reset by reading the status register, retrying as needed. Logs any
I2C errors encountered.

Test:
Tested the function listed in the class on a system with AEI PSU:

- Validated the PSU ISP key was accepted and no error logged.
- Validated an error was logged when I used wrong key.
- Validated the PSU entered to ISP mode by reading back status register
and confirmed the bit is set.
- Validated the PSU status reset by reading the back status register and
confirmed the bit is set.

Change-Id: I1e8e594f088e7d66d8fc5b1723c4bd33b08bd3f8
Signed-off-by: Faisal Awada <faisal@us.ibm.com>

show more ...