From patchwork Tue Sep 13 05:18:25 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 669155 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 3sYCgY4l18z9sRZ for ; Tue, 13 Sep 2016 15:20:41 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=google.com header.i=@google.com header.b=ZIJlquYI; dkim-atps=neutral Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 5014FA75A9; Tue, 13 Sep 2016 07:20:07 +0200 (CEST) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 3STGFCKQi27d; Tue, 13 Sep 2016 07:20:07 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 6B622A75AA; Tue, 13 Sep 2016 07:19:43 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 4441EA7544 for ; Tue, 13 Sep 2016 07:19:29 +0200 (CEST) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id XYW-tqMuwd86 for ; Tue, 13 Sep 2016 07:19:29 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from mail-oi0-f43.google.com (mail-oi0-f43.google.com [209.85.218.43]) by theia.denx.de (Postfix) with ESMTPS id 27700A7534 for ; Tue, 13 Sep 2016 07:19:23 +0200 (CEST) Received: by mail-oi0-f43.google.com with SMTP id m11so361571513oif.1 for ; Mon, 12 Sep 2016 22:19:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=42Ken8Or9T55hdiD3dZzNY0OCAuL/pxJ9Ws3W4A05gk=; b=ZIJlquYIm97ppNtq/MbvMvxeplzX3QrzfWYDWY/HwPkaMoN4avjUkFu9ETMoCC34rC wk9oxuCea59HxicPNcoK4Lq+zK72nHj7uJK8XUZHc+HiiYnA9DGrhH4sD5tuonpafC57 LljVom59OCh5GFyTUdu7UH5kQx136kaSKFTIRWgz+cfxm8zD62wGJsM1FclrsZVS8XGZ 3y+CMueippGtigcBO/bI5aIjuxcMIFJP4GqOsU1Z5JLtw+yToQoUtdkXR0ydsTxcSO4G ueG01ryAEKvQVJBC1608yLBMAZy6H1WgBVBm3inIEaOP0JmJG/7eDzj80wHD2ziBR7Yl 50VQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=42Ken8Or9T55hdiD3dZzNY0OCAuL/pxJ9Ws3W4A05gk=; b=CUjKvjYhBkIsTgg6nYWddIZhQDgw7UP11mR90Xhn2YrwnU+YAuyR0mrQMSOh7rc9Qj YOL9f9dTRE/V5fSKmoZP3qDcEfzOpfDNSQYMWJEnwfJbfDswDPzq91iuMfeb80Z03JlN Ox7XLhx1iPeD5eK4VYx47sVMLSQB2yRNgnjHr+8kiDOltVO4p19tPdWb2mvNRBJ6YeO2 nyxnXJPVq/5UqUAThSsc4FcDqcgr5ObmnCXPvfpTSZ7SJavsjHoVIJD+tL64dpvKFtSU 2My9PvYFmchpZwIJCVuy9tFLzabbA5RChuhvKu8U+m9fx1TTHic3sbFwT4V9u69sY64S Gn9g== X-Gm-Message-State: AE9vXwMdhO/tx9ZR8OiGcvRGod+1XMGdzd8u4l+t/8Ydk1z9KNndWHoQp2xt4jO9uQnA+K34 X-Received: by 10.157.22.250 with SMTP id s55mr26890295ots.182.1473743962486; Mon, 12 Sep 2016 22:19:22 -0700 (PDT) Received: from kaki.bld.corp.google.com ([100.100.202.55]) by smtp.gmail.com with ESMTPSA id z133sm2793985ioz.23.2016.09.12.22.19.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 12 Sep 2016 22:19:21 -0700 (PDT) Received: by kaki.bld.corp.google.com (Postfix, from userid 121222) id 1C02622321F; Mon, 12 Sep 2016 23:19:19 -0600 (MDT) From: Simon Glass To: U-Boot Mailing List Date: Mon, 12 Sep 2016 23:18:25 -0600 Message-Id: <1473743943-15003-8-git-send-email-sjg@chromium.org> X-Mailer: git-send-email 2.8.0.rc3.226.g39d4020 In-Reply-To: <1473743943-15003-1-git-send-email-sjg@chromium.org> References: <1473743943-15003-1-git-send-email-sjg@chromium.org> Cc: Tom Rini Subject: [U-Boot] [PATCH v3 07/45] Use separate options for TPL support X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.15 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" At present TPL uses the same options as SPL support. In a few cases the board config enables or disables the SPL options depending on whether CONFIG_TPL_BUILD is defined. With the move to Kconfig, options are determined for the whole build and (without a hack like an #undef in a header file) cannot be controlled in this way. Create new TPL options for these and update users. This will allow Kconfig conversion to proceed for these boards. Signed-off-by: Simon Glass --- Changes in v3: None Changes in v2: None common/Makefile | 12 +++++++++++- drivers/Makefile | 16 +++++++++++++++- include/common.h | 15 +++++++++------ include/configs/C29XPCIE.h | 16 ++++++++-------- include/configs/P1010RDB.h | 14 +++++++------- include/configs/P1022DS.h | 14 +++++++------- include/configs/p1_p2_rdb_pc.h | 14 +++++++------- lib/Makefile | 9 +++++++-- scripts/Makefile.spl | 10 +++++++++- 9 files changed, 80 insertions(+), 40 deletions(-) diff --git a/common/Makefile b/common/Makefile index 21619b3..9a9a065 100644 --- a/common/Makefile +++ b/common/Makefile @@ -99,10 +99,16 @@ obj-$(CONFIG_SPL_USB_SUPPORT) += usb.o usb_hub.o obj-$(CONFIG_USB_STORAGE) += usb_storage.o endif # environment -ifdef CONFIG_SPL_ENV_SUPPORT +ifdef CONFIG_TPL_BUILD +obj-$(CONFIG_TPL_ENV_SUPPORT) += env_attr.o +obj-$(CONFIG_TPL_ENV_SUPPORT) += env_flags.o +obj-$(CONFIG_TPL_ENV_SUPPORT) += env_callback.o +else obj-$(CONFIG_SPL_ENV_SUPPORT) += env_attr.o obj-$(CONFIG_SPL_ENV_SUPPORT) += env_flags.o obj-$(CONFIG_SPL_ENV_SUPPORT) += env_callback.o +endif +ifneq ($(CONFIG_TPL_ENV_SUPPORT)$(CONFIG_SPL_ENV_SUPPORT),) obj-$(CONFIG_ENV_IS_NOWHERE) += env_nowhere.o obj-$(CONFIG_ENV_IS_IN_MMC) += env_mmc.o obj-$(CONFIG_ENV_IS_IN_FAT) += env_fat.o @@ -123,7 +129,11 @@ obj-$(CONFIG_SPD_EEPROM) += ddr_spd.o obj-$(CONFIG_HWCONFIG) += hwconfig.o obj-$(CONFIG_BOUNCE_BUFFER) += bouncebuf.o ifdef CONFIG_SPL_BUILD +ifdef CONFIG_TPL_BUILD +obj-$(CONFIG_TPL_SERIAL_SUPPORT) += console.o +else obj-$(CONFIG_SPL_SERIAL_SUPPORT) += console.o +endif else obj-y += console.o endif diff --git a/drivers/Makefile b/drivers/Makefile index 7861d34..ca98273 100644 --- a/drivers/Makefile +++ b/drivers/Makefile @@ -40,8 +40,22 @@ obj-$(CONFIG_OMAP_USB_PHY) += usb/phy/ obj-$(CONFIG_SPL_SATA_SUPPORT) += block/ obj-$(CONFIG_SPL_USB_HOST_SUPPORT) += block/ obj-$(CONFIG_SPL_MMC_SUPPORT) += block/ +endif + +ifdef CONFIG_TPL_BUILD + +obj-$(CONFIG_TPL_I2C_SUPPORT) += i2c/ +obj-$(CONFIG_TPL_DRIVERS_MISC_SUPPORT) += misc/ sysreset/ +obj-$(CONFIG_TPL_MMC_SUPPORT) += mmc/ +obj-$(CONFIG_TPL_MPC8XXX_INIT_DDR_SUPPORT) += ddr/fsl/ +obj-$(CONFIG_TPL_NAND_SUPPORT) += mtd/nand/ +obj-$(CONFIG_TPL_SERIAL_SUPPORT) += serial/ +obj-$(CONFIG_TPL_SPI_FLASH_SUPPORT) += mtd/spi/ +obj-$(CONFIG_TPL_SPI_SUPPORT) += spi/ + +endif -else +ifeq ($(CONFIG_SPL_BUILD)$(CONFIG_TPL_BUILD),) obj-y += adc/ obj-$(CONFIG_DM_DEMO) += demo/ diff --git a/include/common.h b/include/common.h index e9f0dea..a8d833b 100644 --- a/include/common.h +++ b/include/common.h @@ -866,17 +866,20 @@ int getc(void); int tstc(void); /* stdout */ -#if defined(CONFIG_SPL_BUILD) && !defined(CONFIG_SPL_SERIAL_SUPPORT) -#define putc(...) do { } while (0) -#define puts(...) do { } while (0) -#define printf(...) do { } while (0) -#define vprintf(...) do { } while (0) -#else +#if !defined(CONFIG_SPL_BUILD) || \ + (defined(CONFIG_TPL_BUILD) && defined(CONFIG_TPL_SERIAL_SUPPORT)) || \ + (defined(CONFIG_SPL_BUILD) && !defined(CONFIG_TPL_BUILD) && \ + defined(CONFIG_SPL_SERIAL_SUPPORT)) void putc(const char c); void puts(const char *s); int printf(const char *fmt, ...) __attribute__ ((format (__printf__, 1, 2))); int vprintf(const char *fmt, va_list args); +#else +#define putc(...) do { } while (0) +#define puts(...) do { } while (0) +#define printf(...) do { } while (0) +#define vprintf(...) do { } while (0) #endif /* stderr */ diff --git a/include/configs/C29XPCIE.h b/include/configs/C29XPCIE.h index f75919d..8ec1a90 100644 --- a/include/configs/C29XPCIE.h +++ b/include/configs/C29XPCIE.h @@ -27,15 +27,15 @@ #ifdef CONFIG_TPL_BUILD #define CONFIG_SPL_NAND_BOOT #define CONFIG_SPL_FLUSH_IMAGE -#define CONFIG_SPL_ENV_SUPPORT +#define CONFIG_TPL_ENV_SUPPORT #define CONFIG_SPL_NAND_INIT -#define CONFIG_SPL_SERIAL_SUPPORT -#define CONFIG_SPL_LIBGENERIC_SUPPORT -#define CONFIG_SPL_LIBCOMMON_SUPPORT -#define CONFIG_SPL_I2C_SUPPORT -#define CONFIG_SPL_DRIVERS_MISC_SUPPORT -#define CONFIG_SPL_NAND_SUPPORT -#define CONFIG_SPL_MPC8XXX_INIT_DDR_SUPPORT +#define CONFIG_TPL_SERIAL_SUPPORT +#define CONFIG_TPL_LIBGENERIC_SUPPORT +#define CONFIG_TPL_LIBCOMMON_SUPPORT +#define CONFIG_TPL_I2C_SUPPORT +#define CONFIG_TPL_DRIVERS_MISC_SUPPORT +#define CONFIG_TPL_NAND_SUPPORT +#define CONFIG_TPL_MPC8XXX_INIT_DDR_SUPPORT #define CONFIG_SPL_COMMON_INIT_DDR #define CONFIG_SPL_MAX_SIZE (128 << 10) #define CONFIG_SPL_TEXT_BASE 0xf8f81000 diff --git a/include/configs/P1010RDB.h b/include/configs/P1010RDB.h index 0c84622..04ff3ca 100644 --- a/include/configs/P1010RDB.h +++ b/include/configs/P1010RDB.h @@ -106,15 +106,15 @@ #ifdef CONFIG_TPL_BUILD #define CONFIG_SPL_NAND_BOOT #define CONFIG_SPL_FLUSH_IMAGE -#define CONFIG_SPL_ENV_SUPPORT +#define CONFIG_TPL_ENV_SUPPORT #define CONFIG_SPL_NAND_INIT -#define CONFIG_SPL_SERIAL_SUPPORT -#define CONFIG_SPL_LIBGENERIC_SUPPORT -#define CONFIG_SPL_LIBCOMMON_SUPPORT -#define CONFIG_SPL_I2C_SUPPORT -#define CONFIG_SPL_NAND_SUPPORT +#define CONFIG_TPL_SERIAL_SUPPORT +#define CONFIG_TPL_LIBGENERIC_SUPPORT +#define CONFIG_TPL_LIBCOMMON_SUPPORT +#define CONFIG_TPL_I2C_SUPPORT +#define CONFIG_TPL_NAND_SUPPORT #define CONFIG_SPL_DRIVERS_MISC_SUPPORT -#define CONFIG_SPL_MPC8XXX_INIT_DDR_SUPPORT +#define CONFIG_TPL_MPC8XXX_INIT_DDR_SUPPORT #define CONFIG_SPL_COMMON_INIT_DDR #define CONFIG_SPL_MAX_SIZE (128 << 10) #define CONFIG_SPL_TEXT_BASE 0xD0001000 diff --git a/include/configs/P1022DS.h b/include/configs/P1022DS.h index 9fbc128..7e4cd12 100644 --- a/include/configs/P1022DS.h +++ b/include/configs/P1022DS.h @@ -78,14 +78,14 @@ #ifdef CONFIG_TPL_BUILD #define CONFIG_SPL_NAND_BOOT #define CONFIG_SPL_FLUSH_IMAGE -#define CONFIG_SPL_ENV_SUPPORT +#define CONFIG_TPL_ENV_SUPPORT #define CONFIG_SPL_NAND_INIT -#define CONFIG_SPL_SERIAL_SUPPORT -#define CONFIG_SPL_LIBGENERIC_SUPPORT -#define CONFIG_SPL_LIBCOMMON_SUPPORT -#define CONFIG_SPL_I2C_SUPPORT -#define CONFIG_SPL_NAND_SUPPORT -#define CONFIG_SPL_MPC8XXX_INIT_DDR_SUPPORT +#define CONFIG_TPL_SERIAL_SUPPORT +#define CONFIG_TPL_LIBGENERIC_SUPPORT +#define CONFIG_TPL_LIBCOMMON_SUPPORT +#define CONFIG_TPL_I2C_SUPPORT +#define CONFIG_TPL_NAND_SUPPORT +#define CONFIG_TPL_MPC8XXX_INIT_DDR_SUPPORT #define CONFIG_SPL_COMMON_INIT_DDR #define CONFIG_SPL_MAX_SIZE (128 << 10) #define CONFIG_SPL_TEXT_BASE 0xf8f81000 diff --git a/include/configs/p1_p2_rdb_pc.h b/include/configs/p1_p2_rdb_pc.h index ae0f6a5..3daba70 100644 --- a/include/configs/p1_p2_rdb_pc.h +++ b/include/configs/p1_p2_rdb_pc.h @@ -241,14 +241,14 @@ #ifdef CONFIG_TPL_BUILD #define CONFIG_SPL_NAND_BOOT #define CONFIG_SPL_FLUSH_IMAGE -#define CONFIG_SPL_ENV_SUPPORT +#define CONFIG_TPL_ENV_SUPPORT #define CONFIG_SPL_NAND_INIT -#define CONFIG_SPL_SERIAL_SUPPORT -#define CONFIG_SPL_LIBGENERIC_SUPPORT -#define CONFIG_SPL_LIBCOMMON_SUPPORT -#define CONFIG_SPL_I2C_SUPPORT -#define CONFIG_SPL_NAND_SUPPORT -#define CONFIG_SPL_MPC8XXX_INIT_DDR_SUPPORT +#define CONFIG_TPL_SERIAL_SUPPORT +#define CONFIG_TPL_LIBGENERIC_SUPPORT +#define CONFIG_TPL_LIBCOMMON_SUPPORT +#define CONFIG_TPL_I2C_SUPPORT +#define CONFIG_TPL_NAND_SUPPORT +#define CONFIG_TPL_MPC8XXX_INIT_DDR_SUPPORT #define CONFIG_SPL_COMMON_INIT_DDR #define CONFIG_SPL_MAX_SIZE (128 << 10) #define CONFIG_SPL_TEXT_BASE 0xf8f81000 diff --git a/lib/Makefile b/lib/Makefile index f6a8ba1..c81bfeb 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -78,11 +78,16 @@ obj-$(CONFIG_LIB_UUID) += uuid.o obj-$(CONFIG_LIB_RAND) += rand.o ifdef CONFIG_SPL_BUILD +ifdef CONFIG_TPL_BUILD +SERIAL_SUPPORT := $(CONFIG_TPL_SERIAL_SUPPORT) +else +SERIAL_SUPPORT := $(CONFIG_SPL_SERIAL_SUPPORT) +endif # SPL U-Boot may use full-printf, tiny-printf or none at all ifdef CONFIG_USE_TINY_PRINTF -obj-$(CONFIG_SPL_SERIAL_SUPPORT) += tiny-printf.o panic.o strto.o +obj-$(SERIAL_SUPPORT) += tiny-printf.o panic.o strto.o else -obj-$(CONFIG_SPL_SERIAL_SUPPORT) += vsprintf.o panic.o strto.o strmhz.o +obj-$(SERIAL_SUPPORT) += vsprintf.o panic.o strto.o strmhz.o endif else # Main U-Boot always uses the full printf support diff --git a/scripts/Makefile.spl b/scripts/Makefile.spl index cafc9b1..21bdcf2 100644 --- a/scripts/Makefile.spl +++ b/scripts/Makefile.spl @@ -54,12 +54,20 @@ libs-$(HAVE_VENDOR_COMMON_LIB) += board/$(VENDOR)/common/ libs-$(CONFIG_SPL_FRAMEWORK) += common/spl/ libs-y += common/init/ + +# Special handling for a few options which support SPL/TPL +ifeq ($(CONFIG_TPL_BUILD),y) +libs-$(CONFIG_TPL_LIBCOMMON_SUPPORT) += common/ cmd/ +libs-$(CONFIG_TPL_LIBGENERIC_SUPPORT) += lib/ +else libs-$(CONFIG_SPL_LIBCOMMON_SUPPORT) += common/ cmd/ +libs-$(CONFIG_SPL_LIBGENERIC_SUPPORT) += lib/ +endif + libs-$(CONFIG_SPL_LIBDISK_SUPPORT) += disk/ libs-y += drivers/ libs-y += dts/ libs-y += fs/ -libs-$(CONFIG_SPL_LIBGENERIC_SUPPORT) += lib/ libs-$(CONFIG_SPL_POST_MEM_SUPPORT) += post/drivers/ libs-$(CONFIG_SPL_NET_SUPPORT) += net/