From patchwork Thu Aug 4 13:49:34 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Deepak Saxena X-Patchwork-Id: 1035702 Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by demeter1.kernel.org (8.14.4/8.14.4) with ESMTP id p74Dnli6019277 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Thu, 4 Aug 2011 13:50:07 GMT Received: from canuck.infradead.org ([2001:4978:20e::1]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1QoyIs-0005BK-RE; Thu, 04 Aug 2011 13:49:39 +0000 Received: from localhost ([127.0.0.1] helo=canuck.infradead.org) by canuck.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1QoyIs-0007Ag-BL; Thu, 04 Aug 2011 13:49:38 +0000 Received: from plexity.net ([206.123.115.38]) by canuck.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1QoyIp-0007AN-Ez for linux-arm-kernel@lists.infradead.org; Thu, 04 Aug 2011 13:49:36 +0000 Received: by plexity.net (Postfix, from userid 1000) id CF23220C2B; Thu, 4 Aug 2011 06:49:34 -0700 (PDT) Date: Thu, 4 Aug 2011 06:49:34 -0700 From: Deepak Saxena To: linux-arm-kernel@lists.infradead.org Subject: [PATCH 05/12] ARM: h720x: Remove LATCH and CLOCK_TICK_RATE dependency Message-ID: <20110804134934.GC1019@plexity.net> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.20 (2009-06-14) X-CRM114-Version: 20090807-BlameThorstenAndJenny ( TRE 0.7.6 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20110804_094935_598457_D15A040E X-CRM114-Status: GOOD ( 14.58 ) X-Spam-Score: -0.8 (/) X-Spam-Report: SpamAssassin version 3.3.1 on canuck.infradead.org summary: Content analysis details: (-0.8 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.8 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain Cc: Nicolas Pitre , rmk@arm.linux.org.uk X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.12 Precedence: list Reply-To: dsaxena@plexity.net List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Thu, 04 Aug 2011 13:50:09 +0000 (UTC) As part of work to remove the global CLOCK_TICK_RATE symbol, this patch defines a sub-arch local value for use by the h720x code. Once all LATCH and CLOCK_TICK_RATE references are removed, we will remove all the definitions across sub-arches. Signed-off-by: Deepak Saxena --- arch/arm/mach-h720x/common.c | 4 +++- arch/arm/mach-h720x/common.h | 3 +++ arch/arm/mach-h720x/cpu-h7201.c | 2 +- arch/arm/mach-h720x/cpu-h7202.c | 2 +- 4 files changed, 8 insertions(+), 3 deletions(-) diff --git a/arch/arm/mach-h720x/common.c b/arch/arm/mach-h720x/common.c index 51d4e44..383c121 100644 --- a/arch/arm/mach-h720x/common.c +++ b/arch/arm/mach-h720x/common.c @@ -30,6 +30,8 @@ #include +#include "common.h" + #if 0 #define IRQDBG(args...) printk(args) #else @@ -46,7 +48,7 @@ void __init arch_dma_init(dma_t *dma) */ unsigned long h720x_gettimeoffset(void) { - return (CPU_REG (TIMER_VIRT, TM0_COUNT) * tick_usec) / LATCH; + return (CPU_REG (TIMER_VIRT, TM0_COUNT) * tick_usec) / H720X_LATCH; } /* diff --git a/arch/arm/mach-h720x/common.h b/arch/arm/mach-h720x/common.h index 7dd5fa6..ac32f3c 100644 --- a/arch/arm/mach-h720x/common.h +++ b/arch/arm/mach-h720x/common.h @@ -27,3 +27,6 @@ extern void __init h7202_init_time(void); #ifdef CONFIG_ARCH_H7201 extern struct sys_timer h7201_timer; #endif + +#define H720X_TICK_RATE 3686400 +#define H720X_LATCH ((H720X_TICK_RATE + HZ/2) / HZ) /* For divider */ diff --git a/arch/arm/mach-h720x/cpu-h7201.c b/arch/arm/mach-h720x/cpu-h7201.c index 24df2a3..8c2b36d 100644 --- a/arch/arm/mach-h720x/cpu-h7201.c +++ b/arch/arm/mach-h720x/cpu-h7201.c @@ -46,7 +46,7 @@ static struct irqaction h7201_timer_irq = { */ void __init h7201_init_time(void) { - CPU_REG (TIMER_VIRT, TM0_PERIOD) = LATCH; + CPU_REG (TIMER_VIRT, TM0_PERIOD) = H720X_LATCH; CPU_REG (TIMER_VIRT, TM0_CTRL) = TM_RESET; CPU_REG (TIMER_VIRT, TM0_CTRL) = TM_REPEAT | TM_START; CPU_REG (TIMER_VIRT, TIMER_TOPCTRL) = ENABLE_TM0_INTR | TIMER_ENABLE_BIT; diff --git a/arch/arm/mach-h720x/cpu-h7202.c b/arch/arm/mach-h720x/cpu-h7202.c index c37d570..c2879af 100644 --- a/arch/arm/mach-h720x/cpu-h7202.c +++ b/arch/arm/mach-h720x/cpu-h7202.c @@ -180,7 +180,7 @@ static struct irqaction h7202_timer_irq = { */ void __init h7202_init_time(void) { - CPU_REG (TIMER_VIRT, TM0_PERIOD) = LATCH; + CPU_REG (TIMER_VIRT, TM0_PERIOD) = H720X_LATCH; CPU_REG (TIMER_VIRT, TM0_CTRL) = TM_RESET; CPU_REG (TIMER_VIRT, TM0_CTRL) = TM_REPEAT | TM_START; CPU_REG (TIMER_VIRT, TIMER_TOPCTRL) = ENABLE_TM0_INTR | TIMER_ENABLE_BIT;