From patchwork Fri Feb 8 15:12:11 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 219191 X-Patchwork-Delegate: trini@ti.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 06AC92C0082 for ; Sat, 9 Feb 2013 02:17:10 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 73B2C4A172; Fri, 8 Feb 2013 16:16:44 +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 u1VHKfXvNbey; Fri, 8 Feb 2013 16:16:44 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 227764A173; Fri, 8 Feb 2013 16:14:34 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 444294A136 for ; Fri, 8 Feb 2013 16:14:17 +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 WSoGoDQqzics for ; Fri, 8 Feb 2013 16:14:16 +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-ea0-f201.google.com (mail-ea0-f201.google.com [209.85.215.201]) by theia.denx.de (Postfix) with ESMTPS id 3AA794A106 for ; Fri, 8 Feb 2013 16:13:52 +0100 (CET) Received: by mail-ea0-f201.google.com with SMTP id l13so265378eaa.0 for ; Fri, 08 Feb 2013 07:13:52 -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=M3BGV1K3fYfK7D3xVNBJBD1NvtfetvO56Xaxrf20GiY=; b=nMjlAvF4Oy0rpp4aXNbQy84WRJvdiBEXe5R5PwUVKAQMhLoTCTlX6Gn71efMqRhLyk nlj1j+jymrzWW4E/8wA14MYeTcczqO6Fh0L32P+lpDB3+zITvfTKWpYuc8c0rIMGGxec Vr2foLzt9Gyhxt9Bd9eRnHypKjhqcdnEhRan+OhKbWB+5gsV4FwE9u4Una2lq8Gcsy3i ByWZkFR7i8Bm/s18IS3fNnAgsqP5JELlzwiG/ixDOxNjpRjVioQY6aKOpkJi7vOrYqyH YZdpfpZNsx/VMnci7hrpfwvW1ArSSYQ6E6dJpKoW9boOH5UFL65sow8vMSp4w8Rsgnup hs/g== X-Received: by 10.14.215.198 with SMTP id e46mr5385803eep.2.1360336432177; Fri, 08 Feb 2013 07:13:52 -0800 (PST) Received: from corp2gmr1-1.eem.corp.google.com (corp2gmr1-1.eem.corp.google.com [172.25.138.99]) by gmr-mx.google.com with ESMTPS id 6si4487740eej.0.2013.02.08.07.13.52 (version=TLSv1.1 cipher=AES128-SHA bits=128/128); Fri, 08 Feb 2013 07:13:52 -0800 (PST) Received: from kaka.mtv.corp.google.com (kaka.mtv.corp.google.com [172.22.73.79]) by corp2gmr1-1.eem.corp.google.com (Postfix) with ESMTP id E540D1CA1B3; Fri, 8 Feb 2013 07:13:51 -0800 (PST) Received: by kaka.mtv.corp.google.com (Postfix, from userid 121222) id 4870A160920; Fri, 8 Feb 2013 07:13:51 -0800 (PST) From: Simon Glass To: U-Boot Mailing List Date: Fri, 8 Feb 2013 07:12:11 -0800 Message-Id: <1360336339-10703-16-git-send-email-sjg@chromium.org> X-Mailer: git-send-email 1.8.1 In-Reply-To: <1360336339-10703-1-git-send-email-sjg@chromium.org> References: <1360336339-10703-1-git-send-email-sjg@chromium.org> X-Gm-Message-State: ALoCoQlGieelr313gH9JL6SaLH4DPcEFTOqObMO8lgI3NKu5iie2RIZe/gLajbB805YgFZe4pbsM5TBc0TcRnBtG7WwWCZMJkGoWX/Zbmltc+itoQNVQoBZ457FZXwc8qThBz2jwUPsOfQLcWRCrz4AY5oFmq08FzxUfwMIpSUwzgB39Pu1pfcM7tkIXabBnhCqs1cYXRAlU Cc: Graeme Russ , Tom Rini , Vadim Bendebury Subject: [U-Boot] [PATCH v5 15/23] 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 --- Changes in v5: - Add offsets support for access to fdt that uses CONFIG_OF_SEPARATE Changes in v4: None Changes in v3: None Changes in v2: None README | 6 ++++++ common/board_f.c | 15 +++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/README b/README index 88526cb..f897c4d 100644 --- a/README +++ b/README @@ -3219,6 +3219,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 3a8036f..db3ef0a 100644 --- a/common/board_f.c +++ b/common/board_f.c @@ -107,8 +107,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); @@ -174,7 +179,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; } @@ -190,7 +199,11 @@ static int setup_fdt(void) gd->fdt_blob = _binary_dt_dtb_start; #elif defined CONFIG_OF_SEPARATE /* FDT is at end of image */ +# ifdef CONFIG_SYS_SYM_OFFSETS gd->fdt_blob = (void *)(_end_ofs + CONFIG_SYS_TEXT_BASE); +# else + gd->fdt_blob = (ulong *)&_end; +# endif #endif /* Allow the early environment to override the fdt address */ gd->fdt_blob = (void *)getenv_ulong("fdtcontroladdr", 16, @@ -476,6 +489,7 @@ static int mark_bootstage(void) } static init_fnc_t init_sequence_f[] = { + zero_global_data, setup_fdt, setup_mon_len, arch_cpu_init, /* basic arch cpu dependent setup */ @@ -510,6 +524,7 @@ static init_fnc_t init_sequence_f[] = { #ifdef CONFIG_POST init_post, #endif + setup_dram_config, /* * Now that we have DRAM mapped and working, we can * relocate the code and continue running from DRAM.