Skip to content

Commit 2dbfa1e

Browse files
committed
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>
1 parent 9ec1651 commit 2dbfa1e

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

‎arch/sh/drivers/pci/pcie-sh7786.c‎

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,16 @@ static int phy_init(struct pci_channel *chan)
204204
return -ETIMEDOUT;
205205
}
206206

207+
static 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+
207217
static int pcie_init(struct sh7786_pcie_port *port)
208218
{
209219
struct pci_channel *chan = port->hose;
@@ -213,7 +223,7 @@ static int pcie_init(struct sh7786_pcie_port *port)
213223
int ret, i;
214224

215225
/* Begin initialization */
216-
pci_write_reg(chan, 0, SH4A_PCIETCTLR);
226+
pcie_reset(port);
217227

218228
/* Initialize as type1. */
219229
data = pci_read_reg(chan, SH4A_PCIEPCICONF3);

0 commit comments

Comments
 (0)