summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorWolfgang Denk <wd@denx.de>2007-12-27 00:35:03 +0100
committerWolfgang Denk <wd@denx.de>2007-12-27 00:35:03 +0100
commit3f523edb146c3dfbc52e7631b37e6f326e0e980d (patch)
tree8889ebbfef58c0fcddb8c0d168482df93e2f8af9 /drivers
parentbd878eb024bf9cb351c9ce66db63558de2d0e395 (diff)
parent8ff3de61fc5f9b3b21647bce081a3b7f710f0d4d (diff)
downloadu-boot-imx-3f523edb146c3dfbc52e7631b37e6f326e0e980d.zip
u-boot-imx-3f523edb146c3dfbc52e7631b37e6f326e0e980d.tar.gz
u-boot-imx-3f523edb146c3dfbc52e7631b37e6f326e0e980d.tar.bz2
Merge branch 'master' of git://www.denx.de/git/u-boot-mpc85xx
Diffstat (limited to 'drivers')
-rw-r--r--drivers/pci/fsl_pci_init.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/drivers/pci/fsl_pci_init.c b/drivers/pci/fsl_pci_init.c
index 1e77884..68e45e1 100644
--- a/drivers/pci/fsl_pci_init.c
+++ b/drivers/pci/fsl_pci_init.c
@@ -112,6 +112,29 @@ fsl_pci_init(struct pci_controller *hose)
pci_hose_read_config_word(hose, dev, PCI_LTSSM, &ltssm);
enabled = ltssm >= PCI_LTSSM_L0;
+#ifdef CONFIG_FSL_PCIE_RESET
+ if (ltssm == 1) {
+ int i;
+ debug("....PCIe link error. "
+ "LTSSM=0x%02x.", ltssm);
+ pci->pdb_stat |= 0x08000000; /* assert PCIe reset */
+ temp32 = pci->pdb_stat;
+ udelay(100);
+ debug(" Asserting PCIe reset @%x = %x\n",
+ &pci->pdb_stat, pci->pdb_stat);
+ pci->pdb_stat &= ~0x08000000; /* clear reset */
+ asm("sync;isync");
+ for (i=0; i<100 && ltssm < PCI_LTSSM_L0; i++) {
+ pci_hose_read_config_word(hose, dev, PCI_LTSSM,
+ &ltssm);
+ udelay(1000);
+ debug("....PCIe link error. "
+ "LTSSM=0x%02x.\n", ltssm);
+ }
+ enabled = ltssm >= PCI_LTSSM_L0;
+ }
+#endif
+
if (!enabled) {
debug("....PCIE link error. Skipping scan."
"LTSSM=0x%02x\n", ltssm);