From mboxrd@z Thu Jan 1 00:00:00 1970 From: Heiko Schocher Date: Thu, 15 Mar 2012 06:13:34 +0100 Subject: [U-Boot] [PATCH] arm: Don't use printf() in SPL builds In-Reply-To: References: <1330806795-20763-1-git-send-email-sjg@chromium.org> <20120310083345.GA6861@Hardy> Message-ID: <4F617A7E.9020802@denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hello Simon, Simon Glass wrote: > Hi Sughosh, > > On Sat, Mar 10, 2012 at 12:33 AM, Sughosh Ganu wrote: >> hi Simon, >> >> On Sat Mar 03, 2012 at 12:33:15PM -0800, Simon Glass wrote: >>> raise() likes to call printf() if it is available, but in SPL builds it >>> either is not available, or adds a large chunk to the resulting image >>> size. >>> >>> So don't call it even if it is available. >>> >>> This change reduces SPL size from 10KB to 6.3KB on hawkboard, for >>> example, using generic relocation. >>> >>> Signed-off-by: Simon Glass >>> --- >>> arch/arm/lib/eabi_compat.c | 3 ++- >>> 1 files changed, 2 insertions(+), 1 deletions(-) >>> >>> diff --git a/arch/arm/lib/eabi_compat.c b/arch/arm/lib/eabi_compat.c >>> index 2028dbd..44eebe0 100644 >>> --- a/arch/arm/lib/eabi_compat.c >>> +++ b/arch/arm/lib/eabi_compat.c >>> @@ -13,7 +13,8 @@ >>> >>> int raise (int signum) >>> { >>> -#if !defined(CONFIG_SPL_BUILD) || defined(CONFIG_SPL_LIBCOMMON_SUPPORT) >>> + /* Even if printf() is available, it's large. Punt it for SPL builds */ >>> +#if !defined(CONFIG_SPL_BUILD) >>> printf("raise: Signal # %d caught\n", signum); >>> #endif >> I tested with this change on hawkboard, and after applying this >> change, the spl size increase is 412 bytes against the 4k increase >> that we get with libcommon changes introduced. So this patch works >> fine. > > OK good. > >> Can you please check if libcommon support is needed for the >> cam_enc_4xx board -- your relocation patch series did not add >> CONFIG_SPL_LIBCOMMON_SUPPORT to this board. This will affect my >> patch to initialise gd and bd objects for hawkboard. Please let me >> know, and i will spin a patch accordingly. > > Yes I think this board needs both of these: > > #define CONFIG_SPL_LIBCOMMON_SUPPORT > #define CONFIG_SPL_LIBGENERIC_SUPPORT I posted a patch, which adds CONFIG_SPL_LIBGENERIC_SUPPORT, see http://patchwork.ozlabs.org/patch/145280/ for this board. Build/works fine without CONFIG_SPL_LIBCOMMON_SUPPORT maybe I miss something? Builded with ELDK-4.2 and ELDK-5.1 based on commit: commit e37ae40e9dec9af417c19de72f76becebf160730 Author: Stephen Warren Date: Tue Nov 1 06:28:21 2011 +0000 image: Support FDTs already loaded at their load address bye, Heiko -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany