| commit | b7878e55662bafbf28581c5b3b677207195fb8b3 | [log] [tgz] |
|---|---|---|
| author | Faisal Awada <faisal@us.ibm.com> | Wed Nov 26 15:20:50 2025 -0600 |
| committer | Shawn McCarney <shawnmm@us.ibm.com> | Thu Jan 08 15:46:13 2026 +0000 |
| tree | f6dee3290b5c27444db7fda97cfe04d5ca1c642e | |
| parent | ebbeb63f5e051597b96b8d8a8ac615a5f162dc23 [diff] |
chassis-psu: Clear brownout,determine required PSU
Update logic so PowerSystemInputs status is set to good only when the
chassis power state is off. This update adds a check for powerState off
before setting the status to good, ensuring the brownout is properly
cleared.
Add logic to getRequiredPSUCount which calculates the minimum required
PSU count based on the model used and supported configurations.
Implements the Chassis::getRequiredPSUCount() to determines the
necessary number of power supplies by:
1. Collecting the model names of all present PSUs.
2. Checking if exactly one model is found (assuming all PSUs have same
model)
3. Looking up the corresponding configuration in `supportedConfigs` to
retrieve the required count.
4. Return 0 if no configuration loaded or no model.
Test:
The following tests were done in simulated environment and forced some
logic to execute certain part of the code:
- During brownout Validate PowerSystemInputs status set to good when
the chassis power state is off.
- Validate present PSU count meet the minimum PSU required in the
configuration.
Change-Id: I55fc7a62242a449f7d1c6d897a91bd5798b20964
Signed-off-by: Faisal Awada <faisal@us.ibm.com>
This repository contains applications for configuring and monitoring devices that deliver power to the system.
Actively-maintained applications:
Legacy applications:
To build all applications in this repository:
meson setup build ninja -C build
To clean the repository and remove all build output:
rm -rf build
You can specify meson options to customize the build process. For example, you can specify:
Several applications in this repository require a PSU JSON config to run. The JSON config file provides information for:
There is an example psu.json to describe the necessary configurations.
inventoryPMBusAccessType defines the pmbus access type, which tells the service which sysfs type to use to read the attributes. The possible values are:
/sys/bus/i2c/devices/3-0069//sys/bus/i2c/devices/3-0069/hwmon/hwmonX//sys/kernel/debug/pmbus/hwmonX//sys/kernel/debug/<driver>.<instance>//sys/kernel/debug/pmbus/hwmonX/cffps1/fruConfigs defines the mapping between the attribute file and the FRU inventory interface and property. The configuration example below indicates that the service will read part_number attribute file from a directory specified by the above pmbus access type, and assign to PartNumber property in xyz.openbmc_project.Inventory.Decorator.Asset interface.
"fruConfigs": [ { "propertyName": "PartNumber", "fileName": "part_number", "interface": "xyz.openbmc_project.Inventory.Decorator.Asset" } ]
psuDevices defines the kernel device dir for each PSU in inventory. The configuration example below indicates that powersupply0's device is located in /sys/bus/i2c/devices/3-0069.
"psuDevices": { "/xyz/openbmc_project/inventory/system/chassis/motherboard/powersupply0" : "/sys/bus/i2c/devices/3-0069", }