From patchwork Thu Dec 6 10:10:08 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sekhar Nori X-Patchwork-Id: 153005 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp10339995ljp; Thu, 6 Dec 2018 02:10:52 -0800 (PST) X-Google-Smtp-Source: AFSGD/XZltS6fBz3jZcC8ztDFcojTiCfxwtHT7GmkrWsdRos7VQgpVWaDCNAUdZEXPucM87iE03c X-Received: by 2002:aa7:c352:: with SMTP id j18mr23954846edr.295.1544091052317; Thu, 06 Dec 2018 02:10:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544091052; cv=none; d=google.com; s=arc-20160816; b=m7D+/L+e2NwCQ+X0s8+tNojqm8KBfl3QMF49rsH8RAXBeWPxoDbROks8q2Wp8doanH nBovdjuyai3XRp6a2rRWF+JNgAlz+sNnwRfEswRDjOlXnAvmPzGLxx9p386Ecer86DMc ScZNnK2iGRX3zD+0wF4d6EvJmbq6qAfjNE1Xr3SBW7jXSimO0D60TcFHLYdXikqIqfs7 erbOO9PHZfJiWqbdLtm8YNa3sPvUXCuCLn3u3lmWWumxofePP/keCXqFhpp3lXvIoBmr bpQb2qQq/P1/ixjDAHA/5APJUnxoarKYocR8MM+aDO9WHXB7DiDCTkz6CE4hlo45cXId n+AQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence:subject :cc:mime-version:message-id:date:to:from:dkim-signature; bh=2OB7PuqnF1m5G+nCymBZ6eh7hOSWBdAgStGMcaCZu5k=; b=0V87YEVIO7rRH7iWUf9ujEy16xdkAQpfd8gnzc/ZrbjSxDlMP9OamKsfuXo1+Lu2/6 ZRjSmJOCerIIQkYhUJfBefv07h6HDm5IjRqIpljShYnHi77+DPC20o1dlEC3U6FpTUP1 pvbP9qOoxPiPl8+EXjB1ZeDdkbBuYubLwpprUAidO/Mqfb2UQhtIfzo8jexdqXZcklGd oFI/EvN4KqNAIOOm6ihpgmQqLmxQrLRbOElXix4HXIMnYynncCKkvJGXa6JbBG6I2Lb1 V5TwZyHGTfU4ZWlViNDqiHD8y4BLfy8DKpNoyShcfBFYlXErmrKDoP1ym0jKN8rwQCE7 t8oQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@ti.com header.s=ti-com-17Q1 header.b="x/2l/H8W"; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=fail (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from lists.denx.de (dione.denx.de. [81.169.180.215]) by mx.google.com with ESMTP id b11si81917edj.393.2018.12.06.02.10.51; Thu, 06 Dec 2018 02:10:52 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) client-ip=81.169.180.215; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@ti.com header.s=ti-com-17Q1 header.b="x/2l/H8W"; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=fail (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: by lists.denx.de (Postfix, from userid 105) id CE834C22573; Thu, 6 Dec 2018 10:10:26 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 2A516C224EE; Thu, 6 Dec 2018 10:10:25 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 83DA3C22533; Thu, 6 Dec 2018 10:10:14 +0000 (UTC) Received: from lelv0143.ext.ti.com (lelv0143.ext.ti.com [198.47.23.248]) by lists.denx.de (Postfix) with ESMTPS id 03D82C224E6 for ; Thu, 6 Dec 2018 10:10:13 +0000 (UTC) Received: from fllv0034.itg.ti.com ([10.64.40.246]) by lelv0143.ext.ti.com (8.15.2/8.15.2) with ESMTP id wB6AABdZ120539; Thu, 6 Dec 2018 04:10:11 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1544091011; bh=qILoHdLOxtxbK1ZSBbOFIyfn6aGzwrdrw02uzC7BoLQ=; h=From:To:CC:Subject:Date; b=x/2l/H8W9vJ2E2kxISt8k//mO6tRNAvSbsARjPTkLzUS+BW3uBBhF/yN5LZKmMBDi LDv08QYPb+vL9cnNkjWWGYZywEbrXSqr9jQmRC1HO4FmPzPZ2XLIrJuoNUQG+FbYyF 49a7ahRnMKoRmlVIjhOmnFFpHDI2drWdblvjtMmQ= Received: from DFLE112.ent.ti.com (dfle112.ent.ti.com [10.64.6.33]) by fllv0034.itg.ti.com (8.15.2/8.15.2) with ESMTPS id wB6AAB4S078003 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 6 Dec 2018 04:10:11 -0600 Received: from DFLE108.ent.ti.com (10.64.6.29) by DFLE112.ent.ti.com (10.64.6.33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10; Thu, 6 Dec 2018 04:10:11 -0600 Received: from dlep32.itg.ti.com (157.170.170.100) by DFLE108.ent.ti.com (10.64.6.29) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1591.10 via Frontend Transport; Thu, 6 Dec 2018 04:10:11 -0600 Received: from psplinux063.india.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dlep32.itg.ti.com (8.14.3/8.13.8) with ESMTP id wB6AA9E7005883; Thu, 6 Dec 2018 04:10:09 -0600 From: Sekhar Nori To: Tom Rini Date: Thu, 6 Dec 2018 15:40:08 +0530 Message-ID: <20181206101008.11250-1-nsekhar@ti.com> X-Mailer: git-send-email 2.16.2 MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Cc: U-Boot Mailing List Subject: [U-Boot] [PATCH] spl: fix build failure with !CONFIG_SPL_PCI_SUPPORT X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" 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 --- 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(-) diff --git a/Makefile b/Makefile index 0d11ff97971a..6be95760f7ac 100644 --- a/Makefile +++ b/Makefile @@ -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/ \ diff --git a/common/spl/Kconfig b/common/spl/Kconfig index 0ddbffc7d1c6..84e9f62e992d 100644 --- a/common/spl/Kconfig +++ b/common/spl/Kconfig @@ -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, diff --git a/configs/chromebook_link64_defconfig b/configs/chromebook_link64_defconfig index 13b90a13f6cc..074d333dd4e5 100644 --- a/configs/chromebook_link64_defconfig +++ b/configs/chromebook_link64_defconfig @@ -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 diff --git a/configs/qemu-x86_64_defconfig b/configs/qemu-x86_64_defconfig index 32922b84ffa1..8d43acd4802e 100644 --- a/configs/qemu-x86_64_defconfig +++ b/configs/qemu-x86_64_defconfig @@ -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 diff --git a/drivers/Makefile b/drivers/Makefile index 55de10926ef4..ad60a504ba05 100644 --- a/drivers/Makefile +++ b/drivers/Makefile @@ -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/ diff --git a/drivers/serial/ns16550.c b/drivers/serial/ns16550.c index 25b9d1724334..5087c99f4f35 100644 --- a/drivers/serial/ns16550.c +++ b/drivers/serial/ns16550.c @@ -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; diff --git a/lib/fdtdec.c b/lib/fdtdec.c index cbdc0778258b..4c70b8881783 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) {