aboutsummaryrefslogtreecommitdiff
path: root/platforms
diff options
context:
space:
mode:
authorSuraj Jitindar Singh <sjitindarsingh@gmail.com>2016-07-28 19:17:32 +1000
committerStewart Smith <stewart@linux.vnet.ibm.com>2016-08-26 19:43:10 +1000
commit90cd9104edd33a4a0869e38e2936f1468c7e58ea (patch)
tree9a40cd07bec5023cb24defaee6425947ed4d87f7 /platforms
parent50745d87972bfbf858e382c80920766356564ad0 (diff)
downloadskiboot-90cd9104edd33a4a0869e38e2936f1468c7e58ea.zip
skiboot-90cd9104edd33a4a0869e38e2936f1468c7e58ea.tar.gz
skiboot-90cd9104edd33a4a0869e38e2936f1468c7e58ea.tar.bz2
platforms/ibm-fsp: Use power_ctl bit when determining slot reset method
Previously the power_ctl bit provided by the VPD was unused, now that we are correctly assigning it we can use it when determining the slot reset method. The power_ctl bit is used to represent if power management is available. If power_ctl is set to true, then the I2C based external power management functionality will be populated on the PCI slot. Otherwise we will try to use the inband PERST as the fundamental reset, as before. While we are here we introduce a helper function to isolate the logic initialisation for the I2C based external power management, to improve readibility. Signed-off-by: Suraj Jitindar Singh <sjitindarsingh@gmail.com> Acked-by: Gavin Shan <gwshan@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'platforms')
-rw-r--r--platforms/ibm-fsp/firenze-pci.c45
1 files changed, 27 insertions, 18 deletions
diff --git a/platforms/ibm-fsp/firenze-pci.c b/platforms/ibm-fsp/firenze-pci.c
index b4a0e5a..4cc0284 100644
--- a/platforms/ibm-fsp/firenze-pci.c
+++ b/platforms/ibm-fsp/firenze-pci.c
@@ -832,27 +832,12 @@ static void firenze_pci_slot_fixup(struct pci_slot *slot,
}
}
-static void firenze_pci_slot_init(struct pci_slot *slot)
+static void firenze_pci_setup_power_mgt(struct pci_slot *slot,
+ struct firenze_pci_slot *plat_slot,
+ struct firenze_pci_slot_info *info)
{
- struct lxvpd_pci_slot *s = slot->data;
- struct firenze_pci_slot *plat_slot = slot->data;
- struct firenze_pci_slot_info *info = NULL;
- uint32_t vdid;
uint8_t buddy;
- int i;
-
- /* Search for PCI slot info */
- for (i = 0; i < ARRAY_SIZE(firenze_pci_slots); i++) {
- if (firenze_pci_slots[i].index == s->slot_index &&
- !strcmp(firenze_pci_slots[i].label, s->label)) {
- info = &firenze_pci_slots[i];
- break;
- }
- }
- if (!info)
- return;
- /* Search I2C bus for external power mgt */
buddy = info->buddy;
plat_slot->i2c_bus = firenze_pci_find_i2c_bus(info->chip_id,
info->master_id,
@@ -891,6 +876,30 @@ static void firenze_pci_slot_init(struct pci_slot *slot)
plat_slot->i2c_bus = NULL;
}
}
+}
+
+static void firenze_pci_slot_init(struct pci_slot *slot)
+{
+ struct lxvpd_pci_slot *s = slot->data;
+ struct firenze_pci_slot *plat_slot = slot->data;
+ struct firenze_pci_slot_info *info = NULL;
+ uint32_t vdid;
+ int i;
+
+ /* Search for PCI slot info */
+ for (i = 0; i < ARRAY_SIZE(firenze_pci_slots); i++) {
+ if (firenze_pci_slots[i].index == s->slot_index &&
+ !strcmp(firenze_pci_slots[i].label, s->label)) {
+ info = &firenze_pci_slots[i];
+ break;
+ }
+ }
+ if (!info)
+ return;
+
+ /* Search I2C bus for external power mgt */
+ if (slot->power_ctl)
+ firenze_pci_setup_power_mgt(slot, plat_slot, info);
/*
* If the slot has external power logic, to override the