From d50d6817b583d20bf1c6e26c656d125bde5e4e4b Mon Sep 17 00:00:00 2001 From: Sekhar Nori Date: Thu, 6 Dec 2018 15:40:08 +0530 Subject: spl: fix build failure with !CONFIG_SPL_PCI_SUPPORT Building U-Boot with CONFIG_PCI and CONFIG_DM_PCI enabled, but CONFIG_SPL_PCI_SUPPORT disabled, results in following linker error: lib/built-in.o: In function `fdtdec_get_pci_bar32': lib/fdtdec.c:305: undefined reference to `dm_pci_read_bar32' fdtdec.c:305:(.text.fdtdec_get_pci_bar32+0x24): relocation truncated to fit: R_AARCH64_CALL26 against undefined symbol `dm_pci_read_bar32' This is because reference to dm_pci_read_bar32() remains in lib/fdtdec.c while SPL build does not descend into drivers/pci directory in drivers/Makefile if CONFIG_SPL_PCI_SUPPORT is not enabled. Fix this by applying appropriate #define guards in lib/fdtdec.c. It looks like ns16550.c has the same problem, so fixed that too. To simplify this, CONFIG_SPL_PCI_SUPPORT is renamed to CONFIG_SPL_PCI (enables use of CONFIG_IS_ENABLED() macro). Suggested-by: Vignesh R Signed-off-by: Sekhar Nori Reviewed-by: Lokesh Vutla Reviewed-by: Tom Rini --- common/spl/Kconfig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'common') diff --git a/common/spl/Kconfig b/common/spl/Kconfig index cab7220..953841e 100644 --- a/common/spl/Kconfig +++ b/common/spl/Kconfig @@ -612,7 +612,7 @@ config SPL_PAYLOAD TPL, tpl/u-boot-with-tpl.bin. For new boards, suggest to use u-boot.img. -config SPL_PCI_SUPPORT +config SPL_PCI bool "Support PCI drivers" help Enable support for PCI in SPL. For platforms that need PCI to boot, @@ -1026,7 +1026,7 @@ config TPL_NAND_SUPPORT help Enable support for NAND in TPL. See SPL_NAND_SUPPORT for details. -config TPL_PCI_SUPPORT +config TPL_PCI bool "Support PCI drivers" help Enable support for PCI in TPL. For platforms that need PCI to boot, -- cgit v1.1