Name Date Size #Lines LOC

..--

cold-redundancy/H--572341

example/H--3534

org/open_power/Witherspoon/H--402298

phosphor-chassis-power/H--

phosphor-power-sequencer/H--11,7758,127

phosphor-power-supply/H--11,6417,593

phosphor-regulators/H--43,40729,323

power-sequencer/H--2,5421,481

power-supply/H--2,0581,128

services/H--127102

subprojects/H--8560

test/H--1,016592

tools/H--4,4042,667

.clang-formatH A D01-Feb-20253.7 KiB137135

.clang-tidyH A D06-Dec-2024125 106

.clang-tidy-ignoreH A D21-Jul-2025230 76

.gitignoreH A D01-Apr-202479 76

.shellcheckHD13-Apr-20210

LICENSEH A D17-Jul-201711.1 KiB202169

OWNERSH A D09-Jan-20241.7 KiB5348

README.mdH A D20-Oct-20253.3 KiB9573

compatible_system_types_finder.cppH A D16-Aug-20242.8 KiB8960

compatible_system_types_finder.hppH A D01-Feb-20254.3 KiB12837

dbus_interfaces_finder.cppH A D01-Feb-20253.2 KiB10874

dbus_interfaces_finder.hppH A D16-Aug-20244.8 KiB15038

device.hppH A D10-May-20231.5 KiB8234

device_monitor.hppH A D05-Jun-20251.8 KiB7939

elog-errors.hppH A D05-Jun-202560.8 KiB2,3941,935

file_descriptor.hppH A D10-May-20232.8 KiB13555

format_utils.hppH A D07-Aug-20241.6 KiB6023

gpio.cppH A D20-May-20253.1 KiB12480

gpio.hppH A D13-Sep-20212.1 KiB11746

meson.buildH A D20-Oct-20256.4 KiB224200

meson.optionsH A D20-Oct-20252.6 KiB105100

names_values.hppH A D31-May-20232.2 KiB11251

pmbus.cppH A D16-Sep-202511.1 KiB403306

pmbus.hppH A D01-Feb-202513 KiB429134

temporary_file.cppH A D16-Aug-20242.6 KiB9649

temporary_file.hppH A D04-Jan-20243.1 KiB12735

temporary_subdirectory.cppH A D01-Feb-20252.3 KiB8242

temporary_subdirectory.hppH A D22-May-20243.6 KiB13236

types.hppH A D01-May-20231.7 KiB4033

utility.cppH A D04-Nov-20257 KiB250196

utility.hppH A D18-Jul-20258.7 KiB27491

README.md

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