From patchwork Thu Jun 16 19:06:35 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marc Zyngier X-Patchwork-Id: 888292 Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by demeter2.kernel.org (8.14.4/8.14.4) with ESMTP id p5GJ7cut007472 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Thu, 16 Jun 2011 19:08:04 GMT Received: from canuck.infradead.org ([2001:4978:20e::1]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1QXHuX-0001Vq-1Y; Thu, 16 Jun 2011 19:07:25 +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 1QXHuW-0003lb-Lo; Thu, 16 Jun 2011 19:07:24 +0000 Received: from casper.infradead.org ([2001:770:15f::2]) by canuck.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1QXHuU-0003lK-5G for linux-arm-kernel@canuck.infradead.org; Thu, 16 Jun 2011 19:07:22 +0000 Received: from service87.mimecast.com ([94.185.240.25]) by casper.infradead.org with smtp (Exim 4.76 #1 (Red Hat Linux)) id 1QXHuR-0001GB-8P for linux-arm-kernel@lists.infradead.org; Thu, 16 Jun 2011 19:07:20 +0000 Received: from cam-owa2.Emea.Arm.com (fw-tnat.cambridge.arm.com [217.140.96.21]) by service87.mimecast.com; Thu, 16 Jun 2011 20:07:07 +0100 Received: from localhost.localdomain ([10.1.255.212]) by cam-owa2.Emea.Arm.com with Microsoft SMTPSVC(6.0.3790.3959); Thu, 16 Jun 2011 20:06:53 +0100 From: Marc Zyngier To: linux-arm-kernel@lists.infradead.org Subject: [RFC PATCH 07/16] ARM: local timers: move OMAP4 to LOCAL_TIMER_DEVICES/ARM_SMP_TWD Date: Thu, 16 Jun 2011 20:06:35 +0100 Message-Id: <1308251204-16719-8-git-send-email-marc.zyngier@arm.com> X-Mailer: git-send-email 1.7.0.4 In-Reply-To: <1308251204-16719-1-git-send-email-marc.zyngier@arm.com> References: <1308251204-16719-1-git-send-email-marc.zyngier@arm.com> X-OriginalArrivalTime: 16 Jun 2011 19:06:53.0702 (UTC) FILETIME=[8DF0E260:01CC2C58] X-MC-Unique: 111061620070700501 X-CRM114-Version: 20090807-BlameThorstenAndJenny ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20110616_200719_385302_74349022 X-CRM114-Status: GOOD ( 19.73 ) X-Spam-Score: -2.6 (--) X-Spam-Report: SpamAssassin version 3.3.2-r929478 on casper.infradead.org summary: Content analysis details: (-2.6 points, 5.0 required) 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] -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: Tony Lindgren , Thomas Gleixner , Santosh Shilimkar , Arnd Bergmann 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]); Thu, 16 Jun 2011 19:08:05 +0000 (UTC) Convert the OMAP4 platforms to use the new arm_smp_twd driver. Add the platform device and register it as early platform device. Tested on a Pandaboard. Cc: Tony Lindgren Cc: Santosh Shilimkar Signed-off-by: Marc Zyngier --- arch/arm/mach-omap2/Kconfig | 3 +- arch/arm/mach-omap2/Makefile | 1 - arch/arm/mach-omap2/timer-gp.c | 40 ++++++++++++++++++++++++++++++++------ arch/arm/mach-omap2/timer-mpu.c | 40 --------------------------------------- 4 files changed, 35 insertions(+), 49 deletions(-) delete mode 100644 arch/arm/mach-omap2/timer-mpu.c diff --git a/arch/arm/mach-omap2/Kconfig b/arch/arm/mach-omap2/Kconfig index 19d5891..805d7b9 100644 --- a/arch/arm/mach-omap2/Kconfig +++ b/arch/arm/mach-omap2/Kconfig @@ -44,7 +44,8 @@ config ARCH_OMAP4 depends on ARCH_OMAP2PLUS select CPU_V7 select ARM_GIC - select LOCAL_TIMERS if SMP + select LOCAL_TIMER_DEVICES if SMP + select ARM_SMP_TWD select PL310_ERRATA_588369 select PL310_ERRATA_727915 select ARM_ERRATA_720789 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..f2f0db6 100644 --- a/arch/arm/mach-omap2/timer-gp.c +++ b/arch/arm/mach-omap2/timer-gp.c @@ -35,10 +35,10 @@ #include #include #include +#include #include #include -#include #include #include #include @@ -247,18 +247,44 @@ static void __init omap2_gp_clocksource_init(void) } #endif +#ifdef CONFIG_ARM_SMP_TWD +static struct resource omap2_gp_twd_resources[] = { + { + .start = OMAP44XX_LOCAL_TWD_BASE, + .end = OMAP44XX_LOCAL_TWD_BASE + 0x10, + .flags = IORESOURCE_MEM, + }, + { + .start = OMAP44XX_IRQ_LOCALTIMER, + .end = OMAP44XX_IRQ_LOCALTIMER, + .flags = IORESOURCE_IRQ, + }, +}; + +static struct platform_device omap2_gp_twd_device = { + .name = "arm_smp_twd", + .id = -1, + .resource = omap2_gp_twd_resources, + .num_resources = ARRAY_SIZE(omap2_gp_twd_resources), +}; + +static struct platform_device *omap2_gp_early_devices[] = { + &omap2_gp_twd_device, +}; +#endif + static void __init omap2_gp_timer_init(void) { -#ifdef CONFIG_LOCAL_TIMERS - if (cpu_is_omap44xx()) { - twd_base = ioremap(OMAP44XX_LOCAL_TWD_BASE, SZ_256); - BUG_ON(!twd_base); - } -#endif omap_dm_timer_init(); omap2_gp_clockevent_init(); omap2_gp_clocksource_init(); +#ifdef CONFIG_ARM_SMP_TWD + /* Local timers are not supprted on OMAP4430 ES1.0 */ + if (omap_rev() != OMAP4430_REV_ES1_0) + early_platform_add_devices(omap2_gp_early_devices, + ARRAY_SIZE(omap2_gp_early_devices)); +#endif } struct sys_timer omap_timer = { diff --git a/arch/arm/mach-omap2/timer-mpu.c b/arch/arm/mach-omap2/timer-mpu.c deleted file mode 100644 index 1fd5ca5..0000000 --- a/arch/arm/mach-omap2/timer-mpu.c +++ /dev/null @@ -1,40 +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 -#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); - twd_timer_setup(evt); - return 0; -} -