system_manager, libobmc-intf: Add power GPIO configuration interface
This adds a dbus call (in org.openbmc.managers.System) and C binding (in
libopenbmc-intf) to read a POWER_CONFIG from the Python system
configuration that abstracts GPIO functionality (power good, reset, etc)
from their net names in GPIO_CONFIG.
This should eventually replace machine-specific patches to op-pwrctl
that define their own power and reset lines.
Change-Id: I56eaaf60ef852b68124e4a765942243ad17d06ac
Signed-off-by: Xo Wang <xow@google.com>
diff --git a/pysystemmgr/system_manager.py b/pysystemmgr/system_manager.py
index a26c325..5ecc14f 100644
--- a/pysystemmgr/system_manager.py
+++ b/pysystemmgr/system_manager.py
@@ -179,6 +179,16 @@
r = [obmc.enums.GPIO_DEV, gpio_num, gpio['direction']]
return r
+ @dbus.service.method(DBUS_NAME, in_signature='',
+ out_signature='sa(sb)a(sb)')
+ def getPowerConfiguration(self):
+ power_good_in = System.POWER_CONFIG.get('power_good_in', '')
+ power_up_outs = System.POWER_CONFIG.get('power_up_outs', [])
+ reset_outs = System.POWER_CONFIG.get('reset_outs', [])
+ r = [power_good_in, power_up_outs, reset_outs]
+ print "Power GPIO config: " + str(r)
+ return r
+
if __name__ == '__main__':
dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)