summaryrefslogtreecommitdiff
path: root/drivers/pci
diff options
context:
space:
mode:
authorZhao Qiang <B45475@freescale.com>2015-03-26 16:13:09 +0800
committerYork Sun <yorksun@freescale.com>2015-05-04 09:24:16 -0700
commit5066e62847bddf6030262ade2aa3e7bcdc930037 (patch)
tree92d5aa42673b6b529453f3cec05fb8799bf9b039 /drivers/pci
parent373762c34cd33b4a445b758090daaa87ccfa3fc6 (diff)
downloadu-boot-imx-5066e62847bddf6030262ade2aa3e7bcdc930037.zip
u-boot-imx-5066e62847bddf6030262ade2aa3e7bcdc930037.tar.gz
u-boot-imx-5066e62847bddf6030262ade2aa3e7bcdc930037.tar.bz2
T2080QDS/PCIe: Soft Reset PCIe on T2080QDS for down-training issue
T2080QDS PEX1/Slot#1 will down-train from x4 to x2, with SRDS_PRTCL_S1 = 0x66 and SRDS_PRTCL_S2 = 0x15. Soft reset PCIe can fix this issue. Signed-off-by: Zhao Qiang <B45475@freescale.com> Reviewed-by: York Sun <yorksun@freescale.com>
Diffstat (limited to 'drivers/pci')
-rw-r--r--drivers/pci/fsl_pci_init.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/drivers/pci/fsl_pci_init.c b/drivers/pci/fsl_pci_init.c
index 231b075..152045e 100644
--- a/drivers/pci/fsl_pci_init.c
+++ b/drivers/pci/fsl_pci_init.c
@@ -444,6 +444,21 @@ void fsl_pci_init(struct pci_controller *hose, struct fsl_pci_info *pci_info)
ltssm = (in_be32(&pci->pex_csr0)
& PEX_CSR0_LTSSM_MASK) >> PEX_CSR0_LTSSM_SHIFT;
enabled = (ltssm == 0x11) ? 1 : 0;
+#ifdef CONFIG_FSL_PCIE_RESET
+ int i;
+ /* assert PCIe reset */
+ setbits_be32(&pci->pdb_stat, 0x08000000);
+ (void) in_be32(&pci->pdb_stat);
+ udelay(1000);
+ /* clear PCIe reset */
+ clrbits_be32(&pci->pdb_stat, 0x08000000);
+ 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);
+ }
+#endif
} else {
/* pci_hose_read_config_word(hose, dev, PCI_LTSSM, &ltssm); */
/* enabled = ltssm >= PCI_LTSSM_L0; */