1## Overview 2 3This repository contains applications for configuring and monitoring devices 4that deliver power to the system. 5 6* cold-redundancy: Application that makes power supplies work in Cold 7 Redundancy mode and rotates them at intervals. 8* [phosphor-power-sequencer](phosphor-power-sequencer/README.md): Applications 9 for configuring and monitoring power sequencer and related devices that 10 support JSON-driven configuration. 11* [phosphor-power-supply](phosphor-power-supply/README.md): Next generation 12 power supply monitoring application. 13* [phosphor-regulators](phosphor-regulators/README.md): JSON-driven application 14 that configures and monitors voltage regulators. 15* power-sequencer: A power sequencer monitoring application. 16* power-supply: Original power supply monitoring application. 17* tools/power-utils: Power supply utilities. 18 19 20## Build 21 22To build all applications in this repository: 23``` 24 meson build 25 ninja -C build 26``` 27 28To clean the repository and remove all build output: 29``` 30 rm -rf build 31``` 32 33You can specify [meson options](meson_options.txt) to customize the build 34process. For example, you can specify: 35* Which applications to build and install. 36* Application-specific configuration data, such as power sequencer type. 37* Whether to build tests. 38 39 40## Power Supply Monitor and Util JSON config 41 42Several applications in this repository require a PSU JSON config to run. 43The JSON config file provides information for: 44* Where to access the pmbus attributes 45* Which attribute file in pmbus maps to which property and interface in D-Bus 46* Which kernel device directory is used on which PSU 47 48There is an example [psu.json](example/psu.json) to describe the necessary 49configurations. 50 51* `inventoryPMBusAccessType` defines the pmbus access type, which tells the 52 service which sysfs type to use to read the attributes. 53 The possible values are: 54 * Base: The base dir, e.g. `/sys/bus/i2c/devices/3-0069/` 55 * Hwmon: The hwmon dir, e.g. `/sys/bus/i2c/devices/3-0069/hwmon/hwmonX/` 56 * Debug: The pmbus debug dir, e.g. `/sys/kernel/debug/pmbus/hwmonX/` 57 * DeviceDebug: The device debug dir, e.g. '/sys/kernel/debug/<driver>.<instance>/` 58 * HwmonDeviceDebug: The hwmon device debug dir, e.g. `/sys/kernel/debug/pmbus/hwmonX/cffps1/` 59* `fruConfigs` defines the mapping between the attribute file and the FRU 60 inventory interface and property. 61 The configuration example below indicates that the service will read 62 `part_number` attribute file from a directory specified by the above pmbus 63 access type, and assign to `PartNumber` property in 64 `xyz.openbmc_project.Inventory.Decorator.Asset` interface. 65 ``` 66 "fruConfigs": [ 67 { 68 "propertyName": "PartNumber", 69 "fileName": "part_number", 70 "interface": "xyz.openbmc_project.Inventory.Decorator.Asset" 71 } 72 ] 73 ``` 74* `psuDevices` defines the kernel device dir for each PSU in inventory. 75 The configuration example below indicates that `powersupply0`'s device is 76 located in `/sys/bus/i2c/devices/3-0069`. 77 ``` 78 "psuDevices": { 79 "/xyz/openbmc_project/inventory/system/chassis/motherboard/powersupply0" : "/sys/bus/i2c/devices/3-0069", 80 } 81 ``` 82