From patchwork Fri Jun 3 14:57:27 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marc Zyngier X-Patchwork-Id: 847322 Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by demeter2.kernel.org (8.14.4/8.14.3) with ESMTP id p53F16YY025432 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Fri, 3 Jun 2011 15:01:27 GMT Received: from canuck.infradead.org ([2001:4978:20e::1]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1QSVrc-0002yk-7Z; Fri, 03 Jun 2011 15:00:43 +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 1QSVra-0000Gi-OU; Fri, 03 Jun 2011 15:00:38 +0000 Received: from service87.mimecast.com ([94.185.240.25]) by canuck.infradead.org with smtp (Exim 4.76 #1 (Red Hat Linux)) id 1QSVoT-0007kG-7P for linux-arm-kernel@lists.infradead.org; Fri, 03 Jun 2011 14:57:28 +0000 Received: from cam-owa2.Emea.Arm.com (fw-tnat.cambridge.arm.com [217.140.96.21]) by service87.mimecast.com; Fri, 03 Jun 2011 15:57:23 +0100 Received: from localhost.localdomain ([10.1.255.212]) by cam-owa2.Emea.Arm.com with Microsoft SMTPSVC(6.0.3790.3959); Fri, 3 Jun 2011 15:57:22 +0100 From: Marc Zyngier To: linux-arm-kernel@lists.infradead.org Subject: [PATCH v1 12/18] ARM: omap4: dynamically register local timer setup function Date: Fri, 3 Jun 2011 15:57:27 +0100 Message-Id: <1307113053-30209-13-git-send-email-marc.zyngier@arm.com> X-Mailer: git-send-email 1.7.0.4 In-Reply-To: <1307113053-30209-1-git-send-email-marc.zyngier@arm.com> References: <1307113053-30209-1-git-send-email-marc.zyngier@arm.com> X-OriginalArrivalTime: 03 Jun 2011 14:57:22.0475 (UTC) FILETIME=[8B062FB0:01CC21FE] X-MC-Unique: 111060315572302901 X-CRM114-Version: 20090807-BlameThorstenAndJenny ( TRE 0.7.6 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20110603_105725_672503_E87181D2 X-CRM114-Status: GOOD ( 16.22 ) X-Spam-Score: -0.7 (/) X-Spam-Report: SpamAssassin version 3.3.1 on canuck.infradead.org summary: Content analysis details: (-0.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [94.185.240.25 listed in list.dnswl.org] Cc: Tony Lindgren X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 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 (demeter2.kernel.org [140.211.167.43]); Fri, 03 Jun 2011 15:01:27 +0000 (UTC) Cc: Tony Lindgren Signed-off-by: Marc Zyngier --- arch/arm/mach-omap2/Makefile | 1 - arch/arm/mach-omap2/timer-gp.c | 14 +++++++++++++- arch/arm/mach-omap2/timer-mpu.c | 37 ------------------------------------- 3 files changed, 13 insertions(+), 39 deletions(-) delete mode 100644 arch/arm/mach-omap2/timer-mpu.c diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile index b148077..f48c989 100644 --- a/arch/arm/mach-omap2/Makefile +++ b/arch/arm/mach-omap2/Makefile @@ -22,7 +22,6 @@ obj-$(CONFIG_TWL4030_CORE) += omap_twl.o # SMP support ONLY available for OMAP4 obj-$(CONFIG_SMP) += omap-smp.o omap-headsmp.o -obj-$(CONFIG_LOCAL_TIMERS) += timer-mpu.o obj-$(CONFIG_HOTPLUG_CPU) += omap-hotplug.o obj-$(CONFIG_ARCH_OMAP4) += omap44xx-smc.o omap4-common.o diff --git a/arch/arm/mach-omap2/timer-gp.c b/arch/arm/mach-omap2/timer-gp.c index 3b9cf85..b44341a 100644 --- a/arch/arm/mach-omap2/timer-gp.c +++ b/arch/arm/mach-omap2/timer-gp.c @@ -39,7 +39,9 @@ #include #include #include +#include #include +#include #include #include @@ -247,12 +249,22 @@ static void __init omap2_gp_clocksource_init(void) } #endif +#ifdef CONFIG_LOCAL_TIMERS +static int __cpuinit omap4_local_timer_setup(struct clock_event_device *evt) +{ + evt->irq = gic_ppi_to_vppi(OMAP44XX_IRQ_LOCALTIMER); + return 0; +} +#endif + static void __init omap2_gp_timer_init(void) { #ifdef CONFIG_LOCAL_TIMERS - if (cpu_is_omap44xx()) { + if (cpu_is_omap44xx() && omap_rev() != OMAP4430_REV_ES1_0) { twd_base = ioremap(OMAP44XX_LOCAL_TWD_BASE, SZ_256); BUG_ON(!twd_base); + + twd_timer_register_setup(omap4_local_timer_setup); } #endif omap_dm_timer_init(); diff --git a/arch/arm/mach-omap2/timer-mpu.c b/arch/arm/mach-omap2/timer-mpu.c deleted file mode 100644 index c91b1c1..0000000 --- a/arch/arm/mach-omap2/timer-mpu.c +++ /dev/null @@ -1,37 +0,0 @@ -/* - * The MPU local timer source file. In OMAP4, both cortex-a9 cores have - * own timer in it's MPU domain. These timers will be driving the - * linux kernel SMP tick framework when active. These timers are not - * part of the wake up domain. - * - * Copyright (C) 2009 Texas Instruments, Inc. - * - * Author: - * Santosh Shilimkar - * - * This file is based on arm realview smp platform file. - * Copyright (C) 2002 ARM Ltd. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - */ -#include -#include -#include -#include -#include - -/* - * Setup the local clock events for a CPU. - */ -int __cpuinit local_timer_setup(struct clock_event_device *evt) -{ - /* Local timers are not supprted on OMAP4430 ES1.0 */ - if (omap_rev() == OMAP4430_REV_ES1_0) - return -ENXIO; - - evt->irq = gic_ppi_to_vppi(OMAP44XX_IRQ_LOCALTIMER); - return 0; -} -