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>
diff --git a/tools/power-utils/meson.build b/tools/power-utils/meson.build
index 542eadb..82e06b6 100644
--- a/tools/power-utils/meson.build
+++ b/tools/power-utils/meson.build
@@ -2,6 +2,7 @@
'psutils',
'version.cpp',
'updater.cpp',
+ 'aei_updater.cpp',
'utils.cpp',
'model.cpp',
'main.cpp',