GPIO abstraction for power and host control
In libopenbmc_intf/power_gpio.c there are GPIO abstractions for power
related GPIOs.
Host control related GPIOs need to do the same abstraction.
The changes include:
1. Add host control related GPIOs in gpio_configs and update
system_manager.py
2. Update control_host_obj.c to use the abstracted GPIOs
3. Update GPIO_CONFIGS for all machines and add host control related
GPIOs
power_gpio will be renamed to gpio_configs in next commit;
Resolves openbmc/openbmc#814
Change-Id: I7832065d495d7d64c5df2f5b177005b97e68900a
Signed-off-by: Lei YU <mine260309@gmail.com>
diff --git a/pysystemmgr/system_manager.py b/pysystemmgr/system_manager.py
index 5152ff2..d145e74 100644
--- a/pysystemmgr/system_manager.py
+++ b/pysystemmgr/system_manager.py
@@ -184,14 +184,22 @@
return r
@dbus.service.method(DBUS_NAME, in_signature='',
- out_signature='ssa(sb)a(sb)a(sbb)')
- def getPowerConfiguration(self):
- power_good_in = System.POWER_CONFIG.get('power_good_in', '')
- latch_out = System.POWER_CONFIG.get('latch_out', '')
- power_up_outs = System.POWER_CONFIG.get('power_up_outs', [])
- reset_outs = System.POWER_CONFIG.get('reset_outs', [])
- pci_reset_outs = System.POWER_CONFIG.get('pci_reset_outs', [])
- r = [power_good_in, latch_out, power_up_outs, reset_outs, pci_reset_outs]
+ out_signature='ssa(sb)a(sb)a(sbb)ssssa(sb)')
+ def getGpioConfiguration(self):
+ power_config = System.GPIO_CONFIGS.get('power_config', {})
+ power_good_in = power_config.get('power_good_in', '')
+ latch_out = power_config.get('latch_out', '')
+ power_up_outs = power_config.get('power_up_outs', [])
+ reset_outs = power_config.get('reset_outs', [])
+ pci_reset_outs = System.GPIO_CONFIGS.get('pci_reset_outs', [])
+ hostctl_config = System.GPIO_CONFIGS.get('hostctl_config', {})
+ fsi_data = hostctl_config.get('fsi_data', '')
+ fsi_clk = hostctl_config.get('fsi_clk', '')
+ fsi_enable = hostctl_config.get('fsi_enable', '')
+ cronus_sel = hostctl_config.get('cronus_sel', '')
+ optionals = hostctl_config.get('optionals', [])
+ r = [power_good_in, latch_out, power_up_outs, reset_outs, pci_reset_outs,\
+ fsi_data, fsi_clk, fsi_enable, cronus_sel, optionals]
print "Power GPIO config: " + str(r)
return r