xref: /openbmc/x86-power-control/README.md (revision c4b85b7732aa98bb06295ff9cf863fae9f1a707f)
1f61ca6fdSEd Tanous# X86 power control
2f61ca6fdSEd Tanous
3f61ca6fdSEd TanousThis repository contains an OpenBMC compliant implementation of power control
4abbcd4a5SPatrick Williamsfor x86 servers. It relies on a number of features to do its job. It has several
5abbcd4a5SPatrick Williamsintentional design goals.
6abbcd4a5SPatrick Williams
7f61ca6fdSEd Tanous1. The BMC should maintain the Host state machine internally, and be able to
8f61ca6fdSEd Tanous   track state changes.
9f61ca6fdSEd Tanous2. The implementation should either give the requested power control result, or
10f61ca6fdSEd Tanous   should log an error on the failure it detected.
11f61ca6fdSEd Tanous3. The BMC should support all the common operations, hard power on/off/cycle,
12f61ca6fdSEd Tanous   soft power on/off/cycle.
13f61ca6fdSEd Tanous
14809545a6SAndrei KartashevThis daemon has been successfully used on a variety of server platforms; it
15abbcd4a5SPatrick Williamsshould be able to support platforms with power control GPIOs similar to those in
16abbcd4a5SPatrick Williamsits config file.
17f61ca6fdSEd Tanous
18809545a6SAndrei Kartashevx86-power-control uses default json file (power-config-host0.json) for GPIO
19809545a6SAndrei Kartashevconfiguration. However this can be customized by producing your own
20809545a6SAndrei Kartashevpower-config-host0.json file.
217012051aSPriyatharshan P
22*c4b85b77SPatrick Williams## Signal Definitions
237012051aSPriyatharshan P
24*c4b85b77SPatrick WilliamsDefinitions can be configured by two type: GPIO and DBUS
25*c4b85b77SPatrick Williams
26*c4b85b77SPatrick Williams### GPIO
277012051aSPriyatharshan P
28abbcd4a5SPatrick WilliamsFor the platform having direct GPIO access can use the type GPIO and define like
29abbcd4a5SPatrick Williamsbelow.
307012051aSPriyatharshan P
31*c4b85b77SPatrick Williams```json
327012051aSPriyatharshan P{
337012051aSPriyatharshan P  "Name": "PostComplete",
347012051aSPriyatharshan P  "LineName": "POST_COMPLETE",
357012051aSPriyatharshan P  "Type": "GPIO"
36*c4b85b77SPatrick Williams}
37*c4b85b77SPatrick Williams```
387012051aSPriyatharshan P
39*c4b85b77SPatrick Williams### DBUS
407012051aSPriyatharshan P
41809545a6SAndrei KartashevFor the platform not having direct GPIO access can use dbus based event monitor
42809545a6SAndrei Kartashevby using the type DBUS.
437012051aSPriyatharshan P
44*c4b85b77SPatrick Williams```json
457012051aSPriyatharshan P{
467012051aSPriyatharshan P  "Name": "PowerButton",
477012051aSPriyatharshan P  "DbusName": "xyz.openbmc_project.Chassis.Event",
487012051aSPriyatharshan P  "Path": "/xyz/openbmc_project/Chassis/Event",
497012051aSPriyatharshan P  "Interface": "xyz.openbmc_project.Chassis.Event",
507012051aSPriyatharshan P  "Property": "PowerButton_Host1",
517012051aSPriyatharshan P  "Type": "DBUS"
52*c4b85b77SPatrick Williams}
53*c4b85b77SPatrick Williams```
547012051aSPriyatharshan P
55809545a6SAndrei Kartashevx86-power-control will monitor the property change from the given DbusName and
56abbcd4a5SPatrick Williamstake appropriate action. \*define Property as a bool variable.
57f61ca6fdSEd Tanous
58abbcd4a5SPatrick WilliamsCaveats: This implementation does not currently implement the common targets
59abbcd4a5SPatrick Williamsthat other implementations do. There were several attempts to, but all ended in
60abbcd4a5SPatrick Williamstiming issues and boot inconsistencies during stress operations.
61fb957331SJason M. Bills
62fb957331SJason M. Bills## Build Options
63fb957331SJason M. Bills
64*c4b85b77SPatrick Williams### chassis-system-reset
65abbcd4a5SPatrick Williams
66809545a6SAndrei KartashevEnable chassis system power reset to allow removing power and restoring back.
67809545a6SAndrei Kartashev
68*c4b85b77SPatrick Williams### use-plt-rst
69abbcd4a5SPatrick Williams
70809545a6SAndrei KartashevThe POST Complete GPIO is usually held asserted by BIOS after POST complete and
71809545a6SAndrei Kartashevde-asserts on reset. This de-assert behavior is currently used to detect warm
72809545a6SAndrei Kartashevresets.
73fb957331SJason M. Bills
74fb957331SJason M. BillsSome systems are adding support for a PLT_RST eSPI signal that can be used to
75809545a6SAndrei Kartashevmore accurately detect warm resets. When this option is enabled,
76809545a6SAndrei Kartashevx86-power-control will use PLT_RST to detect warm resets instead of POST
77809545a6SAndrei KartashevComplete.
78809545a6SAndrei Kartashev
79*c4b85b77SPatrick WilliamsSee <https://github.com/Intel-BMC/host-misc-comm-manager> for implementation
80809545a6SAndrei Kartashevexample.
81