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