| #
77c1c26f
|
| 02-Dec-2025 |
Shawn McCarney <shawnmm@us.ibm.com> |
pseq: Add open/close for devices
Add open and close methods for PowerSequencerDevice classes. Move any logic that acquires system resources from the constructor to the open() method. Release the sys
pseq: Add open/close for devices
Add open and close methods for PowerSequencerDevice classes. Move any logic that acquires system resources from the constructor to the open() method. Release the system resources in the close() method.
These methods are needed for several reasons: - The JSON configuration file will define the maximum number of chassis for a system type. If some chassis are missing, the associated power sequencer and named GPIOs are likely also missing. The constructor should not try to acquire system resources related to missing hardware since it will likely result in errors. - A chassis may be removed or lose input power. If that chassis later becomes available again, the C++ objects representing the underlying hardware resources may not be reusable in their current form. For example, libgpiod may have acquired a file handle that is no longer valid. So when a chassis becomes unavailable, the device should be closed and any associated resources should be released. If the chassis becomes available again, the device should be re-opened and the resources should be re-acquired.
Tested: * Ran automated tests * Verified open and close methods in simulation * Verified chassis power on and power off on hardware (regression test)
Change-Id: Ia2726d74252b4fa254b12e105daaeb961a047ee6 Signed-off-by: Shawn McCarney <shawnmm@us.ibm.com>
show more ...
|
| #
73944676
|
| 26-Nov-2025 |
Shawn McCarney <shawnmm@us.ibm.com> |
pseq: Move common code to BasicDevice class
Create a new sub-class of PowerSequencerDevice called BasicDevice that implements basic functionality.
BasicDevice implements the following: - Data membe
pseq: Move common code to BasicDevice class
Create a new sub-class of PowerSequencerDevice called BasicDevice that implements basic functionality.
BasicDevice implements the following: - Data members and methods for the power sequencer properties from the JSON configuration file. - Methods that utilize the named GPIOs, such as powerOn() and getPowerGood().
This functionality was previous duplicated in both StandardDevice and GPIOsOnlyDevice. Change both of those classes to inherit from BasicDevice.
Tested: * Ran automated tests
Change-Id: Id80e34dca0d2412ae10abe9962eca632d1909962 Signed-off-by: Shawn McCarney <shawnmm@us.ibm.com>
show more ...
|