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/configs/Barreleye.py b/configs/Barreleye.py
index e8e8d57..ac1902f 100644
--- a/configs/Barreleye.py
+++ b/configs/Barreleye.py
@@ -557,18 +557,30 @@
 	},
 }
 
-POWER_CONFIG = {
-    'power_good_in': 'PGOOD',
-    'power_up_outs': [
-        ('POWER_PIN', False),
-    ],
-    'reset_outs': [
-        ('USB_RESET', False),
-    ],
-    'pci_reset_outs': [
-        # net name, polarity, reset hold
-        ('PCIE_RESET', False, False),
-    ],
+GPIO_CONFIGS = {
+    'power_config' : {
+        'power_good_in' : 'PGOOD',
+        'power_up_outs' : [
+            ('POWER_PIN', False),
+        ],
+        'reset_outs' : [
+            ('USB_RESET', False),
+        ],
+        'pci_reset_outs': [
+            # net name, polarity, reset hold
+            ('PCIE_RESET', False, False),
+        ],
+    },
+    'hostctl_config' : {
+        'fsi_data' : 'FSI_DATA',
+        'fsi_clk' : 'FSI_CLK',
+        'fsi_enable' : 'FSI_ENABLE',
+        'cronus_sel' : 'CRONUS_SEL',
+        'optionals' : [
+            ('BMC_THROTTLE', True),
+            ('IDBTN', False),
+        ],
+    },
 }
 
 # Miscellaneous non-poll sensor with system specific properties.
diff --git a/configs/Firestone.py b/configs/Firestone.py
index 285c397..6c7c908 100644
--- a/configs/Firestone.py
+++ b/configs/Firestone.py
@@ -451,23 +451,35 @@
 }
 
 
-POWER_CONFIG = {
-    'power_good_in' : 'SYS_PWROK_BUFF',
-    'power_up_outs' : [
-        ('BMC_POWER_UP', True),
-    ],
-    'reset_outs' : [
-        ('CM1_OE_R_N', True),
-        ('BMC_CP0_RESET_N', False),
-        ('BMC_CFAM_RESET_N_R', False),
-    ],
-    'pci_reset_outs' : [
-        # net name, polarity, reset hold
-        # if 'reset hold' set to 'True', BMC will hold pci reset until host CPU ready to drive PCI
-        ('PEX8718_DEVICES_RESET_N', False, True),
-        ('CP0_DEVICES_RESET_N', False, True),
-        ('CP1_DEVICES_RESET_N', False, True),
-    ],
+GPIO_CONFIGS = {
+    'power_config' : {
+        'power_good_in' : 'SYS_PWROK_BUFF',
+        'power_up_outs' : [
+            ('BMC_POWER_UP', True),
+        ],
+        'reset_outs' : [
+            ('CM1_OE_R_N', True),
+            ('BMC_CP0_RESET_N', False),
+            ('BMC_CFAM_RESET_N_R', False),
+        ],
+        'pci_reset_outs': [
+            # net name, polarity, reset hold
+            # if 'reset hold' set to 'True', BMC will hold pci reset until host CPU ready to drive PCI
+            ('PEX8718_DEVICES_RESET_N', False, True),
+            ('CP0_DEVICES_RESET_N', False, True),
+            ('CP1_DEVICES_RESET_N', False, True),
+        ],
+    },
+    'hostctl_config' : {
+        'fsi_data' : 'FSI_DATA',
+        'fsi_clk' : 'FSI_CLK',
+        'fsi_enable' : 'FSI_ENABLE',
+        'cronus_sel' : 'CRONUS_SEL',
+        'optionals' : [
+            ('BMC_THROTTLE', True),
+            ('IDBTN', False),
+        ],
+    },
 }
 
 
diff --git a/configs/Garrison.py b/configs/Garrison.py
index aef0720..d108fc0 100644
--- a/configs/Garrison.py
+++ b/configs/Garrison.py
@@ -452,23 +452,35 @@
 }
 
 
-POWER_CONFIG = {
-    'power_good_in' : 'SYS_PWROK_BUFF',
-    'power_up_outs' : [
-        ('BMC_POWER_UP', True),
-    ],
-    'reset_outs' : [
-        ('CM1_OE_R_N', True),
-        ('BMC_CP0_RESET_N', False),
-        ('BMC_CFAM_RESET_N_R', False),
-    ],
-    'pci_reset_outs' : [
-        # net name, polarity, reset hold
-        # if 'reset hold' set to 'True', BMC will hold pci reset until host CPU ready to drive PCI
-        ('PEX8718_DEVICES_RESET_N', False, True),
-        ('CP0_DEVICES_RESET_N', False, True),
-        ('CP1_DEVICES_RESET_N', False, True),
-    ],
+GPIO_CONFIGS = {
+    'power_config' : {
+        'power_good_in' : 'SYS_PWROK_BUFF',
+        'power_up_outs' : [
+            ('BMC_POWER_UP', True),
+        ],
+        'reset_outs' : [
+            ('CM1_OE_R_N', True),
+            ('BMC_CP0_RESET_N', False),
+            ('BMC_CFAM_RESET_N_R', False),
+        ],
+        'pci_reset_outs': [
+            # net name, polarity, reset hold
+            # if 'reset hold' set to 'True', BMC will hold pci reset until host CPU ready to drive PCI
+            ('PEX8718_DEVICES_RESET_N', False, True),
+            ('CP0_DEVICES_RESET_N', False, True),
+            ('CP1_DEVICES_RESET_N', False, True),
+        ],
+    },
+    'hostctl_config' : {
+        'fsi_data' : 'FSI_DATA',
+        'fsi_clk' : 'FSI_CLK',
+        'fsi_enable' : 'FSI_ENABLE',
+        'cronus_sel' : 'CRONUS_SEL',
+        'optionals' : [
+            ('BMC_THROTTLE', True),
+            ('IDBTN', False),
+        ],
+    },
 }
 
 
diff --git a/configs/Palmetto.py b/configs/Palmetto.py
index 7ed578c..5ce94ae 100644
--- a/configs/Palmetto.py
+++ b/configs/Palmetto.py
@@ -130,18 +130,30 @@
 	}
 }
 
-POWER_CONFIG = {
-    'power_good_in': 'PGOOD',
-    'power_up_outs': [
-        ('POWER_PIN', False),
-    ],
-    'reset_outs': [
-        ('USB_RESET', False),
-    ],
-    'pci_reset_outs': [
-        # net name, polarity, reset hold
-        ('PCIE_RESET', False, False),
-    ],
+GPIO_CONFIGS = {
+    'power_config' : {
+        'power_good_in' : 'PGOOD',
+        'power_up_outs' : [
+            ('POWER_PIN', False),
+        ],
+        'reset_outs' : [
+            ('USB_RESET', False),
+        ],
+        'pci_reset_outs': [
+            # net name, polarity, reset hold
+            ('PCIE_RESET', False, False),
+        ],
+    },
+    'hostctl_config' : {
+        'fsi_data' : 'FSI_DATA',
+        'fsi_clk' : 'FSI_CLK',
+        'fsi_enable' : 'FSI_ENABLE',
+        'cronus_sel' : 'CRONUS_SEL',
+        'optionals' : [
+            ('BMC_THROTTLE', True),
+            ('IDBTN', False),
+        ],
+    },
 }
 
 # Miscellaneous non-poll sensor with system specific properties.
diff --git a/configs/Romulus.py b/configs/Romulus.py
index c474647..178fb8e 100644
--- a/configs/Romulus.py
+++ b/configs/Romulus.py
@@ -321,16 +321,26 @@
     },
 }
 
-POWER_CONFIG = {
-    'power_good_in' : 'SYS_PWROK_BUFF',
-    'power_up_outs' : [
-        ('SOFTWARE_PGOOD', True),
-        ('BMC_POWER_UP', True),
-    ],
-    'reset_outs' : [
-        ('BMC_CP0_RESET_N', False),
-        ('BMC_CP0_PERST_ENABLE_R', False),
-    ],
+GPIO_CONFIGS = {
+    'power_config' : {
+        'power_good_in' : 'SYS_PWROK_BUFF',
+        'power_up_outs' : [
+            ('SOFTWARE_PGOOD', True),
+            ('BMC_POWER_UP', True),
+        ],
+        'reset_outs' : [
+            ('BMC_CP0_RESET_N', False),
+            ('BMC_CP0_PERST_ENABLE_R', False),
+        ],
+    },
+    'hostctl_config' : {
+        'fsi_data' : 'FSI_DATA',
+        'fsi_clk' : 'FSI_CLK',
+        'fsi_enable' : 'FSI_ENABLE',
+        'cronus_sel' : 'CRONUS_SEL',
+        'optionals' : [
+        ],
+    },
 }
 
 # Miscellaneous non-poll sensor with system specific properties.
diff --git a/configs/Witherspoon.py b/configs/Witherspoon.py
index 1fe77d0..1c12b2a 100644
--- a/configs/Witherspoon.py
+++ b/configs/Witherspoon.py
@@ -451,20 +451,30 @@
 }
 
 
-POWER_CONFIG = {
-    'power_good_in': 'SYS_PWROK_BUFF',
-    'power_up_outs': [
-        ('SOFTWARE_PGOOD', True),
-        ('BMC_POWER_UP', True),
-    ],
-    'reset_outs': [
-        ('BMC_CP0_RESET_N', False),
-    ],
-    'pci_reset_outs': [
-        # net name, polarity, reset hold
-        ('BMC_VS1_PERST_N', False, False),
-        ('BMC_CP0_PERST_ENABLE_R', False, False),
-    ],
+GPIO_CONFIGS = {
+    'power_config' : {
+        'power_good_in' : 'SYS_PWROK_BUFF',
+        'power_up_outs' : [
+            ('SOFTWARE_PGOOD', True),
+            ('BMC_POWER_UP', True),
+        ],
+        'reset_outs' : [
+            ('BMC_CP0_RESET_N', False),
+        ],
+        'pci_reset_outs': [
+            # net name, polarity, reset hold
+            ('BMC_VS1_PERST_N', False, False),
+            ('BMC_CP0_PERST_ENABLE_R', False, False),
+        ],
+    },
+    'hostctl_config' : {
+        'fsi_data' : 'FSI_DATA',
+        'fsi_clk' : 'FSI_CLK',
+        'fsi_enable' : 'FSI_ENABLE',
+        'cronus_sel' : 'CRONUS_SEL',
+        'optionals' : [
+        ],
+    },
 }
 
 
diff --git a/configs/Zaius.py b/configs/Zaius.py
index 6b46f63..2ce380d 100644
--- a/configs/Zaius.py
+++ b/configs/Zaius.py
@@ -307,15 +307,25 @@
     },
 }
 
-POWER_CONFIG = {
-    'latch_out': 'BMC_UCD_LATCH_LE',
-    'power_good_in': 'SYS_PWROK_BUFF',
-    'power_up_outs': [
-        ('SOFTWARE_PGOOD', True),
-        ('BMC_POWER_UP', True),
-    ],
-    'reset_outs': [
-    ],
+GPIO_CONFIGS = {
+    'power_config' : {
+        'latch_out': 'BMC_UCD_LATCH_LE',
+        'power_good_in' : 'SYS_PWROK_BUFF',
+        'power_up_outs' : [
+            ('SOFTWARE_PGOOD', True),
+            ('BMC_POWER_UP', True),
+        ],
+        'reset_outs' : [
+        ],
+    },
+    'hostctl_config' : {
+        'fsi_data' : 'FSI_DATA',
+        'fsi_clk' : 'FSI_CLK',
+        'fsi_enable' : 'FSI_ENABLE',
+        'cronus_sel' : 'CRONUS_SEL',
+        'optionals' : [
+        ],
+    },
 }
 
 # Miscellaneous non-poll sensor with system specific properties.