From patchwork Fri Feb 20 05:24:58 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 441835 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 8F7B61401AB for ; Fri, 20 Feb 2015 16:25:43 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 1B7104A053; Fri, 20 Feb 2015 06:25:38 +0100 (CET) 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 J8MN6lJ672u4; Fri, 20 Feb 2015 06:25:37 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 02D124B5F5; Fri, 20 Feb 2015 06:25:32 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id E2AEB4A050 for ; Fri, 20 Feb 2015 06:25:26 +0100 (CET) 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 gCH8dK-KANI8 for ; Fri, 20 Feb 2015 06:25:26 +0100 (CET) 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 smtp.mei.co.jp (smtp.mei.co.jp [133.183.100.20]) by theia.denx.de (Postfix) with ESMTP id 0C8BE4A058 for ; Fri, 20 Feb 2015 06:25:20 +0100 (CET) Received: from mail-gw.jp.panasonic.com ([157.8.1.157]) by smtp.mei.co.jp (8.12.11.20060614/3.7W/kc-maile12) with ESMTP id t1K5P3nC010374; Fri, 20 Feb 2015 14:25:03 +0900 (JST) Received: from epochmail.jp.panasonic.com ([157.8.1.130]) by mail.jp.panasonic.com (8.11.6p2/3.7W/kc-maili12) with ESMTP id t1K5P3f02813; Fri, 20 Feb 2015 14:25:03 +0900 Received: by epochmail.jp.panasonic.com (8.12.11.20060308/3.7W/lomi13) id t1K5P3sP025176; Fri, 20 Feb 2015 14:25:03 +0900 Received: from poodle by lomi13.jp.panasonic.com (8.12.11.20060308/3.7W) with ESMTP id t1K5P3pm025108; Fri, 20 Feb 2015 14:25:03 +0900 Received: from beagle.diag.org (beagle.diag.org [10.184.179.16]) by poodle (Postfix) with ESMTP id 53DC62740043; Fri, 20 Feb 2015 14:25:03 +0900 (JST) From: Masahiro Yamada To: u-boot@lists.denx.de Date: Fri, 20 Feb 2015 14:24:58 +0900 Message-Id: <1424409901-22755-5-git-send-email-yamada.m@jp.panasonic.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1424409901-22755-1-git-send-email-yamada.m@jp.panasonic.com> References: <1424409901-22755-1-git-send-email-yamada.m@jp.panasonic.com> Cc: Alexey Brodkin , Michal Simek , Tom Warren , Tom Rini Subject: [U-Boot] [PATCH v3 4/7] malloc_f: add ARCH_MALLOC_F_LEN to specify SoC-default malloc_f_len 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" Now the default value of CONFIG_SYS_MALLOC_F_LEN can be overridden by SoC Kconfig file, but we still have to add the same conditional "if SYS_MALLOC_F" to every default. Otherwise, a broken .config file could be generated. It is too painful. This commit intends to solve it by introducing SoC-default ARCH_MALLOC_F_LEN. This works as follows: - If ARCH_MALLOC_F_LEN is defined, it overrides the default of SYS_MALLOC_F_LEN. If you have the SoC-optimized value, you might wish to do this. - If ARCH_MALLOC_F_LEN is not defined, SYS_MALLOC_F_LEN is default to 0x400. This is the global default and it should work well enough in most cases. - You can still change SYS_MALLOC_F_LEN per board, although you do not probably have to do so. Per-board default should be saved into each defconfig. Signed-off-by: Masahiro Yamada Reviewed-by: Simon Glass --- Changes in v3: - Newly added Changes in v2: None Kconfig | 1 + arch/arm/cpu/armv7/tegra-common/Kconfig | 5 +++-- arch/x86/Kconfig | 5 +++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/Kconfig b/Kconfig index 351e5c9..cb5a6a8 100644 --- a/Kconfig +++ b/Kconfig @@ -70,6 +70,7 @@ config SYS_MALLOC_F config SYS_MALLOC_F_LEN hex "Size of malloc() pool before relocation" depends on SYS_MALLOC_F + default ARCH_MALLOC_F_LEN if ARCH_MALLOC_F_LEN default 0x400 help Before relocation memory is very limited on many platforms. Still, diff --git a/arch/arm/cpu/armv7/tegra-common/Kconfig b/arch/arm/cpu/armv7/tegra-common/Kconfig index 8b51558..c326106 100644 --- a/arch/arm/cpu/armv7/tegra-common/Kconfig +++ b/arch/arm/cpu/armv7/tegra-common/Kconfig @@ -20,8 +20,9 @@ endchoice config SYS_MALLOC_F default y -config SYS_MALLOC_F_LEN - default 0x1800 if SYS_MALLOC_F +config ARCH_MALLOC_F_LEN + hex + default 0x1800 config USE_PRIVATE_LIBGCC default y if SPL_BUILD diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index 65909e7..0e49dd3 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig @@ -79,8 +79,9 @@ config DM_SERIAL config SYS_MALLOC_F default y -config SYS_MALLOC_F_LEN - default 0x800 if SYS_MALLOC_F +config ARCH_MALLOC_F_LEN + hex + default 0x800 config RAMBASE hex