From patchwork Fri Dec 14 06:48:36 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 206359 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 DAF882C008C for ; Fri, 14 Dec 2012 18:04:52 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 15B094A4E5; Fri, 14 Dec 2012 08:04:38 +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 QaNcbT6Essz7; Fri, 14 Dec 2012 08:04:37 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 275AE4A299; Fri, 14 Dec 2012 07:56:05 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 487664A137 for ; Fri, 14 Dec 2012 07:53:23 +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 gxM7Ex5WFLSp for ; Fri, 14 Dec 2012 07:53:22 +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-lb0-f202.google.com (mail-lb0-f202.google.com [209.85.217.202]) by theia.denx.de (Postfix) with ESMTPS id CA4684A151 for ; Fri, 14 Dec 2012 07:50:23 +0100 (CET) Received: by mail-lb0-f202.google.com with SMTP id s4so156341lbc.3 for ; Thu, 13 Dec 2012 22:50:20 -0800 (PST) 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=KJ/QrI4PupYjqKBATFT7Dz8c+ix8IGbgqjgIldst+to=; b=pWopF/g1b6rqLLTgTktLjjdM4WNDLxkcmp56LrZph44mAHcDYwX5ll/cC+HyytMEU0 Z0Dr0lrJpXVNUqh9kW50OUJYzrZHbW9xKpJWENAzAhyh+sKX+eYrpazr93CKKz6YsWFb l/eg2mtu5NcDSxwr01VDV94nXIqQrNqYGkYVRIORi+zD/tzXvbzxgy92ehHx/D4Lm3O+ M/n1X8yXjNvsOk02NgAwzvY9giz13kpRj4IM9WKMirN+a915jLYWd04X3O+94zyF4WeM nUEYpMPsO9Ff5tvt0bYAujcq24ljjc6UJb7pW/FTECiPoeD0HRgfP78IGJX2PTY85E4H gsZA== Received: by 10.14.208.198 with SMTP id q46mr4627633eeo.0.1355467820763; Thu, 13 Dec 2012 22:50:20 -0800 (PST) Received: from hpza10.eem.corp.google.com ([74.125.121.33]) by gmr-mx.google.com with ESMTPS id g9si962503eeo.1.2012.12.13.22.50.20 (version=TLSv1/SSLv3 cipher=AES128-SHA); Thu, 13 Dec 2012 22:50:20 -0800 (PST) Received: from kaka.mtv.corp.google.com (kaka.mtv.corp.google.com [172.22.73.79]) by hpza10.eem.corp.google.com (Postfix) with ESMTP id 63362200059; Thu, 13 Dec 2012 22:50:20 -0800 (PST) Received: by kaka.mtv.corp.google.com (Postfix, from userid 121222) id 34CDD160B49; Thu, 13 Dec 2012 22:50:19 -0800 (PST) From: Simon Glass To: U-Boot Mailing List Date: Thu, 13 Dec 2012 22:48:36 -0800 Message-Id: <1355467767-29575-8-git-send-email-sjg@chromium.org> X-Mailer: git-send-email 1.7.7.3 In-Reply-To: <1355467767-29575-1-git-send-email-sjg@chromium.org> References: <1355467767-29575-1-git-send-email-sjg@chromium.org> X-Gm-Message-State: ALoCoQkYe9WzQ7VUq5R0mOZZWgSFlzL/aTjIYaJkHk3MChFyTvWb2dl6lLjWxD38oPoWcETN3BRCMti37oexdy8AQ4Ud4QMNTw2LWmYyf83J4gz+Namyuataosu922Do8Lcij2VAG2hOSl7O2c6OiRLLiQ9HYHqBp7R4wSQkk3J1rESq2AceAhJ3UckdiNIT9Y79wdBEDWCC Cc: Tom Rini Subject: [U-Boot] [PATCH v2 07/58] arm: Move timer_reset_value to arch_global_data 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 Move this field into arch_global_data and tidy up. Signed-off-by: Simon Glass --- Changes in v2: None arch/arm/cpu/arm926ejs/davinci/timer.c | 4 ++-- arch/arm/include/asm/global_data.h | 5 +---- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/arch/arm/cpu/arm926ejs/davinci/timer.c b/arch/arm/cpu/arm926ejs/davinci/timer.c index b620bf7..4142932 100644 --- a/arch/arm/cpu/arm926ejs/davinci/timer.c +++ b/arch/arm/cpu/arm926ejs/davinci/timer.c @@ -61,7 +61,7 @@ int timer_init(void) writel(TIMER_LOAD_VAL, &timer->prd34); writel(2 << 22, &timer->tcr); gd->arch.timer_rate_hz = CONFIG_SYS_HZ_CLOCK / TIM_CLK_DIV; - gd->timer_reset_value = 0; + gd->arch.timer_reset_value = 0; return(0); } @@ -85,7 +85,7 @@ ulong get_timer(ulong base) { unsigned long long timer_diff; - timer_diff = get_ticks() - gd->timer_reset_value; + timer_diff = get_ticks() - gd->arch.timer_reset_value; return lldiv(timer_diff, (gd->arch.timer_rate_hz / CONFIG_SYS_HZ)) - base; diff --git a/arch/arm/include/asm/global_data.h b/arch/arm/include/asm/global_data.h index 7d7f3cf..95e23e1 100644 --- a/arch/arm/include/asm/global_data.h +++ b/arch/arm/include/asm/global_data.h @@ -40,6 +40,7 @@ struct arch_global_data { unsigned long tbu; unsigned long tbl; unsigned long lastinc; + unsigned long long timer_reset_value; }; /* @@ -64,10 +65,6 @@ typedef struct global_data { #ifdef CONFIG_FSL_ESDHC unsigned long sdhc_clk; #endif -#ifdef CONFIG_ARM - /* "static data" needed by most of timer.c on ARM platforms */ - unsigned long long timer_reset_value; -#endif #ifdef CONFIG_IXP425 unsigned long timestamp; #endif