From patchwork Fri Dec 14 06:48:37 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 206322 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 A655B2C0097 for ; Fri, 14 Dec 2012 17:58:23 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 146984A1BF; Fri, 14 Dec 2012 07:58:13 +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 R7Shlwu3fUkr; Fri, 14 Dec 2012 07:58:12 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 499824A1C8; Fri, 14 Dec 2012 07:55:16 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id BC04D4A12B for ; Fri, 14 Dec 2012 07:53:16 +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 ZtEIa8NP7tUQ for ; Fri, 14 Dec 2012 07:53:15 +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 CA7E64A156 for ; Fri, 14 Dec 2012 07:50:23 +0100 (CET) Received: by mail-lb0-f202.google.com with SMTP id s4so156340lbc.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=RLQ4AA0d3677kowEkrDuy6oDIGvx5mWSAzsdmmVIvG4=; b=BihZu65KZfWW/PFZAz9Ko7WlmPA6t+/T8lnPWdy5IptDYqSFeA4ijXoJNdCpE+4Ab1 xSeYPGsizft7M5lC5c/KZM0ys186xvK0Djdmtb+3+ggJV9APpZREe9p7oD/0tZnUImhF f01DIJrBGs3vZC1fmRYHe8kBfqd0eMF48IxRbH1sNpPxwvlDM/Z0RG2WytxSgQ9WEFxB iO1RxfHBGtTDGFmmDLi4dFHW8NaihPaeSmbpmre1H7TwWUWDxmRftyoPBtXJf7XCbVrO GockfpKWxY9J9ObwUmndE1rOZldFRYx9A8RbQcQgxBHRcZXzpU6Uh4YTxpoMyH/bZJQY b3eQ== Received: by 10.14.214.197 with SMTP id c45mr4605969eep.7.1355467820754; 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 g9si962894eeo.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 61C18200057; Thu, 13 Dec 2012 22:50:20 -0800 (PST) Received: by kaka.mtv.corp.google.com (Postfix, from userid 121222) id 4B982160DE1; Thu, 13 Dec 2012 22:50:19 -0800 (PST) From: Simon Glass To: U-Boot Mailing List Date: Thu, 13 Dec 2012 22:48:37 -0800 Message-Id: <1355467767-29575-9-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: ALoCoQm33okZN5SsKQvQUQyRn804Jh7zwbbZFUPcIFX5YTWlXXgbzQ1lRVi1pmAchWnQK8nvIteDThn/8LTKw4UY85jVhOpx7qB47Ez9R9bnjLCKThYrnRuRHXsE6CvYbjAGTeqmtnOxWzOM0dhjQHj0qP2Y3OdbhJxWF7DMsobWhhvCv68lf/vQ9Jg13g+GS3CiUXN4KBD8 Cc: Tom Rini Subject: [U-Boot] [PATCH v2 08/58] ixp: Move timestamp 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/ixp/timer.c | 8 ++++---- arch/arm/include/asm/global_data.h | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/arch/arm/cpu/ixp/timer.c b/arch/arm/cpu/ixp/timer.c index 0450b51..663d989 100644 --- a/arch/arm/cpu/ixp/timer.c +++ b/arch/arm/cpu/ixp/timer.c @@ -70,14 +70,14 @@ unsigned long long get_ticks(void) if (readl(IXP425_OSST) & IXP425_OSST_TIMER_TS_PEND) { /* rollover of timestamp timer register */ - gd->timestamp += (0xFFFFFFFF - gd->arch.lastinc) + now + 1; + gd->arch.timestamp += (0xFFFFFFFF - gd->arch.lastinc) + now + 1; writel(IXP425_OSST_TIMER_TS_PEND, IXP425_OSST); } else { /* move stamp forward with absolut diff ticks */ - gd->timestamp += (now - gd->arch.lastinc); + gd->arch.timestamp += (now - gd->arch.lastinc); } gd->arch.lastinc = now; - return gd->timestamp; + return gd->arch.timestamp; } @@ -86,7 +86,7 @@ void reset_timer_masked(void) /* capture current timestamp counter */ gd->arch.lastinc = readl(IXP425_OSTS_B); /* start "advancing" time stamp from 0 */ - gd->timestamp = 0; + gd->arch.timestamp = 0; } ulong get_timer_masked(void) diff --git a/arch/arm/include/asm/global_data.h b/arch/arm/include/asm/global_data.h index 95e23e1..35d07d0 100644 --- a/arch/arm/include/asm/global_data.h +++ b/arch/arm/include/asm/global_data.h @@ -41,6 +41,9 @@ struct arch_global_data { unsigned long tbl; unsigned long lastinc; unsigned long long timer_reset_value; +#ifdef CONFIG_IXP425 + unsigned long timestamp; +#endif }; /* @@ -65,9 +68,6 @@ typedef struct global_data { #ifdef CONFIG_FSL_ESDHC unsigned long sdhc_clk; #endif -#ifdef CONFIG_IXP425 - unsigned long timestamp; -#endif unsigned long relocaddr; /* Start address of U-Boot in RAM */ phys_size_t ram_size; /* RAM size */ unsigned long mon_len; /* monitor len */