xref: /openbmc/phosphor-power/phosphor-power-sequencer/docs/internal_design.md (revision 7b7a5632c594d60f4620ca14379a766a56faf846)
1# Internal Design
2
3## Key classes
4
5- PowerInterface
6  - Defines the `org.openbmc.control.Power` D-Bus interface.
7  - The `state` property is set to power the chassis on or off. This contains
8    the desired power state.
9  - The `pgood` property contains the actual power state of the chassis.
10- PowerControl
11  - Created in `main()`. Handles the event loop.
12  - Sub-class of PowerInterface that provides a concrete implementation of the
13    `org.openbmc.control.Power` D-Bus interface.
14  - Finds and loads the JSON configuration file. This creates an instance of the
15    System class.
16  - Powers the chassis on and off using the `power-chassis-control` named GPIO.
17  - Monitors the chassis pgood status every 3 seconds using the
18    `power-chassis-good` named GPIO.
19  - Enforces a minimum power off time of 15 seconds from cold start and 25
20    seconds from power off.
21- System
22  - The computer system being controlled and monitored by the BMC.
23- Chassis
24  - A chassis within the system. Chassis are typically a physical enclosure that
25    contains system components such as CPUs, fans, power supplies, and PCIe
26    cards.
27- Rail
28  - A voltage rail that is enabled or monitored by the power sequencer device.
29- PowerSequencerDevice
30  - Abstract base class for a power sequencer device.
31  - Defines virtual methods that must be implemented by all child classes.
32- GPIOsOnlyDevice
33  - Sub-class of PowerSequencerDevice that only uses the named GPIOs and does
34    not otherwise communicate with the device.
35- StandardDevice
36  - Sub-class of PowerSequencerDevice that implements the standard pgood fault
37    detection algorithm.
38- PMBusDriverDevice
39  - Sub-class of StandardDevice for power sequencer devices that are bound to a
40    PMBus device driver.
41- UCD90xDevice
42  - Sub-class of PMBusDriverDevice for the UCD90X family of power sequencer
43    devices.
44- UCD90160Device
45  - Sub-class of UCD90xDevice representing a UCD90160 power sequencer device.
46- UCD90320Device
47  - Sub-class of UCD90xDevice representing a UCD90320 power sequencer device.
48- Services
49  - Abstract base class that provides an interface to system services like error
50    logging and the journal.
51- BMCServices
52  - Sub-class of Services with real implementation of methods.
53- MockServices
54  - Sub-class of Services with mock implementation of methods for automated
55    testing.
56