diff options
author | Brian King <brking@linux.vnet.ibm.com> | 2007-05-07 18:04:05 -0400 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2007-05-07 23:40:31 -0400 |
commit | 00c2ae35bd50664bcd841becc6efceef8aa5d074 (patch) | |
tree | 16a952d96cf7619ad235b1990231a147c51a8840 /arch | |
parent | 02bbc0f09c90cefdb2837605c96a66c5ce4ba2e1 (diff) |
[POWERPC] Add powerpc PCI-E reset API implementation
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>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/powerpc/platforms/pseries/eeh.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/arch/powerpc/platforms/pseries/eeh.c b/arch/powerpc/platforms/pseries/eeh.c index 48fbd442e9df..63e23062e982 100644 --- a/arch/powerpc/platforms/pseries/eeh.c +++ b/arch/powerpc/platforms/pseries/eeh.c | |||
@@ -580,6 +580,36 @@ rtas_pci_slot_reset(struct pci_dn *pdn, int state) | |||
580 | } | 580 | } |
581 | 581 | ||
582 | /** | 582 | /** |
583 | * pcibios_set_pcie_slot_reset - Set PCI-E reset state | ||
584 | * @dev: pci device struct | ||
585 | * @state: reset state to enter | ||
586 | * | ||
587 | * Return value: | ||
588 | * 0 if success | ||
589 | **/ | ||
590 | int pcibios_set_pcie_reset_state(struct pci_dev *dev, enum pcie_reset_state state) | ||
591 | { | ||
592 | struct device_node *dn = pci_device_to_OF_node(dev); | ||
593 | struct pci_dn *pdn = PCI_DN(dn); | ||
594 | |||
595 | switch (state) { | ||
596 | case pcie_deassert_reset: | ||
597 | rtas_pci_slot_reset(pdn, 0); | ||
598 | break; | ||
599 | case pcie_hot_reset: | ||
600 | rtas_pci_slot_reset(pdn, 1); | ||
601 | break; | ||
602 | case pcie_warm_reset: | ||
603 | rtas_pci_slot_reset(pdn, 3); | ||
604 | break; | ||
605 | default: | ||
606 | return -EINVAL; | ||
607 | }; | ||
608 | |||
609 | return 0; | ||
610 | } | ||
611 | |||
612 | /** | ||
583 | * rtas_set_slot_reset -- assert the pci #RST line for 1/4 second | 613 | * rtas_set_slot_reset -- assert the pci #RST line for 1/4 second |
584 | * @pdn: pci device node to be reset. | 614 | * @pdn: pci device node to be reset. |
585 | * | 615 | * |