linux/drivers/pci/controller/cadence/Kconfig
Aksh Garg 79752653c1 PCI: cadence: Fix host/endpoint dependencies for cadence-plat driver
The cadence-plat driver has a single platform driver that can be built-in
or a loadable module, but it calls two separate backend drivers depending
on whether it is a host or endpoint.

If one of the mode is build as built-in and another as loadable module,
we end up with a situation where the built-in pcie-cadence-plat driver
tries to call the modular host or endpoint driver, which causes a link
failure:

  ld: error: undefined symbol: cdns_pcie_ep_setup
  >>> referenced by pcie-cadence-plat.c
  >>>               drivers/pci/controller/cadence/pcie-cadence-plat.o:(cdns_plat_pcie_probe) in archive vmlinux.a

  ld: error: undefined symbol: cdns_pcie_host_setup
  >>> referenced by pcie-cadence-plat.c
  >>>               drivers/pci/controller/cadence/pcie-cadence-plat.o:(cdns_plat_pcie_probe) in archive vmlinux.a

Fix this by moving the 'select' of PCIE_CADENCE_HOST and PCIE_CADENCE_EP
from the individual PLAT_HOST/PLAT_EP symbols into the common PCIE_CADENCE_PLAT
symbol, conditioned on which backends (modes) are enabled.

Fixes: 611627a4e5 ("PCI: cadence: Add module support for platform controller driver")
Reported-by: Randy Dunlap <rdunlap@infradead.org>
Closes: https://lore.kernel.org/linux-next/589ea512-93c6-4e1c-83d7-ba45a0b35843@infradead.org/
Signed-off-by: Aksh Garg <a-garg7@ti.com>
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@oss.qualcomm.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Tested-by: Randy Dunlap <rdunlap@infradead.org>
Acked-by: Randy Dunlap <rdunlap@infradead.org>
Link: https://patch.msgid.link/20260805105014.3952686-1-a-garg7@ti.com
2026-08-06 12:41:49 -05:00

105 lines
2.9 KiB
Plaintext

# SPDX-License-Identifier: GPL-2.0
menu "Cadence-based PCIe controllers"
depends on PCI
config PCIE_CADENCE
tristate
config PCIE_CADENCE_DEBUGFS
bool "Cadence PCIe debugfs entries"
depends on DEBUG_FS
depends on PCIE_CADENCE_HOST || PCIE_CADENCE_EP
help
Say Y here to enable debugfs entries for the PCIe controller. These
entries provide various debug features related to the controller and
the LTSSM status of link can be displayed.
config PCIE_CADENCE_HOST
tristate
depends on OF
select IRQ_DOMAIN
select PCIE_CADENCE
config PCIE_CADENCE_EP
tristate
depends on OF
depends on PCI_ENDPOINT
select PCIE_CADENCE
config PCIE_CADENCE_PLAT
tristate
select PCIE_CADENCE_HOST if PCIE_CADENCE_PLAT_HOST != n
select PCIE_CADENCE_EP if PCIE_CADENCE_PLAT_EP != n
config PCIE_CADENCE_PLAT_HOST
tristate "Cadence platform PCIe controller (host mode)"
depends on OF
select PCIE_CADENCE_PLAT
help
Say Y here if you want to support the Cadence PCIe platform controller in
host mode. This PCIe controller may be embedded into many different
vendors SoCs.
config PCIE_CADENCE_PLAT_EP
tristate "Cadence platform PCIe controller (endpoint mode)"
depends on OF
depends on PCI_ENDPOINT
select PCIE_CADENCE_PLAT
help
Say Y here if you want to support the Cadence PCIe platform controller in
endpoint mode. This PCIe controller may be embedded into many
different vendors SoCs.
config PCI_SKY1_HOST
tristate "CIX SKY1 PCIe controller (host mode)"
depends on OF && (ARCH_CIX || COMPILE_TEST)
select PCIE_CADENCE_HOST
select PCI_ECAM
help
Say Y here if you want to support the CIX SKY1 PCIe platform
controller in host mode. CIX SKY1 PCIe controller uses Cadence
HPA (High Performance Architecture IP [Second generation of
Cadence PCIe IP])
This driver requires Cadence PCIe core infrastructure
(PCIE_CADENCE_HOST) and hardware platform adaptation layer
to function.
config PCIE_SG2042_HOST
tristate "Sophgo SG2042 PCIe controller (host mode)"
depends on OF && (ARCH_SOPHGO || COMPILE_TEST)
select PCIE_CADENCE_HOST
help
Say Y here if you want to support the Sophgo SG2042 PCIe platform
controller in host mode. Sophgo SG2042 PCIe controller uses Cadence
PCIe core.
config PCI_J721E
tristate
select PCIE_CADENCE_HOST if PCI_J721E_HOST != n
select PCIE_CADENCE_EP if PCI_J721E_EP != n
config PCI_J721E_HOST
tristate "TI J721E PCIe controller (host mode)"
depends on ARCH_K3 || COMPILE_TEST
depends on OF
select PCI_J721E
help
Say Y here if you want to support the TI J721E PCIe platform
controller in host mode. TI J721E PCIe controller uses Cadence PCIe
core.
config PCI_J721E_EP
tristate "TI J721E PCIe controller (endpoint mode)"
depends on ARCH_K3 || COMPILE_TEST
depends on OF
depends on PCI_ENDPOINT
select PCI_J721E
help
Say Y here if you want to support the TI J721E PCIe platform
controller in endpoint mode. TI J721E PCIe controller uses Cadence PCIe
core.
endmenu