pci: layerscape: Manage PCIe EP compatible string via Kconfig
authorPankaj Bansal <pankaj.bansal@nxp.com>
Sat, 30 Nov 2019 13:14:10 +0000 (13:14 +0000)
committerPriyanka Jain <priyanka.jain@nxp.com>
Thu, 2 Jan 2020 09:06:57 +0000 (14:36 +0530)
The ep node device tree name is governed by these bindings:
https://github.com/torvalds/linux/blob/master/Documentation/
devicetree/bindings/pci/layerscape-pci.txt#L24

As per above the ep compatible node contains platform name.
Therefore, define the ep node compatible as CONFIG to find the
pcie ep node in device tree during device tree fixup.

Signed-off-by: Pankaj Bansal <pankaj.bansal@nxp.com>
Signed-off-by: Priyanka Jain <priyanka.jain@nxp.com>
drivers/pci/Kconfig
drivers/pci/pcie_layerscape_fixup.c
drivers/pci/pcie_layerscape_gen4_fixup.c

index 3856f7d755b67a93e135edb5888ac99c8db68b6b..437cd9a055d85cc7dc17e6a5532f47be90cd6a97 100644 (file)
@@ -158,6 +158,15 @@ config FSL_PCIE_COMPAT
          This compatible is used to find pci controller node in Kernel DT
          to complete fixup.
 
+config FSL_PCIE_EP_COMPAT
+       string "PCIe EP compatible of Kernel DT"
+       depends on PCIE_LAYERSCAPE || PCIE_LAYERSCAPE_GEN4
+       default "fsl,lx2160a-pcie-ep" if ARCH_LX2160A
+       default "fsl,ls-pcie-ep"
+       help
+         This compatible is used to find pci controller ep node in Kernel DT
+         to complete fixup.
+
 config PCIE_INTEL_FPGA
        bool "Intel FPGA PCIe support"
        depends on DM_PCI
index 3d238403f16e6529804580492cc287fbc11c024a..27ef20d4c3d09476acc7ee780c3fbd2fda9df50c 100644 (file)
@@ -253,7 +253,7 @@ static void ft_pcie_ep_fix(void *blob, struct ls_pcie *pcie)
 {
        int off;
 
-       off = fdt_node_offset_by_compat_reg(blob, "fsl,ls-pcie-ep",
+       off = fdt_node_offset_by_compat_reg(blob, CONFIG_FSL_PCIE_EP_COMPAT,
                                            pcie->dbi_res.start);
        if (off < 0)
                return;
index b58ddd55cd331a94b73354a14555187259737b39..da9817159fdca8b67927c6bb424df95129aaf853 100644 (file)
@@ -191,7 +191,7 @@ static void ft_pcie_ep_layerscape_gen4_fix(void *blob, struct ls_pcie_g4 *pcie)
 {
        int off;
 
-       off = fdt_node_offset_by_compat_reg(blob, "fsl,lx2160a-pcie-ep",
+       off = fdt_node_offset_by_compat_reg(blob, CONFIG_FSL_PCIE_EP_COMPAT,
                                            pcie->ccsr_res.start);
 
        if (off < 0) {