aboutsummaryrefslogtreecommitdiff
path: root/platforms
diff options
context:
space:
mode:
authorGavin Shan <gwshan@linux.vnet.ibm.com>2017-05-30 15:54:46 +1000
committerStewart Smith <stewart@linux.vnet.ibm.com>2017-06-16 14:38:46 +1000
commit8b5a7c05ac2da8449746687217e75e97fb469b18 (patch)
tree21710f00a00293defd47b3f6a859a09ad14938db /platforms
parent7133ba8dac984763fc952bcdd1632d1da9a28bce (diff)
downloadskiboot-8b5a7c05ac2da8449746687217e75e97fb469b18.zip
skiboot-8b5a7c05ac2da8449746687217e75e97fb469b18.tar.gz
skiboot-8b5a7c05ac2da8449746687217e75e97fb469b18.tar.bz2
core/pci: Use PCI slot's power facality in pci_enable_bridge()
The current implmentation has incorrect assumptions: there is always a PCI slot associated with root port and PCIe switch downstream port and all of them are capable to change its power state by register PCICAP_EXP_SLOTCTL. Firstly, there might not a PCI slot associated with the root port or PCIe switch downstream port. Secondly, the power isn't controlled by standard config register (PCICAP_EXP_SLOTCTL). There are I2C slave devices used to control the power states on Tuleta. In order to use the PCI slot's methods to manage the power states, this does: * Introduce PCI_SLOT_FLAG_ENFORCE, indicates the request operation is enforced to be applied. * pci_enable_bridge() is split into 3 functions: pci_bridge_power_on() to power it on; pci_enable_bridge() as a place holder and pci_bridge_wait_link() to wait the downstream link to come up. * In pci_bridge_power_on(), the PCI slot's specific power management methods are used if there is a PCI slot associated with the PCIe switch downstream port or root port. Signed-off-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.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/platforms/ibm-fsp/firenze-pci.c b/platforms/ibm-fsp/firenze-pci.c
index 3c193ed..5063399 100644
--- a/platforms/ibm-fsp/firenze-pci.c
+++ b/platforms/ibm-fsp/firenze-pci.c
@@ -656,7 +656,8 @@ static int64_t firenze_pci_slot_set_power_state(struct pci_slot *slot,
if (val != PCI_SLOT_POWER_OFF && val != PCI_SLOT_POWER_ON)
return OPAL_PARAMETER;
- if (slot->power_state == val)
+ if (!pci_slot_has_flags(slot, PCI_SLOT_FLAG_ENFORCE) &&
+ slot->power_state == val)
return OPAL_SUCCESS;
/* Update with the requested power state and bail immediately when
@@ -664,7 +665,8 @@ static int64_t firenze_pci_slot_set_power_state(struct pci_slot *slot,
* supply to the slot on and it guarentees the link state change
* events will be raised properly during surprise hot add/remove.
*/
- if (slot->surprise_pluggable) {
+ if (!pci_slot_has_flags(slot, PCI_SLOT_FLAG_ENFORCE) &&
+ slot->surprise_pluggable) {
slot->power_state = val;
return OPAL_SUCCESS;
}