From patchwork Fri May 31 09:18:36 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 2641121 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) by patchwork2.kernel.org (Postfix) with ESMTP id A88CBDFB79 for ; Fri, 31 May 2013 09:21:03 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UiLVk-0004GA-UG; Fri, 31 May 2013 09:20:37 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1UiLVd-0003jo-VL; Fri, 31 May 2013 09:20:29 +0000 Received: from eu1sys200aog120.obsmtp.com ([207.126.144.149]) by merlin.infradead.org with smtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UiLVJ-0003eJ-SP for linux-arm-kernel@lists.infradead.org; Fri, 31 May 2013 09:20:11 +0000 Received: from beta.dmz-eu.st.com ([164.129.1.35]) (using TLSv1) by eu1sys200aob120.postini.com ([207.126.147.11]) with SMTP ID DSNKUahrMYpa7ArrYZiQ5dgEiIvNCkEE/pxx@postini.com; Fri, 31 May 2013 09:20:09 UTC Received: from zeta.dmz-eu.st.com (zeta.dmz-eu.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 189B5242; Fri, 31 May 2013 09:19:30 +0000 (GMT) Received: from relay1.stm.gmessaging.net (unknown [10.230.100.17]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 7C09D4A38; Fri, 31 May 2013 09:19:12 +0000 (GMT) Received: from exdcvycastm003.EQ1STM.local (alteon-source-exch [10.230.100.61]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (Client CN "exdcvycastm003", Issuer "exdcvycastm003" (not verified)) by relay1.stm.gmessaging.net (Postfix) with ESMTPS id 1BE6824C2AB; Fri, 31 May 2013 11:19:24 +0200 (CEST) Received: from steludxu4075.lud.stericsson.com (10.230.100.153) by smtp.stericsson.com (10.230.100.1) with Microsoft SMTP Server (TLS) id 8.3.279.5; Fri, 31 May 2013 11:19:29 +0200 From: Linus Walleij To: Subject: [PATCH 01/39] ARM: u300: enable delaytimer on the U300 Date: Fri, 31 May 2013 11:18:36 +0200 Message-ID: <1369991954-17406-2-git-send-email-linus.walleij@stericsson.com> X-Mailer: git-send-email 1.7.11.3 In-Reply-To: <1369991954-17406-1-git-send-email-linus.walleij@stericsson.com> References: <1369991954-17406-1-git-send-email-linus.walleij@stericsson.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130531_052010_246076_AE882AEA X-CRM114-Status: GOOD ( 15.47 ) X-Spam-Score: -4.2 (----) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-4.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at http://www.dnswl.org/, medium trust [207.126.144.149 listed in list.dnswl.org] -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: Linus Walleij , Arnd Bergmann X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org From: Linus Walleij The U300 can support timer-based delays, so implement this. Skips past jiffy calibration. Signed-off-by: Linus Walleij --- arch/arm/mach-u300/timer.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/arch/arm/mach-u300/timer.c b/arch/arm/mach-u300/timer.c index d9e7320..c3d3802 100644 --- a/arch/arm/mach-u300/timer.c +++ b/arch/arm/mach-u300/timer.c @@ -18,6 +18,7 @@ #include #include #include +#include #include #include @@ -345,6 +346,12 @@ static u32 notrace u300_read_sched_clock(void) return readl(U300_TIMER_APP_VBASE + U300_TIMER_APP_GPT2CC); } +static unsigned long u300_read_current_timer(void) +{ + return readl(U300_TIMER_APP_VBASE + U300_TIMER_APP_GPT2CC); +} + +static struct delay_timer u300_delay_timer; /* * This sets up the system timers, clock source and clock event. @@ -362,6 +369,10 @@ void __init u300_timer_init(void) setup_sched_clock(u300_read_sched_clock, 32, rate); + u300_delay_timer.read_current_timer = &u300_read_current_timer; + u300_delay_timer.freq = rate; + register_current_timer_delay(&u300_delay_timer); + /* * Disable the "OS" and "DD" timers - these are designed for Symbian! * Example usage in cnh1601578 cpu subsystem pd_timer_app.c