From patchwork Tue May 31 08:30:23 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mattias Wallin X-Patchwork-Id: 1676 Return-Path: Delivered-To: unknown Received: from imap.gmail.com (74.125.159.109) by localhost6.localdomain6 with IMAP4-SSL; 08 Jun 2011 14:54:17 -0000 Delivered-To: patches@linaro.org Received: by 10.52.110.9 with SMTP id hw9cs276565vdb; Tue, 31 May 2011 01:31:18 -0700 (PDT) Received: by 10.213.31.197 with SMTP id z5mr1243310ebc.83.1306830677953; Tue, 31 May 2011 01:31:17 -0700 (PDT) Received: from eu1sys200aog103.obsmtp.com (eu1sys200aog103.obsmtp.com [207.126.144.115]) by mx.google.com with SMTP id y18si11348204eeh.3.2011.05.31.01.31.12 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 31 May 2011 01:31:17 -0700 (PDT) Received-SPF: neutral (google.com: 207.126.144.115 is neither permitted nor denied by best guess record for domain of mattias.wallin@stericsson.com) client-ip=207.126.144.115; Authentication-Results: mx.google.com; spf=neutral (google.com: 207.126.144.115 is neither permitted nor denied by best guess record for domain of mattias.wallin@stericsson.com) smtp.mail=mattias.wallin@stericsson.com Received: from beta.dmz-eu.st.com ([164.129.1.35]) (using TLSv1) by eu1sys200aob103.postini.com ([207.126.147.11]) with SMTP ID DSNKTeSnUMYGVXT830ejwooZ22ZfpQtS3Jqy@postini.com; Tue, 31 May 2011 08:31:17 UTC Received: from zeta.dmz-eu.st.com (ns2.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id BF5CF87; Tue, 31 May 2011 08:30:47 +0000 (GMT) Received: from relay2.stm.gmessaging.net (unknown [10.230.100.18]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id B24AC1B0F; Tue, 31 May 2011 08:30:47 +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 relay2.stm.gmessaging.net (Postfix) with ESMTPS id B9A47A8081; Tue, 31 May 2011 10:30:43 +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; Tue, 31 May 2011 10:30:47 +0200 From: Mattias Wallin To: Thomas Gleixner , , Cc: Lee Jones , Mattias Wallin Subject: [PATCH 1/3] plat-nomadik: MTU sched_clock as an option Date: Tue, 31 May 2011 10:30:23 +0200 Message-ID: <1306830623-9504-1-git-send-email-mattias.wallin@stericsson.com> X-Mailer: git-send-email 1.7.5.1 MIME-Version: 1.0 This patch makes it possible to configure away the sched_clock part of the MTU timer. Signed-off-by: Mattias Wallin Acked-by: Linus Walleij --- arch/arm/plat-nomadik/Kconfig | 8 +++++++- arch/arm/plat-nomadik/timer.c | 4 ++++ 2 files changed, 11 insertions(+), 1 deletions(-) diff --git a/arch/arm/plat-nomadik/Kconfig b/arch/arm/plat-nomadik/Kconfig index 18296ee..d8101a4 100644 --- a/arch/arm/plat-nomadik/Kconfig +++ b/arch/arm/plat-nomadik/Kconfig @@ -15,12 +15,18 @@ 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. + config NOMADIK_GPIO bool help diff --git a/arch/arm/plat-nomadik/timer.c b/arch/arm/plat-nomadik/timer.c index ef74e15..b55c4ec 100644 --- a/arch/arm/plat-nomadik/timer.c +++ b/arch/arm/plat-nomadik/timer.c @@ -25,6 +25,7 @@ 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,6 +49,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, @@ -154,7 +156,9 @@ void __init nmdk_timer_init(void) 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 */