pci: layerscape-ep: Add check of the PCIe controller enablement
authorHou Zhiqiang <Zhiqiang.Hou@nxp.com>
Thu, 13 May 2021 06:32:09 +0000 (14:32 +0800)
committerPriyanka Jain <priyanka.jain@nxp.com>
Fri, 14 May 2021 09:21:33 +0000 (14:51 +0530)
Stop to initialize the PCIe controller if it's disabled by RCW.

Fixes: 118e58e26eba ("pci: layerscape: Split the EP and RC driver")
Signed-off-by: Hou Zhiqiang <Zhiqiang.Hou@nxp.com>
drivers/pci/pcie_layerscape_ep.c

index c723163..cf77d9f 100644 (file)
@@ -1,6 +1,6 @@
 // SPDX-License-Identifier: GPL-2.0+
 /*
- * Copyright 2020 NXP
+ * Copyright 2020-2021 NXP
  * Layerscape PCIe EP driver
  */
 
@@ -269,6 +269,10 @@ static int ls_pcie_ep_probe(struct udevice *dev)
        pcie->idx = ((unsigned long)pcie->dbi - PCIE_SYS_BASE_ADDR) /
                    PCIE_CCSR_SIZE;
 
+       /* This controller is disabled by RCW */
+       if (!is_serdes_configured(PCIE_SRDS_PRTCL(pcie->idx)))
+               return 0;
+
        pcie->big_endian = fdtdec_get_bool(gd->fdt_blob, dev_of_offset(dev),
                                           "big-endian");