From patchwork Thu Sep 22 13:46:17 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 4263 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 28E8923EFA for ; Thu, 22 Sep 2011 13:46:31 +0000 (UTC) Received: from mail-fx0-f52.google.com (mail-fx0-f52.google.com [209.85.161.52]) by fiordland.canonical.com (Postfix) with ESMTP id 12B6CA18215 for ; Thu, 22 Sep 2011 13:46:31 +0000 (UTC) Received: by fxe23 with SMTP id 23so3864669fxe.11 for ; Thu, 22 Sep 2011 06:46:30 -0700 (PDT) Received: by 10.223.55.136 with SMTP id u8mr194164fag.46.1316699190882; Thu, 22 Sep 2011 06:46:30 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.152.18.198 with SMTP id y6cs168983lad; Thu, 22 Sep 2011 06:46:30 -0700 (PDT) Received: by 10.14.6.18 with SMTP id 18mr769873eem.93.1316699188105; Thu, 22 Sep 2011 06:46:28 -0700 (PDT) Received: from eu1sys200aog116.obsmtp.com (eu1sys200aog116.obsmtp.com. [207.126.144.141]) by mx.google.com with SMTP id s49si2554821eeb.90.2011.09.22.06.46.22 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 22 Sep 2011 06:46:27 -0700 (PDT) Received-SPF: neutral (google.com: 207.126.144.141 is neither permitted nor denied by best guess record for domain of linus.walleij@stericsson.com) client-ip=207.126.144.141; Authentication-Results: mx.google.com; spf=neutral (google.com: 207.126.144.141 is neither permitted nor denied by best guess record for domain of linus.walleij@stericsson.com) smtp.mail=linus.walleij@stericsson.com Received: from beta.dmz-us.st.com ([167.4.1.35]) (using TLSv1) by eu1sys200aob116.postini.com ([207.126.147.11]) with SMTP ID DSNKTns8LnS1UuAf1Jav86idR8LONo5X1nu4@postini.com; Thu, 22 Sep 2011 13:46:27 UTC Received: from zeta.dmz-us.st.com (ns4.st.com [167.4.16.71]) by beta.dmz-us.st.com (STMicroelectronics) with ESMTP id 3CD4249; Thu, 22 Sep 2011 13:46:21 +0000 (GMT) Received: from relay1.stm.gmessaging.net (unknown [10.230.100.17]) by zeta.dmz-us.st.com (STMicroelectronics) with ESMTP id CB6A463; Thu, 22 Sep 2011 13:46:20 +0000 (GMT) Received: from exdcvycastm004.EQ1STM.local (alteon-source-exch [10.230.100.61]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (Client CN "exdcvycastm004", Issuer "exdcvycastm004" (not verified)) by relay1.stm.gmessaging.net (Postfix) with ESMTPS id 2657F24C2F1; Thu, 22 Sep 2011 15:46:13 +0200 (CEST) Received: from localhost.localdomain (10.230.100.153) by smtp.stericsson.com (10.230.100.2) with Microsoft SMTP Server (TLS) id 8.3.83.0; Thu, 22 Sep 2011 15:46:20 +0200 From: Linus Walleij To: Cc: Lee Jones , Mattias Wallin , Thomas Gleixner , Jonas Aberg , Linus Walleij Subject: [PATCH 1/7] ARM: plat-nomadik: MTU sched_clock as an option Date: Thu, 22 Sep 2011 15:46:17 +0200 Message-ID: <1316699177-21259-1-git-send-email-linus.walleij@stericsson.com> X-Mailer: git-send-email 1.7.3.2 MIME-Version: 1.0 From: Mattias Wallin This patch makes it possible to configure away the sched_clock part of the MTU timer. Cc: Thomas Gleixner Signed-off-by: Mattias Wallin Signed-off-by: Jonas Aberg Signed-off-by: Linus Walleij --- arch/arm/plat-nomadik/Kconfig | 8 +++++++- arch/arm/plat-nomadik/timer.c | 8 ++++---- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/arch/arm/plat-nomadik/Kconfig b/arch/arm/plat-nomadik/Kconfig index ce65901..bca4914 100644 --- a/arch/arm/plat-nomadik/Kconfig +++ b/arch/arm/plat-nomadik/Kconfig @@ -15,10 +15,16 @@ if PLAT_NOMADIK config HAS_MTU bool - select HAVE_SCHED_CLOCK help Support for Multi Timer Unit. MTU provides access to multiple interrupt generating programmable 32-bit free running decrementing counters. +config NOMADIK_MTU_SCHED_CLOCK + bool + depends on HAS_MTU + select HAVE_SCHED_CLOCK + help + Use the Multi Timer Unit as the sched_clock. + endif diff --git a/arch/arm/plat-nomadik/timer.c b/arch/arm/plat-nomadik/timer.c index ef74e15..bd638c5 100644 --- a/arch/arm/plat-nomadik/timer.c +++ b/arch/arm/plat-nomadik/timer.c @@ -24,7 +24,7 @@ #include void __iomem *mtu_base; /* Assigned by machine code */ - +#ifdef CONFIG_NOMADIK_MTU_SCHED_CLOCK /* * Override the global weak sched_clock symbol with this * local implementation which uses the clocksource to get some @@ -48,7 +48,7 @@ static void notrace nomadik_update_sched_clock(void) u32 cyc = -readl(mtu_base + MTU_VAL(0)); update_sched_clock(&cd, cyc, (u32)~0); } - +#endif /* Clockevent device: use one-shot mode */ static void nmdk_clkevt_mode(enum clock_event_mode mode, struct clock_event_device *dev) @@ -153,9 +153,9 @@ void __init nmdk_timer_init(void) rate, 200, 32, clocksource_mmio_readl_down)) pr_err("timer: failed to initialize clock source %s\n", "mtu_0"); - +#ifdef CONFIG_NOMADIK_MTU_SCHED_CLOCK init_sched_clock(&cd, nomadik_update_sched_clock, 32, rate); - +#endif /* Timer 1 is used for events */ clockevents_calc_mult_shift(&nmdk_clkevt, rate, MTU_MIN_RANGE);