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