From patchwork Thu Mar 15 02:16:15 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 146808 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 D757CB6F13 for ; Thu, 15 Mar 2012 13:19:49 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id AD4AB280EE; Thu, 15 Mar 2012 03:19:32 +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 2taDt-DDkaw0; Thu, 15 Mar 2012 03:19:32 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 1F5E6280DD; Thu, 15 Mar 2012 03:17:32 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id A913E280A1 for ; Thu, 15 Mar 2012 03:17:12 +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 lgSxtPnP0NsG for ; Thu, 15 Mar 2012 03:17:11 +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-vx0-f202.google.com (mail-vx0-f202.google.com [209.85.220.202]) by theia.denx.de (Postfix) with ESMTPS id B9D86280A6 for ; Thu, 15 Mar 2012 03:17:02 +0100 (CET) Received: by vcbfk26 with SMTP id fk26so413165vcb.3 for ; Wed, 14 Mar 2012 19:17:01 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=ufSWaOQJqYbWin5f1it5F56X3s19am0VWr+zFBOJtaM=; b=jcfQsl5PfoGge4q+5UnYbb1ZjFzkqxhPANDytD2lQCIEdO9CtRQx4tbS3Egsm5HCpf QTw8fJ41jZ2Zwpoo7Uy7YjuvlF6SLFgoMj2bPYvr0B1OBxBjLsPYMzUDqfgy/CKYPsvb 6fNrHbXK0s6sxh7SlGMJ+RTvhJYQ4EjXmcBR5q9QeAp+ncWOeBHiAXYaQU3wms7BkOA7 wPkWmlz53vFZBTNU6rEVZAXHLuWOR70/JD//DVllFf6TMf3lToskqcnR4O2A7I5kVQm2 GLQFY+xJW3BO1sN0ErmG+JGFVJsKhb5a7h7eF3wTUbd5IjmkkRXuCZn7hR48CEEHbUG9 LE8Q== Received: by 10.236.175.196 with SMTP id z44mr4165128yhl.6.1331777821271; Wed, 14 Mar 2012 19:17:01 -0700 (PDT) Received: by 10.236.175.196 with SMTP id z44mr4165109yhl.6.1331777821182; Wed, 14 Mar 2012 19:17:01 -0700 (PDT) Received: from wpzn3.hot.corp.google.com (216-239-44-65.google.com [216.239.44.65]) by gmr-mx.google.com with ESMTPS id d10si149226anf.1.2012.03.14.19.17.01 (version=TLSv1/SSLv3 cipher=AES128-SHA); Wed, 14 Mar 2012 19:17:01 -0700 (PDT) Received: from sglass.mtv.corp.google.com (dhcp-172-22-162-38.mtv.corp.google.com [172.22.162.38]) by wpzn3.hot.corp.google.com (Postfix) with ESMTP id 14A7210004D; Wed, 14 Mar 2012 19:17:01 -0700 (PDT) Received: by sglass.mtv.corp.google.com (Postfix, from userid 121222) id EA23114127B; Wed, 14 Mar 2012 19:17:00 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Date: Wed, 14 Mar 2012 19:16:15 -0700 Message-Id: <1331777784-8528-19-git-send-email-sjg@chromium.org> X-Mailer: git-send-email 1.7.7.3 In-Reply-To: <1331777784-8528-1-git-send-email-sjg@chromium.org> References: <1331777784-8528-1-git-send-email-sjg@chromium.org> X-Gm-Message-State: ALoCoQl5DFGcPjQ9d6j1F1aXUkzAQRFqrmOwsUU73KxKnHqoEQfmysQ7yT0FAubYkYRqmCy4j7V7ixFgygiiSgGdJNzYGs+mn4euNKNYGAYCjHZSpTWfkJ7tc9I6M7/tQ37FnyFYxN2mMQn3DPvfXt9nyorteUhrNsqraaRzrBZxsIZ8yfHoB6s= Subject: [U-Boot] [PATCH v4 18/27] Add CONFIG_SYS_SYM_OFFSETS to support offset symbols 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 Link symbols as created by the link script can either be absolute or relative to the text start. This option switches between the two options so that we can support both. As we convert architectures over to generic board, we can see if this option is actually needed, or whether it is possible to unify this feature also. Signed-off-by: Simon Glass --- README | 6 ++++++ common/board_f.c | 11 +++++++++++ 2 files changed, 17 insertions(+), 0 deletions(-) diff --git a/README b/README index f471627..251afaf 100644 --- a/README +++ b/README @@ -2780,6 +2780,12 @@ Configuration Settings: its config.mk file). If you find problems enabling this option on your board please report the problem and send patches! +- CONFIG_SYS_SYM_OFFSETS + This is set by architectures that use offsets for link symbols + instead of absolute values. So bss_start is obtained using an + offset _bss_start_ofs from CONFIG_SYS_TEXT_BASE, rather than + directly. You should not need to touch this setting. + The following definitions that deal with the placement and management of environment data (variable area); in general, we support the diff --git a/common/board_f.c b/common/board_f.c index a08f0a1..2f14118 100644 --- a/common/board_f.c +++ b/common/board_f.c @@ -108,8 +108,13 @@ static int display_text_info(void) { ulong bss_start, bss_end; +#ifdef CONFIG_SYS_SYM_OFFSETS bss_start = _bss_start_ofs + _TEXT_BASE; bss_end = _bss_end_ofs + _TEXT_BASE; +#else + bss_start = (ulong)&__bss_start; + bss_end = (ulong)&__bss_end; +#endif debug("U-Boot code: %08X -> %08lX BSS: -> %08lX\n", CONFIG_SYS_TEXT_BASE, bss_start, bss_end); @@ -186,7 +191,11 @@ static int zero_global_data(void) static int setup_mon_len(void) { +#ifdef CONFIG_SYS_SYM_OFFSETS gd->mon_len = _bss_end_ofs; +#else + gd->mon_len = (ulong)&__bss_end - (ulong)&__text_start; +#endif return 0; } @@ -423,6 +432,7 @@ static int jump_to_copy(void) static init_fnc_t init_sequence_f[] = { setup_global_data_ptr, + zero_global_data, setup_fdt, setup_mon_len, #if defined(CONFIG_ARCH_CPU_INIT) @@ -457,6 +467,7 @@ static init_fnc_t init_sequence_f[] = { #ifdef CONFIG_POST init_post, #endif + setup_dram_config, setup_reloc, #if defined(CONFIG_LOGBUFFER) && !defined(CONFIG_ALT_LB_ADDR) reserve_logbuffer,