From patchwork Wed Feb 9 11:17:55 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Estevam X-Patchwork-Id: 82449 X-Patchwork-Delegate: sbabic@denx.de 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 B889AB70AF for ; Wed, 9 Feb 2011 22:09:52 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 7136A2818C; Wed, 9 Feb 2011 12:09:48 +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 gBwed4OStbu0; Wed, 9 Feb 2011 12:09:48 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 1D81028166; Wed, 9 Feb 2011 12:09:47 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 2078928185 for ; Wed, 9 Feb 2011 12:09:45 +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 MjG0vQi3sW5f for ; Wed, 9 Feb 2011 12:09:43 +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 AM1EHSOBE004.bigfish.com (am1ehsobe004.messaging.microsoft.com [213.199.154.207]) by theia.denx.de (Postfix) with ESMTPS id 059682807F for ; Wed, 9 Feb 2011 12:09:41 +0100 (CET) Received: from mail30-am1-R.bigfish.com (10.3.201.250) by AM1EHSOBE004.bigfish.com (10.3.204.24) with Microsoft SMTP Server id 14.1.225.8; Wed, 9 Feb 2011 11:09:40 +0000 Received: from mail30-am1 (localhost.localdomain [127.0.0.1]) by mail30-am1-R.bigfish.com (Postfix) with ESMTP id A95D51080365; Wed, 9 Feb 2011 11:09:40 +0000 (UTC) X-SpamScore: 3 X-BigFish: VS3(zzc8kzz1202hzz8275bhz2dh2a8h668h61h) X-Spam-TCS-SCL: 0:0 X-Forefront-Antispam-Report: KIP:(null); UIP:(null); IPVD:NLI; H:de01egw01.freescale.net; RD:de01egw01.freescale.net; EFVD:NLI Received: from mail30-am1 (localhost.localdomain [127.0.0.1]) by mail30-am1 (MessageSwitch) id 1297249780382035_15382; Wed, 9 Feb 2011 11:09:40 +0000 (UTC) Received: from AM1EHSMHS004.bigfish.com (unknown [10.3.201.242]) by mail30-am1.bigfish.com (Postfix) with ESMTP id 598B84F0050; Wed, 9 Feb 2011 11:09:40 +0000 (UTC) Received: from de01egw01.freescale.net (192.88.165.102) by AM1EHSMHS004.bigfish.com (10.3.207.104) with Microsoft SMTP Server (TLS) id 14.1.225.8; Wed, 9 Feb 2011 11:09:39 +0000 Received: from az33smr01.freescale.net (az33smr01.freescale.net [10.64.34.199]) by de01egw01.freescale.net (8.14.3/8.14.3) with ESMTP id p19B9bsU000193; Wed, 9 Feb 2011 04:09:38 -0700 (MST) Received: from localhost.localdomain ([10.29.240.182]) by az33smr01.freescale.net (8.13.1/8.13.0) with ESMTP id p19B9XLh009022; Wed, 9 Feb 2011 05:09:35 -0600 (CST) From: Fabio Estevam To: Date: Wed, 9 Feb 2011 09:17:55 -0200 Message-ID: <1297250276-16007-2-git-send-email-fabio.estevam@freescale.com> X-Mailer: git-send-email 1.6.0.4 In-Reply-To: <1297250276-16007-1-git-send-email-fabio.estevam@freescale.com> References: <1297250276-16007-1-git-send-email-fabio.estevam@freescale.com> MIME-Version: 1.0 X-OriginatorOrg: freescale.com Cc: Fabio Estevam , lilja.magnus@gmail.com Subject: [U-Boot] [PATCH 2/3] mx31pdk: Use the new relocation scheme X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.9 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 Signed-off-by: Fabio Estevam --- board/freescale/mx31pdk/mx31pdk.c | 10 ++++- include/configs/mx31pdk.h | 6 +++ nand_spl/board/freescale/mx31pdk/u-boot.lds | 59 +++++++++++++++++++++++--- 3 files changed, 66 insertions(+), 9 deletions(-) diff --git a/board/freescale/mx31pdk/mx31pdk.c b/board/freescale/mx31pdk/mx31pdk.c index 9f47169..2756e5a 100644 --- a/board/freescale/mx31pdk/mx31pdk.c +++ b/board/freescale/mx31pdk/mx31pdk.c @@ -33,10 +33,16 @@ DECLARE_GLOBAL_DATA_PTR; int dram_init(void) { + /* dram_init must store complete ramsize in gd->ram_size */ + gd->ram_size = get_ram_size((volatile void *)CONFIG_SYS_SDRAM_BASE, + PHYS_SDRAM_1_SIZE); + return 0; +} + +void dram_init_banksize(void) +{ gd->bd->bi_dram[0].start = PHYS_SDRAM_1; gd->bd->bi_dram[0].size = PHYS_SDRAM_1_SIZE; - - return 0; } int board_init(void) diff --git a/include/configs/mx31pdk.h b/include/configs/mx31pdk.h index 3b90a01..d7286c0 100644 --- a/include/configs/mx31pdk.h +++ b/include/configs/mx31pdk.h @@ -155,6 +155,12 @@ #define PHYS_SDRAM_1 CSD0_BASE #define PHYS_SDRAM_1_SIZE (128 * 1024 * 1024) +#define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM_1 +#define CONFIG_SYS_INIT_RAM_ADDR IRAM_BASE_ADDR +#define CONFIG_SYS_INIT_RAM_SIZE IRAM_SIZE +#define CONFIG_SYS_GBL_DATA_OFFSET (CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE) +#define CONFIG_SYS_INIT_SP_ADDR (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_GBL_DATA_OFFSET) + /*----------------------------------------------------------------------- * FLASH and environment organization */ diff --git a/nand_spl/board/freescale/mx31pdk/u-boot.lds b/nand_spl/board/freescale/mx31pdk/u-boot.lds index edd8430..ff289fb 100644 --- a/nand_spl/board/freescale/mx31pdk/u-boot.lds +++ b/nand_spl/board/freescale/mx31pdk/u-boot.lds @@ -1,3 +1,25 @@ +/* + * (C) Copyright 2009 + * Wolfgang Denk, DENX Software Engineering, wd@denx.de. + * + * See file CREDITS for list of people who contributed to this + * project. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + */ OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm") OUTPUT_ARCH(arm) ENTRY(_start) @@ -19,18 +41,41 @@ SECTIONS .rodata : { *(.rodata) } . = ALIGN(4); - .data : { *(.data) } + .data : { + *(.data) + } . = ALIGN(4); - .got : { *(.got) } - - . = .; __u_boot_cmd_start = .; .u_boot_cmd : { *(.u_boot_cmd) } __u_boot_cmd_end = .; . = ALIGN(4); - __bss_start = .; - .bss : { *(.bss) } - _end = .; + + .rel.dyn : { + __rel_dyn_start = .; + *(.rel*) + __rel_dyn_end = .; + } + + .dynsym : { + __dynsym_start = .; + *(.dynsym) + } + + .bss __rel_dyn_start (OVERLAY) : { + __bss_start = .; + *(.bss) + . = ALIGN(4); + _end = .; + } + + /DISCARD/ : { *(.bss*) } + /DISCARD/ : { *(.dynstr*) } + /DISCARD/ : { *(.dynsym*) } + /DISCARD/ : { *(.dynamic*) } + /DISCARD/ : { *(.hash*) } + /DISCARD/ : { *(.plt*) } + /DISCARD/ : { *(.interp*) } + /DISCARD/ : { *(.gnu*) } }