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