From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ira W. Snyder Date: Fri, 15 Oct 2010 08:29:03 -0700 Subject: [U-Boot] [PATCH] Ensure gd->ram_size end stays on 4k page boundary when 'hiding' RAM In-Reply-To: <4CB86A84.50807@rocketmail.com> References: <4CB86A84.50807@rocketmail.com> Message-ID: <20101015152902.GA28972@ovro.caltech.edu> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Fri, Oct 15, 2010 at 03:51:48PM +0100, Gray Remlin wrote: > Signed-off-by: Gray Remlin > --- > arch/arm/lib/board.c | 3 ++- > 1 files changed, 2 insertions(+), 1 deletions(-) > > diff --git a/arch/arm/lib/board.c b/arch/arm/lib/board.c > index 22bd2c9..c1b21f5 100644 > --- a/arch/arm/lib/board.c > +++ b/arch/arm/lib/board.c > @@ -531,8 +531,9 @@ void board_init_f (ulong bootflag) > * arch/powerpc with bootwrapper support, that recalculate the > * memory size from the SDRAM controller setup will have to > * get fixed. > + * Ensure gd->ram_size end is still on a 4k page boundary. > */ > - gd->ram_size -= CONFIG_SYS_MEM_TOP_HIDE; > + gd->ram_size -= ((CONFIG_SYS_MEM_TOP_HIDE + 0xFFF) & ~(0xFFF)); > #endif How about this easier to read version: gd->ram_size -= roundup(CONFIG_SYS_MEM_TOP_HIDE, 4096); Ira > > addr = CONFIG_SYS_SDRAM_BASE + gd->ram_size; > -- > _______________________________________________ > U-Boot mailing list > U-Boot at lists.denx.de > http://lists.denx.de/mailman/listinfo/u-boot