1928d1d9eSShawn McCarney## Overview 2d7b7c6aeSMatt Spinler 3928d1d9eSShawn McCarneyThis repository contains applications for configuring and monitoring devices 4928d1d9eSShawn McCarneythat deliver power to the system. 5928d1d9eSShawn McCarney 60dbce568SPatrick Williams- cold-redundancy: Application that makes power supplies work in Cold Redundancy 70dbce568SPatrick Williams mode and rotates them at intervals. 80dbce568SPatrick Williams- [phosphor-power-sequencer](phosphor-power-sequencer/README.md): Applications 91553cd9aSJim Wright for configuring and monitoring power sequencer and related devices that 101553cd9aSJim Wright support JSON-driven configuration. 110dbce568SPatrick Williams- [phosphor-power-supply](phosphor-power-supply/README.md): Next generation 12928d1d9eSShawn McCarney power supply monitoring application. 130dbce568SPatrick Williams- [phosphor-regulators](phosphor-regulators/README.md): JSON-driven application 14928d1d9eSShawn McCarney that configures and monitors voltage regulators. 150dbce568SPatrick Williams- power-sequencer: A power sequencer monitoring application. 160dbce568SPatrick Williams- power-supply: Original power supply monitoring application. 170dbce568SPatrick Williams- tools/power-utils: Power supply utilities. 18928d1d9eSShawn McCarney 19928d1d9eSShawn McCarney## Build 20928d1d9eSShawn McCarney 21928d1d9eSShawn McCarneyTo build all applications in this repository: 220dbce568SPatrick Williams 23d7b7c6aeSMatt Spinler``` 24*6b8aadb2SShawn McCarney meson setup build 25928d1d9eSShawn McCarney ninja -C build 26d7b7c6aeSMatt Spinler``` 27aff6548eSLei YU 28928d1d9eSShawn McCarneyTo clean the repository and remove all build output: 290dbce568SPatrick Williams 30928d1d9eSShawn McCarney``` 31928d1d9eSShawn McCarney rm -rf build 32928d1d9eSShawn McCarney``` 33928d1d9eSShawn McCarney 343b3ae8d0SGeorge LiuYou can specify [meson options](meson.options) to customize the build process. 353b3ae8d0SGeorge LiuFor example, you can specify: 36928d1d9eSShawn McCarney 370dbce568SPatrick Williams- Which applications to build and install. 380dbce568SPatrick Williams- Application-specific configuration data, such as power sequencer type. 390dbce568SPatrick Williams- Whether to build tests. 40928d1d9eSShawn McCarney 41aff6548eSLei YU## Power Supply Monitor and Util JSON config 42aff6548eSLei YU 430dbce568SPatrick WilliamsSeveral applications in this repository require a PSU JSON config to run. The 440dbce568SPatrick WilliamsJSON config file provides information for: 450dbce568SPatrick Williams 460dbce568SPatrick Williams- Where to access the pmbus attributes 470dbce568SPatrick Williams- Which attribute file in pmbus maps to which property and interface in D-Bus 480dbce568SPatrick Williams- Which kernel device directory is used on which PSU 49aff6548eSLei YU 50aff6548eSLei YUThere is an example [psu.json](example/psu.json) to describe the necessary 51aff6548eSLei YUconfigurations. 52aff6548eSLei YU 530dbce568SPatrick Williams- `inventoryPMBusAccessType` defines the pmbus access type, which tells the 540dbce568SPatrick Williams service which sysfs type to use to read the attributes. The possible values 550dbce568SPatrick Williams are: 560dbce568SPatrick Williams - Base: The base dir, e.g. `/sys/bus/i2c/devices/3-0069/` 570dbce568SPatrick Williams - Hwmon: The hwmon dir, e.g. `/sys/bus/i2c/devices/3-0069/hwmon/hwmonX/` 580dbce568SPatrick Williams - Debug: The pmbus debug dir, e.g. `/sys/kernel/debug/pmbus/hwmonX/` 590dbce568SPatrick Williams - DeviceDebug: The device debug dir, e.g. 600dbce568SPatrick Williams '/sys/kernel/debug/<driver>.<instance>/` 610dbce568SPatrick Williams - HwmonDeviceDebug: The hwmon device debug dir, e.g. 620dbce568SPatrick Williams `/sys/kernel/debug/pmbus/hwmonX/cffps1/` 630dbce568SPatrick Williams- `fruConfigs` defines the mapping between the attribute file and the FRU 640dbce568SPatrick Williams inventory interface and property. The configuration example below indicates 650dbce568SPatrick Williams that the service will read `part_number` attribute file from a directory 660dbce568SPatrick Williams specified by the above pmbus access type, and assign to `PartNumber` property 670dbce568SPatrick Williams in `xyz.openbmc_project.Inventory.Decorator.Asset` interface. 68aff6548eSLei YU ``` 69aff6548eSLei YU "fruConfigs": [ 70aff6548eSLei YU { 71aff6548eSLei YU "propertyName": "PartNumber", 72aff6548eSLei YU "fileName": "part_number", 73aff6548eSLei YU "interface": "xyz.openbmc_project.Inventory.Decorator.Asset" 74aff6548eSLei YU } 75aff6548eSLei YU ] 76aff6548eSLei YU ``` 770dbce568SPatrick Williams- `psuDevices` defines the kernel device dir for each PSU in inventory. The 780dbce568SPatrick Williams configuration example below indicates that `powersupply0`'s device is located 790dbce568SPatrick Williams in `/sys/bus/i2c/devices/3-0069`. 80aff6548eSLei YU ``` 81aff6548eSLei YU "psuDevices": { 82aff6548eSLei YU "/xyz/openbmc_project/inventory/system/chassis/motherboard/powersupply0" : "/sys/bus/i2c/devices/3-0069", 83aff6548eSLei YU } 84aff6548eSLei YU ``` 85