summaryrefslogtreecommitdiff
path: root/lib/fdtdec.c
diff options
context:
space:
mode:
authorSekhar Nori <nsekhar@ti.com>2018-12-06 13:10:08 +0300
committerTom Rini <trini@konsulko.com>2018-12-12 20:14:23 +0300
commitd50d6817b583d20bf1c6e26c656d125bde5e4e4b (patch)
tree550ddec7d8ac60e8f215c45c3ccba989e176698e /lib/fdtdec.c
parenta6f6939e87c7d70f4844a73bc115caaf9c0a19e0 (diff)
downloadu-boot-d50d6817b583d20bf1c6e26c656d125bde5e4e4b.tar.xz
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 <vigneshr@ti.com> Signed-off-by: Sekhar Nori <nsekhar@ti.com> Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com> Reviewed-by: Tom Rini <trini@konsulko.com>
Diffstat (limited to 'lib/fdtdec.c')
-rw-r--r--lib/fdtdec.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/fdtdec.c b/lib/fdtdec.c
index 7bbc6d445e..6f8ec0dbed 100644
--- a/lib/fdtdec.c
+++ b/lib/fdtdec.c
@@ -200,7 +200,7 @@ fdt_addr_t fdtdec_get_addr(const void *blob, int node, const char *prop_name)
return fdtdec_get_addr_size(blob, node, prop_name, NULL);
}
-#if defined(CONFIG_PCI) && defined(CONFIG_DM_PCI)
+#if CONFIG_IS_ENABLED(PCI) && defined(CONFIG_DM_PCI)
int fdtdec_get_pci_addr(const void *blob, int node, enum fdt_pci_space type,
const char *prop_name, struct fdt_pci_addr *addr)
{