From patchwork Fri Mar 1 05:26:13 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 224237 X-Patchwork-Delegate: sjg@chromium.org 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 033CA2C029D for ; Fri, 1 Mar 2013 16:27:54 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id B9AD54A09D; Fri, 1 Mar 2013 06:27:37 +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 TWYDNAEerlAG; Fri, 1 Mar 2013 06:27:37 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 4CCA44A0ED; Fri, 1 Mar 2013 06:26:46 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id F15D34A041 for ; Fri, 1 Mar 2013 06:26:36 +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 acqblAsUUpIK for ; Fri, 1 Mar 2013 06:26:35 +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-yh0-f74.google.com (mail-yh0-f74.google.com [209.85.213.74]) by theia.denx.de (Postfix) with ESMTPS id C113A4A04A for ; Fri, 1 Mar 2013 06:26:27 +0100 (CET) Received: by mail-yh0-f74.google.com with SMTP id z6so297874yhz.1 for ; Thu, 28 Feb 2013 21:26:24 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references:x-gm-message-state; bh=RY1G1eT3IRfyr8IRRdtMfTrO5Ih5e0LE1JT3dgbQhto=; b=M2ZC5uvF3nYMT2313CVbpKRJZfhzeagucgIeNkB4RjwKsXXG2pGb2sk5A6FZFdFvT7 7raKBznNJCIT+j0SY+MWVzD+CfePcjZghT4flkcSa010sTxDXjXciR0F7I7vJXNBaBqH D9nWuieh7oeQ4jLoh2FLoV+iSiYczBH7rhwBaFhdYrD3MC9mEwOiz4xot/yM0to3iVZ1 uc6Y8Q/hyNHu1WLGQqiGlBxAt12a9xLy2JdojM7jIgRvH/QHtY7HtGw3C8tDz6EGy22K Sr8s7+wi21rblF6XqGpjMAGyuMOD002Rgc1C85B35knaFbrufwGji201yI2QZ+mwgJ4b d2HQ== X-Received: by 10.236.103.72 with SMTP id e48mr5387482yhg.36.1362115584778; Thu, 28 Feb 2013 21:26:24 -0800 (PST) Received: from corp2gmr1-1.hot.corp.google.com (corp2gmr1-1.hot.corp.google.com [172.24.189.92]) by gmr-mx.google.com with ESMTPS id u21si706680yhj.0.2013.02.28.21.26.24 (version=TLSv1.1 cipher=AES128-SHA bits=128/128); Thu, 28 Feb 2013 21:26:24 -0800 (PST) Received: from kaka.mtv.corp.google.com (kaka.mtv.corp.google.com [172.22.73.79]) by corp2gmr1-1.hot.corp.google.com (Postfix) with ESMTP id 9FF0331C194; Thu, 28 Feb 2013 21:26:24 -0800 (PST) Received: by kaka.mtv.corp.google.com (Postfix, from userid 121222) id 4F3841608AB; Thu, 28 Feb 2013 21:26:24 -0800 (PST) From: Simon Glass To: U-Boot Mailing List Date: Thu, 28 Feb 2013 21:26:13 -0800 Message-Id: <1362115578-12165-4-git-send-email-sjg@chromium.org> X-Mailer: git-send-email 1.8.1.3 In-Reply-To: <1362115578-12165-1-git-send-email-sjg@chromium.org> References: <1362115578-12165-1-git-send-email-sjg@chromium.org> X-Gm-Message-State: ALoCoQmbkg4WvZprsBC5de865YuEzOnIm7SKLpd7Uz7+OZie5lRAXZKzfuhQllAklVl5aCBkmQzKrbdUWEJL8izzavk06PLuyxxxmZQp+5VsWpt96zr4WVINOwpnyRhuGcKKhZu6ZA25OE9bX09L/MUmawZQ7sWozQ7j1pCamgGUqkPg0o+6SETZi9FsIgIANHug1qH2o/LD Cc: Graeme Russ Subject: [U-Boot] [PATCH v2 4/9] x86: Add an __end symbol to signal the end of the U-Boot binary 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: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de With this symbol we can easy append something (e.g. an FDT) to the U-Boot binary and access it from within U-Boot. Signed-off-by: Simon Glass --- Changes in v2: - Use _end instead of __end to fit in with other archs arch/x86/cpu/u-boot.lds | 2 ++ arch/x86/include/asm/u-boot-x86.h | 1 + arch/x86/lib/init_helpers.c | 2 +- 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/arch/x86/cpu/u-boot.lds b/arch/x86/cpu/u-boot.lds index 2313cd7..8e185f3 100644 --- a/arch/x86/cpu/u-boot.lds +++ b/arch/x86/cpu/u-boot.lds @@ -67,6 +67,8 @@ SECTIONS __rel_dyn_start = .; .rel.dyn : { *(.rel.dyn) } __rel_dyn_end = .; + . = ALIGN(4); + _end = .; /DISCARD/ : { *(.dynstr*) } /DISCARD/ : { *(.dynamic*) } diff --git a/arch/x86/include/asm/u-boot-x86.h b/arch/x86/include/asm/u-boot-x86.h index 99062e5..948615d 100644 --- a/arch/x86/include/asm/u-boot-x86.h +++ b/arch/x86/include/asm/u-boot-x86.h @@ -31,6 +31,7 @@ extern ulong __rel_dyn_start; extern ulong __rel_dyn_end; extern ulong __bss_start; extern ulong __bss_end; +extern ulong _end; /* cpu/.../cpu.c */ int x86_cpu_init_r(void); diff --git a/arch/x86/lib/init_helpers.c b/arch/x86/lib/init_helpers.c index 1a097f1..ff2d21f 100644 --- a/arch/x86/lib/init_helpers.c +++ b/arch/x86/lib/init_helpers.c @@ -188,7 +188,7 @@ int find_fdt(void) gd->fdt_blob = _binary_dt_dtb_start; #elif defined CONFIG_OF_SEPARATE /* FDT is at end of image */ - gd->fdt_blob = (void *)(_end_ofs + _TEXT_BASE); + gd->fdt_blob = (ulong *)&_end; #endif /* Allow the early environment to override the fdt address */ gd->fdt_blob = (void *)getenv_ulong("fdtcontroladdr", 16,