From patchwork Sat Dec 29 20:10:50 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeroen Hofstee X-Patchwork-Id: 208683 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 6E0972C00BD for ; Sun, 30 Dec 2012 07:11:01 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 6B8EF4A0EB; Sat, 29 Dec 2012 21:10:58 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at theia.denx.de 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 QKTzpT2D7Tc8; Sat, 29 Dec 2012 21:10:57 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id E4C634A0C0; Sat, 29 Dec 2012 21:10:56 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 46A054A0C0 for ; Sat, 29 Dec 2012 21:10:54 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at theia.denx.de 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 A9vDCUUlAcbO for ; Sat, 29 Dec 2012 21:10:53 +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.virtualhost.nl (mail.virtualhost.nl [89.200.201.133]) by theia.denx.de (Postfix) with ESMTP id 19E414A0BD for ; Sat, 29 Dec 2012 21:10:51 +0100 (CET) Received: (qmail 53570 invoked by uid 1141); 29 Dec 2012 21:10:45 +0100 Received: from ip120-12-208-87.adsl2.static.versatel.nl (HELO black) (87.208.12.120) (smtp-auth username dasuboot@myspectrum.nl, mechanism plain) by mail.virtualhost.nl (qpsmtpd/0.84) with ESMTPA; Sat, 29 Dec 2012 21:10:45 +0100 Date: Sat, 29 Dec 2012 21:10:50 +0100 From: Jeroen Hofstee To: u-boot@lists.denx.de Message-ID: <20121229211050.3249f8b7@black> In-Reply-To: <20121229203157.0f50ba5e@black> References: <20121229203157.0f50ba5e@black> Mime-Version: 1.0 Subject: Re: [U-Boot] [RFC]: always relocate u-boot before the framebuffer X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de > Currently CONFIG_FB_ADDR can be set to specify the location of the > frame buffer. Since Linux places the frame buffer at the end of the > RAM, it is nice to place it at the same position so the u-boot to > linux transition can be made flicker free, by preserving the > frame buffer. However u-boot and it's heap prefer to locate themselves > at the end of the RAM as well and there is nothing which prevents them > to overlap. > > While this can be set/calculated manually, it would be nicer if the > relocation would never take place to the region occupied by the > frame buffer. A simple way to do so is to locate u-boot before the > frame buffer, like it is already done when the frame buffer address is > not set. > > Currently there are 2 boards using the CONFIG_FB_ADDR and CONFIG_LCD > on arm (trats, mimc200). Would it cause any problem to relocate > u-boot below the frame buffer on these boards? My apologies, I pasted half the patch, the intention is to always set addr = gd->fb_base. This should be the complete one: diff --git a/arch/arm/lib/board.c b/arch/arm/lib/board.c index e0cb635..4d0fc3c 100644 --- a/arch/arm/lib/board.c +++ b/arch/arm/lib/board.c @@ -371,9 +371,10 @@ void board_init_f(ulong bootflag) gd->fb_base = CONFIG_FB_ADDR; #else /* reserve memory for LCD display (always full pages) */ - addr = lcd_setmem(addr); - gd->fb_base = addr; + gd->fb_base = lcd_setmem(addr); #endif /* CONFIG_FB_ADDR */ + /* always continue placement below the frame buffer to not overlap */ + addr = gd->fb_base; #endif /* CONFIG_LCD */