Name Date Size #Lines LOC

..Today-

cold-redundancy/H04-Sep-2024-579347

example/H12-Dec-2022-3534

org/open_power/Witherspoon/H07-Mar-2021-400296

phosphor-power-sequencer/H09-Aug-2024-10,3327,294

phosphor-power-supply/H17-Aug-2024-6,7704,569

phosphor-regulators/H09-Aug-2024-38,85727,330

power-sequencer/H17-Aug-2024-2,5391,481

power-supply/H10-Dec-2024-2,0681,137

services/H16-May-2023-127102

subprojects/H11-Jul-2024-9166

test/H09-Aug-2024-971554

tools/H07-Mar-2021-3,3761,969

.clang-formatH A D17-Aug-20243.7 KiB137135

.gitignoreH A D10-Apr-202479 76

.shellcheckH A D19-Apr-20210

LICENSEH A D07-Mar-202111.1 KiB202169

OWNERSH A D11-Jan-20241.7 KiB5348

README.mdH A D09-Aug-20243.2 KiB9573

compatible_system_types_finder.cppH A D17-Aug-20242.8 KiB8960

compatible_system_types_finder.hppH A D09-Aug-20244.3 KiB12837

dbus_interfaces_finder.cppH A D17-Aug-20243.2 KiB10874

dbus_interfaces_finder.hppH A D17-Aug-20244.8 KiB15038

device.hppH A D11-May-20231.5 KiB8234

device_monitor.hppH A D13-Sep-20211.8 KiB8241

elog-errors.hppH A D17-Aug-202460.8 KiB2,3951,936

file_descriptor.hppH A D11-May-20232.8 KiB13555

format_utils.hppH A D09-Aug-20241.6 KiB6023

gpio.cppH A D07-Mar-20213.2 KiB12581

gpio.hppH A D13-Sep-20212.1 KiB11746

meson.buildH A D10-Dec-20245.8 KiB197174

meson.optionsH A D05-Dec-20232.1 KiB7570

names_values.hppH A D02-Jun-20232.2 KiB11251

pmbus.cppH A D17-Aug-202411.4 KiB418321

pmbus.hppH A D10-Dec-202412.9 KiB429134

temporary_file.cppH A D17-Aug-20242.6 KiB9649

temporary_file.hppH A D12-Jan-20243.1 KiB12735

temporary_subdirectory.cppH A D17-Aug-20242.3 KiB8242

temporary_subdirectory.hppH A D24-May-20243.6 KiB13236

types.hppH A D03-May-20231.7 KiB4033

utility.cppH A D17-Aug-20246.1 KiB222175

utility.hppH A D05-Jun-20247.4 KiB23686

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