]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
[POWERPC] Add powerpc PCI-E reset API implementation
authorBrian King <brking@linux.vnet.ibm.com>
Mon, 7 May 2007 22:04:05 +0000 (08:04 +1000)
committerPaul Mackerras <paulus@samba.org>
Tue, 8 May 2007 03:40:31 +0000 (13:40 +1000)
Adds the pSeries platform implementation for a new PCI API
which can be used to issue various types of PCI-E reset,
including PCI-E warm reset and PCI-E hot reset. This is needed
for an ipr PCI-E adapter which does not properly implement BIST.
Running BIST on this adapter results in PCI-E errors. The only
reliable reset mechanism that exists on this hardware is PCI
Fundamental reset (warm reset).

Acked-by: Linas Vepstas <linas@austin.ibm.com>
Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
arch/powerpc/platforms/pseries/eeh.c

index 48fbd442e9dfbef36bcd26fcaac748fc42b0eb05..63e23062e98299d4c8f619769e1bff2d5b146013 100644 (file)
@@ -579,6 +579,36 @@ rtas_pci_slot_reset(struct pci_dn *pdn, int state)
                        rc, state, pdn->node->full_name);
 }
 
+/**
+ * pcibios_set_pcie_slot_reset - Set PCI-E reset state
+ * @dev:       pci device struct
+ * @state:     reset state to enter
+ *
+ * Return value:
+ *     0 if success
+ **/
+int pcibios_set_pcie_reset_state(struct pci_dev *dev, enum pcie_reset_state state)
+{
+       struct device_node *dn = pci_device_to_OF_node(dev);
+       struct pci_dn *pdn = PCI_DN(dn);
+
+       switch (state) {
+       case pcie_deassert_reset:
+               rtas_pci_slot_reset(pdn, 0);
+               break;
+       case pcie_hot_reset:
+               rtas_pci_slot_reset(pdn, 1);
+               break;
+       case pcie_warm_reset:
+               rtas_pci_slot_reset(pdn, 3);
+               break;
+       default:
+               return -EINVAL;
+       };
+
+       return 0;
+}
+
 /**
  * rtas_set_slot_reset -- assert the pci #RST line for 1/4 second
  * @pdn: pci device node to be reset.