From patchwork Thu Apr 8 13:43:09 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rabin Vincent X-Patchwork-Id: 71738 X-Patchwork-Delegate: albert.aribaud@free.fr Return-Path: X-Original-To: wd@gemini.denx.de Delivered-To: wd@gemini.denx.de Received: from diddl.denx.de (diddl.denx.de [10.0.0.6]) by gemini.denx.de (Postfix) with ESMTP id BB3801051E73 for ; Thu, 8 Apr 2010 15:44:45 +0200 (CEST) Received: from diddl.denx.de (localhost.localdomain [127.0.0.1]) by diddl.denx.de (Postfix) with ESMTP id AD78BC91311B for ; Thu, 8 Apr 2010 15:44:45 +0200 (CEST) Received: from pop.mnet-online.de by diddl.denx.de with POP3 (fetchmail-6.3.9) for (single-drop); Thu, 08 Apr 2010 15:44:45 +0200 (CEST) Received: from murder (svr19.m-online.net [192.168.3.147]) by backend2 (Cyrus v2.2.12) with LMTPA; Thu, 08 Apr 2010 15:44:40 +0200 X-Sieve: CMU Sieve 2.2 Received: from mail.m-online.net (localhost [127.0.0.1]) by frontend3.pop.m-online.net (Cyrus v2.2.13) with LMTPA; Thu, 08 Apr 2010 15:44:39 +0200 Received: from scanner-1.m-online.net (unknown [192.168.8.165]) by mail.m-online.net (Postfix) with ESMTP id CE6D320010F; Thu, 8 Apr 2010 15:44:39 +0200 (CEST) Received: from mxin-1.m-online.net ([192.168.6.164]) by scanner-1.m-online.net (scanner-1.m-online.net [192.168.8.165]) (amavisd-new, port 10026) with ESMTP id 03246-03-2; Thu, 8 Apr 2010 15:44:34 +0200 (CEST) Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by mxin-1.m-online.net (Postfix) with ESMTP id A584346C0AA; Thu, 8 Apr 2010 15:44:33 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 628072812F; Thu, 8 Apr 2010 15:44:14 +0200 (CEST) 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 ECozZDFq3Dn2; Thu, 8 Apr 2010 15:44:14 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id A8CAC2812E; Thu, 8 Apr 2010 15:44:00 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 47E3228156 for ; Thu, 8 Apr 2010 15:43:57 +0200 (CEST) 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 leutHqf1MXei for ; Thu, 8 Apr 2010 15:43:54 +0200 (CEST) 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 eu1sys200aog108.obsmtp.com (eu1sys200aog108.obsmtp.com [207.126.144.125]) by theia.denx.de (Postfix) with ESMTPS id 04B4328164 for ; Thu, 8 Apr 2010 15:43:48 +0200 (CEST) Received: from source ([167.4.1.35]) (using TLSv1) by eu1sys200aob108.postini.com ([207.126.147.11]) with SMTP ID DSNKS73dk7tXNrmYuKb3sdthowUfk6evXc6u@postini.com; Thu, 08 Apr 2010 13:43:53 UTC Received: from zeta.dmz-us.st.com (ns4.st.com [167.4.80.115]) by beta.dmz-us.st.com (STMicroelectronics) with ESMTP id CD6E968; Thu, 8 Apr 2010 13:40:48 +0000 (GMT) Received: from relay2.stm.gmessaging.net (unknown [10.230.100.18]) by zeta.dmz-us.st.com (STMicroelectronics) with ESMTP id 1B990134; Thu, 8 Apr 2010 13:43:40 +0000 (GMT) Received: from exdcvycastm022.EQ1STM.local (alteon-source-exch [10.230.100.61]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (Client CN "exdcvycastm022", Issuer "exdcvycastm022" (not verified)) by relay2.stm.gmessaging.net (Postfix) with ESMTPS id 8F5E7A8095; Thu, 8 Apr 2010 15:43:31 +0200 (CEST) Received: from localhost (10.201.54.39) by exdcvycastm022.EQ1STM.local (10.230.100.30) with Microsoft SMTP Server (TLS) id 8.1.393.1; Thu, 8 Apr 2010 15:43:37 +0200 From: Rabin Vincent To: Date: Thu, 8 Apr 2010 19:13:09 +0530 Message-ID: <1270734200-17762-3-git-send-email-rabin.vincent@stericsson.com> X-Mailer: git-send-email 1.7.0 In-Reply-To: <1270734200-17762-2-git-send-email-rabin.vincent@stericsson.com> References: <1270734200-17762-1-git-send-email-rabin.vincent@stericsson.com> <1270734200-17762-2-git-send-email-rabin.vincent@stericsson.com> MIME-Version: 1.0 Cc: STEricsson_nomadik_linux@list.st.com, Michael Brandt , Alessandro Rubini Subject: [U-Boot] [PATCHv2 02/13] Nomadik: timer: push down single-use macros X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.9 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de X-Virus-Scanned: by amavisd-new at m-online.net Eliminate some single-use macros. USEC_TO_COUNT and COUNT_TO_USEC are replaced in a later patch. Cc: Alessandro Rubini Acked-by: Michael Brandt Signed-off-by: Rabin Vincent --- cpu/arm926ejs/nomadik/timer.c | 5 ++--- 1 files changed, 2 insertions(+), 3 deletions(-) diff --git a/cpu/arm926ejs/nomadik/timer.c b/cpu/arm926ejs/nomadik/timer.c index 1d98ef3..fdab650 100644 --- a/cpu/arm926ejs/nomadik/timer.c +++ b/cpu/arm926ejs/nomadik/timer.c @@ -31,8 +31,6 @@ #define TIMER_CLOCK (24 * 100 * 1000) #define COUNT_TO_USEC(x) ((x) * 5 / 12) /* overflows at 6min */ #define USEC_TO_COUNT(x) ((x) * 12 / 5) /* overflows at 6min */ -#define TICKS_PER_HZ (TIMER_CLOCK / CONFIG_SYS_HZ) -#define TICKS_TO_HZ(x) ((x) / TICKS_PER_HZ) /* macro to read the decrementing 32 bit timer as an increasing count */ #define READ_TIMER() (0 - readl(CONFIG_SYS_TIMERBASE + MTU_VAL(0))) @@ -64,7 +62,8 @@ void reset_timer(void) /* Return how many HZ passed since "base" */ ulong get_timer(ulong base) { - return TICKS_TO_HZ(READ_TIMER()) - base; + ulong hz = READ_TIMER() / (TIMER_CLOCK / CONFIG_SYS_HZ); + return hz - base; } /* Delay x useconds */