aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sh/drivers
diff options
context:
space:
mode:
authorPaul Mundt <lethal@linux-sh.org>2010-09-07 03:11:04 -0400
committerPaul Mundt <lethal@linux-sh.org>2010-09-07 03:11:04 -0400
commit2dbfa1e37dc703631d5421e0b04aecc5a7aff37d (patch)
tree3d6c8e064889bef673fa0c7f4ef021042ec62410 /arch/sh/drivers
parent9ec165166850930dc3079bfa39f4c1397abd7337 (diff)
sh: Make SH7786 PCIe port reset logic more aggressive.
This attempts a more complete port reset, building on top of the existing approach. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh/drivers')
-rw-r--r--arch/sh/drivers/pci/pcie-sh7786.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/arch/sh/drivers/pci/pcie-sh7786.c b/arch/sh/drivers/pci/pcie-sh7786.c
index 03e6d8217b0c..40b0ed042236 100644
--- a/arch/sh/drivers/pci/pcie-sh7786.c
+++ b/arch/sh/drivers/pci/pcie-sh7786.c
@@ -204,6 +204,16 @@ static int phy_init(struct pci_channel *chan)
204 return -ETIMEDOUT; 204 return -ETIMEDOUT;
205} 205}
206 206
207static void pcie_reset(struct sh7786_pcie_port *port)
208{
209 struct pci_channel *chan = port->hose;
210
211 pci_write_reg(chan, 1, SH4A_PCIESRSTR);
212 pci_write_reg(chan, 0, SH4A_PCIETCTLR);
213 pci_write_reg(chan, 0, SH4A_PCIESRSTR);
214 pci_write_reg(chan, 0, SH4A_PCIETXVC0SR);
215}
216
207static int pcie_init(struct sh7786_pcie_port *port) 217static int pcie_init(struct sh7786_pcie_port *port)
208{ 218{
209 struct pci_channel *chan = port->hose; 219 struct pci_channel *chan = port->hose;
@@ -213,7 +223,7 @@ static int pcie_init(struct sh7786_pcie_port *port)
213 int ret, i; 223 int ret, i;
214 224
215 /* Begin initialization */ 225 /* Begin initialization */
216 pci_write_reg(chan, 0, SH4A_PCIETCTLR); 226 pcie_reset(port);
217 227
218 /* Initialize as type1. */ 228 /* Initialize as type1. */
219 data = pci_read_reg(chan, SH4A_PCIEPCICONF3); 229 data = pci_read_reg(chan, SH4A_PCIEPCICONF3);