spl: fix build failure with !CONFIG_SPL_PCI_SUPPORT
Subsystems (2)
PATCH 1/1 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).
--- Makefile | 1 - common/spl/Kconfig | 4 ++-- configs/chromebook_link64_defconfig | 2 +- configs/qemu-x86_64_defconfig | 2 +- drivers/Makefile | 2 +- drivers/serial/ns16550.c | 2 +- lib/fdtdec.c | 2 +- 7 files changed, 7 insertions(+), 8 deletions(-)
Makefile +0 -1
@@ -695,7 +695,6 @@ libs-$(CONFIG_CMD_UBI) += drivers/mtd/ubi/ libs-y += drivers/mtd/spi/ libs-y += drivers/net/ libs-y += drivers/net/phy/ -libs-y += drivers/pci/ libs-y += drivers/power/ \ drivers/power/domain/ \ drivers/power/fuel_gauge/ \
common/spl/Kconfig +2 -2
@@ -610,7 +610,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,
@@ -1023,7 +1023,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,
configs/chromebook_link64_defconfig +1 -1
@@ -33,7 +33,7 @@ CONFIG_SPL_CPU_SUPPORT=y CONFIG_SPL_ENV_SUPPORT=y CONFIG_SPL_I2C_SUPPORT=y CONFIG_SPL_NET_SUPPORT=y -CONFIG_SPL_PCI_SUPPORT=y +CONFIG_SPL_PCI=y CONFIG_SPL_PCH_SUPPORT=y CONFIG_SPL_RTC_SUPPORT=y CONFIG_HUSH_PARSER=y
configs/qemu-x86_64_defconfig +1 -1
@@ -31,7 +31,7 @@ CONFIG_SPL_SYS_MALLOC_SIMPLE=y CONFIG_SPL_CPU_SUPPORT=y CONFIG_SPL_ENV_SUPPORT=y CONFIG_SPL_NET_SUPPORT=y -CONFIG_SPL_PCI_SUPPORT=y +CONFIG_SPL_PCI=y CONFIG_SPL_PCH_SUPPORT=y CONFIG_SPL_RTC_SUPPORT=y CONFIG_HUSH_PARSER=y
drivers/Makefile +1 -1
@@ -10,7 +10,7 @@ obj-$(CONFIG_$(SPL_TPL_)LED) += led/ obj-$(CONFIG_$(SPL_TPL_)MMC_SUPPORT) += mmc/ obj-$(CONFIG_$(SPL_TPL_)NAND_SUPPORT) += mtd/nand/raw/ obj-$(CONFIG_$(SPL_TPL_)PCH_SUPPORT) += pch/ -obj-$(CONFIG_$(SPL_TPL_)PCI_SUPPORT) += pci/ +obj-$(CONFIG_$(SPL_TPL_)PCI) += pci/ obj-$(CONFIG_$(SPL_TPL_)PHY) += phy/ obj-$(CONFIG_$(SPL_TPL_)PINCTRL) += pinctrl/ obj-$(CONFIG_$(SPL_TPL_)RAM) += ram/
drivers/serial/ns16550.c +1 -1
@@ -406,7 +406,7 @@ int ns16550_serial_ofdata_to_platdata(struct udevice *dev)/* try Processor Local Bus device first */ addr =dev_read_addr (dev); -#if defined(CONFIG_PCI ) && defined(CONFIG_DM_PCI ) +#if CONFIG_IS_ENABLED (PCI ) && defined(CONFIG_DM_PCI )if (addr ==FDT_ADDR_T_NONE ) {/* then try pci device */ struct fdt_pci_addr pci_addr;
lib/fdtdec.c +1 -1
@@ -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) {
Signature · 1 line
2.16.2
PATCH 1/1 spl: fix build failure with !CONFIG_SPL_PCI_SUPPORT
Quoted 12 lines · Sekhar Nori
Building U-Boot with
CONFIG_PCIandCONFIG_DM_PCIenabled, butCONFIG_SPL_PCI_SUPPORTdisabled, 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_CALL26against undefined symbol `dm_pci_read_bar32'This is because reference to
dm_pci_read_bar32()remains inlib/fdtdec.cwhile SPL build does not descend intodrivers/pcidirectory indrivers/MakefileifCONFIG_SPL_PCI_SUPPORTis not enabled.
Quoted 8 lines
Fix this by applying appropriate #define guards in
lib/fdtdec.c. It looks likens16550.chas the same problem, so fixed that too.To simplify this,
CONFIG_SPL_PCI_SUPPORTis renamed toCONFIG_SPL_PCI(enables use ofCONFIG_IS_ENABLED()macro).Suggested-by Vignesh R <[email protected]>Signed-off-by Sekhar Nori <[email protected]>
Thanks and regards,
Lokesh
PATCH 1/1 spl: fix build failure with !CONFIG_SPL_PCI_SUPPORT
In reply to Sekhar NoriQuoted 12 lines · Sekhar Nori
Building U-Boot with
CONFIG_PCIandCONFIG_DM_PCIenabled, butCONFIG_SPL_PCI_SUPPORTdisabled, 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_CALL26against undefined symbol `dm_pci_read_bar32'This is because reference to
dm_pci_read_bar32()remains inlib/fdtdec.cwhile SPL build does not descend intodrivers/pcidirectory indrivers/MakefileifCONFIG_SPL_PCI_SUPPORTis not enabled.
Quoted 8 lines
Fix this by applying appropriate #define guards in
lib/fdtdec.c. It looks likens16550.chas the same problem, so fixed that too.To simplify this,
CONFIG_SPL_PCI_SUPPORTis renamed toCONFIG_SPL_PCI(enables use ofCONFIG_IS_ENABLED()macro).Suggested-by Vignesh R <[email protected]>Signed-off-by Sekhar Nori <[email protected]>
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: not available URL: <http://lists.denx.de/pipermail/u-boot/attachments/20181206/0d30d895/attachment.sig>
Quoted 15 lines · Sekhar Nori
Building U-Boot with
CONFIG_PCIandCONFIG_DM_PCIenabled, butCONFIG_SPL_PCI_SUPPORTdisabled, 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_CALL26against undefined symbol `dm_pci_read_bar32'This is because reference to
dm_pci_read_bar32()remains inlib/fdtdec.cwhile SPL build does not descend intodrivers/pcidirectory indrivers/MakefileifCONFIG_SPL_PCI_SUPPORTis not enabled.Fix this by applying appropriate #define guards in
lib/fdtdec.c. It looks likens16550.chas the same problem, so fixed that too.
Quoted 7 lines
To simplify this,
CONFIG_SPL_PCI_SUPPORTis renamed toCONFIG_SPL_PCI(enables use ofCONFIG_IS_ENABLED()macro).Suggested-by Vignesh R <[email protected]>Signed-off-by Sekhar Nori <[email protected]>Reviewed-by Lokesh Vutla <[email protected]>Reviewed-by Tom Rini <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: not available URL: <http://lists.denx.de/pipermail/u-boot/attachments/20181212/0786d667/attachment.sig>