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: 17316 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-yh0-f72.google.com (mail-yh0-f72.google.com [209.85.213.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 596C125E30 for ; Fri, 31 May 2013 09:20:12 +0000 (UTC) Received: by mail-yh0-f72.google.com with SMTP id f73sf1600539yha.3 for ; Fri, 31 May 2013 02:20:12 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-beenthere:x-forwarded-to:x-forwarded-for:delivered-to:from:to:cc :subject:date:message-id:x-mailer:in-reply-to:references :mime-version:x-gm-message-state:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-google-group-id:list-post:list-help:list-archive:list-unsubscribe :content-type; bh=ZAo2ygLmyR2/I0yYn4pvvaOZxEcL/stAfQAqlBLjNDE=; b=pmUoQbCIG1+d3RaTHIEzGtS3k4rpgqwTHLmPe65oHBWOyFLIcg/GyRxR+osVScu80j Vu3YB2lWds0Jom7PnnRV23DzmXyXabtejRHaBYO3u08VNGVaPsYF1I7S+wZffef5NpSz dwhNbPxKuEGDvMw3Nkf/BRKehVidotobcreaenNxo45OzjsYt3WZ6KP3U1GVT6RLCwbd knzHAZHtV0k7pprofxQFwNORDJXlFDeaXK+othND9lVzVQl5MdOWnP075OSnwk615DBj H//p7u+tW10S3u9YTeG5F+h8C9qzEP/eSk6vYka3Qh5rb1LIHunrbVSFEQtb17X9yKYz 2qww== X-Received: by 10.224.59.205 with SMTP id m13mr6285617qah.7.1369992011999; Fri, 31 May 2013 02:20:11 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.129.36 with SMTP id nt4ls878484qeb.25.gmail; Fri, 31 May 2013 02:20:11 -0700 (PDT) X-Received: by 10.52.101.230 with SMTP id fj6mr7770762vdb.125.1369992011809; Fri, 31 May 2013 02:20:11 -0700 (PDT) Received: from mail-vb0-x22b.google.com (mail-vb0-x22b.google.com [2607:f8b0:400c:c02::22b]) by mx.google.com with ESMTPS id r12si27824694vcv.12.2013.05.31.02.20.11 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 31 May 2013 02:20:11 -0700 (PDT) Received-SPF: neutral (google.com: 2607:f8b0:400c:c02::22b is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=2607:f8b0:400c:c02::22b; Received: by mail-vb0-f43.google.com with SMTP id e12so889036vbg.30 for ; Fri, 31 May 2013 02:20:11 -0700 (PDT) X-Received: by 10.220.112.16 with SMTP id u16mr9420374vcp.40.1369992011371; Fri, 31 May 2013 02:20:11 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.229.199 with SMTP id jj7csp42373vcb; Fri, 31 May 2013 02:20:10 -0700 (PDT) X-Received: by 10.15.32.68 with SMTP id z44mr12830259eeu.103.1369992009834; Fri, 31 May 2013 02:20:09 -0700 (PDT) Received: from eu1sys200aog120.obsmtp.com (eu1sys200aog120.obsmtp.com [207.126.144.149]) by mx.google.com with SMTP id 8si30040330eeg.139.2013.05.31.02.19.47 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 31 May 2013 02:20:09 -0700 (PDT) Received-SPF: neutral (google.com: 207.126.144.149 is neither permitted nor denied by best guess record for domain of linus.walleij@stericsson.com) client-ip=207.126.144.149; 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: Cc: Arnd Bergmann , Linus Walleij 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-Gm-Message-State: ALoCoQkX0hIG7/HQL/Jad0vNcaZlGjGlWnxDNL9LWJK9C0J/3hJr0gdAtNTgUq2gU4FJe1YMrJ2l X-Original-Sender: linus.walleij@stericsson.com X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 2607:f8b0:400c:c02::22b is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , 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