From patchwork Wed Nov 28 23:07:37 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miquel Raynal X-Patchwork-Id: 1004909 X-Patchwork-Delegate: jagannadh.teki@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=bootlin.com Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 434xFc6jvdz9s4s for ; Thu, 29 Nov 2018 10:10:12 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id 9FA91C2234C; Wed, 28 Nov 2018 23:10:06 +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=none 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 7EADBC2234B; Wed, 28 Nov 2018 23:08:11 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 729A9C222D0; Wed, 28 Nov 2018 23:08:09 +0000 (UTC) Received: from mail.bootlin.com (mail.bootlin.com [62.4.15.54]) by lists.denx.de (Postfix) with ESMTP id F3F9DC22341 for ; Wed, 28 Nov 2018 23:08:08 +0000 (UTC) Received: by mail.bootlin.com (Postfix, from userid 110) id 7A30420745; Thu, 29 Nov 2018 00:08:08 +0100 (CET) Received: from localhost.localdomain (unknown [91.224.148.103]) by mail.bootlin.com (Postfix) with ESMTPSA id C975D20714; Thu, 29 Nov 2018 00:08:07 +0100 (CET) From: Miquel Raynal To: u-boot@lists.denx.de Date: Thu, 29 Nov 2018 00:07:37 +0100 Message-Id: <20181128230800.13292-2-miquel.raynal@bootlin.com> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181128230800.13292-1-miquel.raynal@bootlin.com> References: <20181128230800.13292-1-miquel.raynal@bootlin.com> MIME-Version: 1.0 Cc: Tom Rini , Kyungmin Park , Boris Brezillon , Miquel Raynal , Steve Rae , TsiChung Liew Subject: [U-Boot] [PATCH v2 01/24] Makefile: move MTD-related lines in coherent Makefiles 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" Move MTD-related lines out of the root Makefile. Put them in their respective directories. Enclose some of these new lines to skip them when building the SPL (the SPL directly points to what is needed). CONFIG_CMD_NAND is the symbol indicating support for raw NAND devices. This logic is broken and will be fixed afterwards. To let the 'mtd' command also use the raw NAND core, we add it in the condition. This will be cleaned later. Signed-off-by: Miquel Raynal --- Makefile | 5 ----- drivers/Makefile | 3 ++- drivers/mtd/Makefile | 6 ++++++ drivers/mtd/nand/Makefile | 3 +++ 4 files changed, 11 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 552687db53..435d0257dd 100644 --- a/Makefile +++ b/Makefile @@ -688,11 +688,6 @@ libs-y += drivers/ libs-y += drivers/dma/ libs-y += drivers/gpio/ libs-y += drivers/i2c/ -libs-y += drivers/mtd/ -libs-$(CONFIG_CMD_NAND) += drivers/mtd/nand/raw/ -libs-y += drivers/mtd/onenand/ -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/ diff --git a/drivers/Makefile b/drivers/Makefile index 4453c62ad3..e7c93875bb 100644 --- a/drivers/Makefile +++ b/drivers/Makefile @@ -6,7 +6,7 @@ obj-$(CONFIG_$(SPL_TPL_)DRIVERS_MISC_SUPPORT) += misc/ sysreset/ firmware/ obj-$(CONFIG_$(SPL_TPL_)I2C_SUPPORT) += i2c/ 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_)NAND_SUPPORT) += mtd/nand/ obj-$(CONFIG_$(SPL_TPL_)PHY) += phy/ obj-$(CONFIG_$(SPL_TPL_)PINCTRL) += pinctrl/ obj-$(CONFIG_$(SPL_TPL_)RAM) += ram/ @@ -99,6 +99,7 @@ obj-$(CONFIG_QE) += qe/ obj-$(CONFIG_U_QE) += qe/ obj-y += mailbox/ obj-y += memory/ +obj-y += mtd/ obj-y += pwm/ obj-y += reset/ obj-y += input/ diff --git a/drivers/mtd/Makefile b/drivers/mtd/Makefile index 22ceda93c0..aca3a0b811 100644 --- a/drivers/mtd/Makefile +++ b/drivers/mtd/Makefile @@ -19,4 +19,10 @@ obj-$(CONFIG_ST_SMI) += st_smi.o obj-$(CONFIG_STM32_FLASH) += stm32_flash.o obj-$(CONFIG_RENESAS_RPC_HF) += renesas_rpc_hf.o +# SPL will manually build the files it needs +ifeq ($(CONFIG_SPL_BUILD)$(CONFIG_TPL_BUILD),) obj-y += nand/ +obj-y += onenand/ +obj-y += spi/ +obj-$(CONFIG_CMD_UBI) += ubi/ +endif diff --git a/drivers/mtd/nand/Makefile b/drivers/mtd/nand/Makefile index a358bc680e..99ca69ef95 100644 --- a/drivers/mtd/nand/Makefile +++ b/drivers/mtd/nand/Makefile @@ -2,4 +2,7 @@ nandcore-objs := core.o bbt.o obj-$(CONFIG_MTD_NAND_CORE) += nandcore.o +ifneq (,$(findstring y,$(CONFIG_CMD_NAND)$(CONFIG_CMD_MTD))) +obj-y += raw/ +endif obj-$(CONFIG_MTD_SPI_NAND) += spi/