From patchwork Fri Feb 20 17:09:57 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 442064 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 D498F140188 for ; Sat, 21 Feb 2015 04:10:41 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id E5C0C4B372; Fri, 20 Feb 2015 18:10:36 +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 oaQFa-0tgFhe; Fri, 20 Feb 2015 18:10:36 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 7C2874A032; Fri, 20 Feb 2015 18:10:36 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 47A8B4A041 for ; Fri, 20 Feb 2015 18:10:31 +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 aO5roAinN4hg for ; Fri, 20 Feb 2015 18:10:31 +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 mail-pa0-f42.google.com (mail-pa0-f42.google.com [209.85.220.42]) by theia.denx.de (Postfix) with ESMTPS id 59BE34A03B for ; Fri, 20 Feb 2015 18:10:27 +0100 (CET) Received: by padbj1 with SMTP id bj1so9418319pad.5 for ; Fri, 20 Feb 2015 09:10:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=Nny9euCfhrcy3uIdF1j+xO6+sdi4PVzsRE9xar+3Pwk=; b=rXGC8eJVrHB4939y92pkhne1GyRigBxBgJkXBCPB5EZZ+VMi1/obyNWm+JmIGIKUvz Quge1e6SI0VULDVMqIhf4aOkpYo+qJje0GYNRCNFWYu/MSCyAjWr1Y4Bd8a92C4x/ukk AJYr9e6JdSGdE8uejArKOnqo7ZwYAgzoEYysbN9582NAUhXvQoXRQErTNQCU56DdRLj8 ZV42Q5Z/ruAJo8572jHAz9ECwlpnqVJXblyJIQPtK1XEhENMnMejSxRyga43iVMNvpw8 T7Tm/Sw2YMsQeuyRF2wEhxX/EYoazAoHngYWR2qppRO3M8LCMZX0B+pbGscicL+Z88uX WQvg== X-Received: by 10.66.100.230 with SMTP id fb6mr18713378pab.156.1424452226289; Fri, 20 Feb 2015 09:10:26 -0800 (PST) Received: from oscar.sesame (112.136.111.193.er.eaccess.ne.jp. [112.136.111.193]) by mx.google.com with ESMTPSA id ao5sm18025993pbc.66.2015.02.20.09.10.22 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 20 Feb 2015 09:10:25 -0800 (PST) From: Masahiro Yamada To: u-boot@lists.denx.de Date: Sat, 21 Feb 2015 02:09:57 +0900 Message-Id: <1424452201-2960-3-git-send-email-yamada.m@jp.panasonic.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1424452201-2960-1-git-send-email-yamada.m@jp.panasonic.com> References: <1424452201-2960-1-git-send-email-yamada.m@jp.panasonic.com> Cc: Alexey Brodkin , Michal Simek , Tom Warren , Tom Rini , Stefan Roese Subject: [U-Boot] [PATCH v4 2/6] malloc_f: fix broken .config caused by CONFIG_SYS_MALLOC_F 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" Since commit b724bd7d6349 (dm: Kconfig: Move CONFIG_SYS_MALLOC_F_LEN to Kconfig), the ".config" created by the configuration has been wrong. For example, the following is a snippet of the ".config" generated by "make beaver_defconfig": --------------->8----------------- CONFIG_CC_OPTIMIZE_FOR_SIZE=y # CONFIG_SYS_MALLOC_F is not set CONFIG_SYS_MALLOC_F_LEN=0x1800 # CONFIG_EXPERT is not set ---------------8<----------------- CONFIG_SYS_MALLOC_F_LEN is supposed to depend on CONFIG_SYS_MALLOC_F (see the top level Kconfig), but the ".config" above is not actually following that dependency. This is caused by two mistakes of commit b724bd7d6349. [1] Wrong default value of CONFIG_SYS_MALLOC_F CONFIG_SYS_MALLOC_F is a boolean option, but its default value is set to 0x400. [2] Missing "if SYS_MALLOC_F" in the default setting in each Kconfig For example, arch/arm/cpu/armv7/tegra-common/Kconfig has the line "default 0x1800" for SYS_MALLOC_F_LEN. It must be described as "default 0x1800 if SYS_MALLOC_F" to follow the dependency. Those two bugs together create such a broken ".config". Unfortunately, even if we correct both [1] and [2], the value of CONFIG_SYS_MALLOC_F_LEN is not set as we expect. The "default 0x1800 if SYS_MALLOC_F" would be simply ignored because the "default 0x400" in the top level Kconfig is parsed first. Notice that if multiple default lines appear for the same CONFIG, the first one takes precedence. This commit corrects [1] and [2] so as not to create a broken .config file in any cases. Note that the default values in arch/arm/cpu/armv7/tegra-common/Kconfig and arch/x86/Kconfig are not working at this moment. This will be solved by the next commit. The default value 0x400 is redundant for OMAP, Exynos, UniPhier, etc. They can be simply removed. There are still redundant "CONFIG_SYS_MALLOC_F_LEN=0x400" in many defconfig files, but this commit is not touching them. Signed-off-by: Masahiro Yamada --- Changes in v3: - Drop comments "This is meaningless ..." - Update commit description Changes in v2: None Kconfig | 1 - arch/arm/cpu/armv7/exynos/Kconfig | 3 --- arch/arm/cpu/armv7/omap3/Kconfig | 3 --- arch/arm/cpu/armv7/tegra-common/Kconfig | 2 +- arch/arm/cpu/armv7/uniphier/Kconfig | 3 --- arch/x86/Kconfig | 2 +- board/amcc/canyonlands/Kconfig | 4 ---- board/ti/am335x/Kconfig | 3 --- 8 files changed, 2 insertions(+), 19 deletions(-) diff --git a/Kconfig b/Kconfig index 75bab7f..d40f9ec 100644 --- a/Kconfig +++ b/Kconfig @@ -58,7 +58,6 @@ config CC_OPTIMIZE_FOR_SIZE config SYS_MALLOC_F bool "Enable malloc() pool before relocation" - default 0x400 help Before relocation memory is very limited on many platforms. Still, we can provide a small malloc() pool if needed. Driver model in diff --git a/arch/arm/cpu/armv7/exynos/Kconfig b/arch/arm/cpu/armv7/exynos/Kconfig index 2064efa..23869ce 100644 --- a/arch/arm/cpu/armv7/exynos/Kconfig +++ b/arch/arm/cpu/armv7/exynos/Kconfig @@ -83,9 +83,6 @@ config DM_GPIO config SYS_MALLOC_F default y if !SPL_BUILD -config SYS_MALLOC_F_LEN - default 0x400 if !SPL_BUILD - source "board/samsung/smdkv310/Kconfig" source "board/samsung/trats/Kconfig" source "board/samsung/universal_c210/Kconfig" diff --git a/arch/arm/cpu/armv7/omap3/Kconfig b/arch/arm/cpu/armv7/omap3/Kconfig index 4644098..2e193ab 100644 --- a/arch/arm/cpu/armv7/omap3/Kconfig +++ b/arch/arm/cpu/armv7/omap3/Kconfig @@ -105,9 +105,6 @@ config DM_SERIAL config SYS_MALLOC_F default y if DM && !SPL_BUILD -config SYS_MALLOC_F_LEN - default 0x400 if DM && !SPL_BUILD - config SYS_SOC default "omap3" diff --git a/arch/arm/cpu/armv7/tegra-common/Kconfig b/arch/arm/cpu/armv7/tegra-common/Kconfig index ee32469..8b51558 100644 --- a/arch/arm/cpu/armv7/tegra-common/Kconfig +++ b/arch/arm/cpu/armv7/tegra-common/Kconfig @@ -21,7 +21,7 @@ config SYS_MALLOC_F default y config SYS_MALLOC_F_LEN - default 0x1800 + default 0x1800 if SYS_MALLOC_F config USE_PRIVATE_LIBGCC default y if SPL_BUILD diff --git a/arch/arm/cpu/armv7/uniphier/Kconfig b/arch/arm/cpu/armv7/uniphier/Kconfig index 8fdef28..371b274 100644 --- a/arch/arm/cpu/armv7/uniphier/Kconfig +++ b/arch/arm/cpu/armv7/uniphier/Kconfig @@ -51,9 +51,6 @@ endchoice config SYS_MALLOC_F default y -config SYS_MALLOC_F_LEN - default 0x400 - config CMD_PINMON bool "Enable boot mode pins monitor command" default y diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index 35d24e4..65909e7 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig @@ -80,7 +80,7 @@ config SYS_MALLOC_F default y config SYS_MALLOC_F_LEN - default 0x800 + default 0x800 if SYS_MALLOC_F config RAMBASE hex diff --git a/board/amcc/canyonlands/Kconfig b/board/amcc/canyonlands/Kconfig index 848e08f..c0dbd18 100644 --- a/board/amcc/canyonlands/Kconfig +++ b/board/amcc/canyonlands/Kconfig @@ -43,8 +43,4 @@ config SYS_MALLOC_F bool default y -config SYS_MALLOC_F_LEN - hex - default 0x400 - endif diff --git a/board/ti/am335x/Kconfig b/board/ti/am335x/Kconfig index a20e0c1..cad10c2 100644 --- a/board/ti/am335x/Kconfig +++ b/board/ti/am335x/Kconfig @@ -50,7 +50,4 @@ config DM_SERIAL config SYS_MALLOC_F default y if DM && !SPL_BUILD -config SYS_MALLOC_F_LEN - default 0x400 if DM && !SPL_BUILD - endif