@@ -266,6 +266,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 HAS_FEATURE_GIC64K_ALIGN
bool
default y if ARCH_LS1043A
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: GPL-2.0+
/*
- * Copyright 2017 NXP
+ * Copyright 2017-2019 NXP
* Copyright 2014-2015 Freescale Semiconductor, Inc.
* Layerscape PCIe driver
*/
@@ -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;
@@ -187,7 +187,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) {
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 of type string with default value independent of SOC name. This CONFIG can be asssigned correct value platform defconfig file. Signed-off-by: Pankaj Bansal <pankaj.bansal@nxp.com> --- arch/arm/cpu/armv8/fsl-layerscape/Kconfig | 9 +++++++++ drivers/pci/pcie_layerscape_fixup.c | 4 ++-- drivers/pci/pcie_layerscape_gen4_fixup.c | 2 +- 3 files changed, 12 insertions(+), 3 deletions(-)