From patchwork Mon Jan 3 19:46:25 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Graeme Russ X-Patchwork-Id: 77312 X-Patchwork-Delegate: graeme.russ@gmail.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 81350B70EA for ; Tue, 4 Jan 2011 06:48:20 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 137ED28298; Mon, 3 Jan 2011 20:47:49 +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 DW6eJzRwf0D9; Mon, 3 Jan 2011 20:47:48 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 29C24282A4; Mon, 3 Jan 2011 20:47:41 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 5D6DB28243 for ; Mon, 3 Jan 2011 20:47:39 +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 JrrA37nrcOiY for ; Mon, 3 Jan 2011 20:47:38 +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-fx0-f44.google.com (mail-fx0-f44.google.com [209.85.161.44]) by theia.denx.de (Postfix) with ESMTP id 2FEE92827E for ; Mon, 3 Jan 2011 20:47:29 +0100 (CET) Received: by mail-fx0-f44.google.com with SMTP id 9so12889169fxm.3 for ; Mon, 03 Jan 2011 11:47:29 -0800 (PST) Received: by 10.103.233.7 with SMTP id k7mr1557087mur.131.1294084049076; Mon, 03 Jan 2011 11:47:29 -0800 (PST) Received: from helios.localdomain6 (d122-104-38-246.sbr6.nsw.optusnet.com.au [122.104.38.246]) by mx.google.com with ESMTPS id a6sm3124092fak.1.2011.01.03.11.47.25 (version=SSLv3 cipher=RC4-MD5); Mon, 03 Jan 2011 11:47:28 -0800 (PST) From: Graeme Russ To: u-boot@lists.denx.de Date: Tue, 4 Jan 2011 06:46:25 +1100 Message-Id: <1294084016-2674-6-git-send-email-graeme.russ@gmail.com> X-Mailer: git-send-email 1.7.1.422.g049e9 In-Reply-To: <1294084016-2674-1-git-send-email-graeme.russ@gmail.com> References: <1294084016-2674-1-git-send-email-graeme.russ@gmail.com> Subject: [U-Boot] [RFC][PATCH 05/36] x86 - Paramatize link locations 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: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de --- arch/i386/cpu/config.mk | 6 ++++++ arch/i386/cpu/u-boot.lds | 22 +++++++--------------- board/eNET/config.mk | 1 + 3 files changed, 14 insertions(+), 15 deletions(-) --- 1.7.1.422.g049e9 diff --git a/arch/i386/cpu/config.mk b/arch/i386/cpu/config.mk index 99edacf..83ce73c 100644 --- a/arch/i386/cpu/config.mk +++ b/arch/i386/cpu/config.mk @@ -25,3 +25,9 @@ CROSS_COMPILE ?= i386-linux- PLATFORM_CPPFLAGS += -DCONFIG_I386 -D__I386__ PLATFORM_CPPFLAGS += -march=i386 -Werror + +# DO NOT MODIFY THE FOLLOWING UNLESS YOU REALLY KNOW WHAT YOU ARE DOING! +LDPPFLAGS += -DRESET_SEG_START=0xffff0000 +LDPPFLAGS += -DRESET_SEG_SIZE=0x10000 +LDPPFLAGS += -DRESET_VEC_LOC=0xfff0 +LDPPFLAGS += -DSTART_16=0xf800 diff --git a/arch/i386/cpu/u-boot.lds b/arch/i386/cpu/u-boot.lds index 3eeb2a2..e712d26 100644 --- a/arch/i386/cpu/u-boot.lds +++ b/arch/i386/cpu/u-boot.lds @@ -84,21 +84,13 @@ SECTIONS __bios_start = LOADADDR(.bios); __bios_size = SIZEOF(.bios); - /* The load addresses below assumes that the flash - * will be mapped so that 0x387f0000 == 0xffff0000 - * at reset time - * - * The fe00 and ff00 offsets of the start32 and start16 - * segments are arbitrary, the just have to be mapped - * at reset and the code have to fit. - * The fff0 offset of resetvec is important, however. + /* + * The following expressions place the 16-bit Real-Mode code and + * Reset Vector at the end of the Flash ROM */ - . = 0xfffffe00; - .start32 : AT (CONFIG_SYS_TEXT_BASE + 0x3fe00) { KEEP(*(.start32)); } + . = START_16; + .start16 : AT (CONFIG_SYS_TEXT_BASE + (FLASH_SIZE - RESET_SEG_SIZE + START_16)) { KEEP(*(.start16)); } - . = 0xf800; - .start16 : AT (CONFIG_SYS_TEXT_BASE + 0x3f800) { KEEP(*(.start16)); } - - . = 0xfff0; - .resetvec : AT (CONFIG_SYS_TEXT_BASE + 0x3fff0) { KEEP(*(.resetvec)); } + . = RESET_VEC_LOC; + .resetvec : AT (CONFIG_SYS_TEXT_BASE + (FLASH_SIZE - RESET_SEG_SIZE + RESET_VEC_LOC)) { KEEP(*(.resetvec)); } } diff --git a/board/eNET/config.mk b/board/eNET/config.mk index 02e4147..4e066b4 100644 --- a/board/eNET/config.mk +++ b/board/eNET/config.mk @@ -23,3 +23,4 @@ CONFIG_SYS_TEXT_BASE = 0x06000000 CFLAGS_common/dlmalloc.o += -Wa,--no-warn -fno-strict-aliasing +LDPPFLAGS += -DFLASH_SIZE=0x40000