From patchwork Thu Jun 16 19:06:32 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marc Zyngier X-Patchwork-Id: 888332 Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by demeter1.kernel.org (8.14.4/8.14.4) with ESMTP id p5GJ9AiY014238 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Thu, 16 Jun 2011 19:09:31 GMT Received: from canuck.infradead.org ([2001:4978:20e::1]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1QXHw2-0003Uu-9Y; Thu, 16 Jun 2011 19:08:58 +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 1QXHw0-00040r-RS; Thu, 16 Jun 2011 19:08:56 +0000 Received: from casper.infradead.org ([2001:770:15f::2]) by canuck.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1QXHus-0003oz-7Y for linux-arm-kernel@canuck.infradead.org; Thu, 16 Jun 2011 19:07:46 +0000 Received: from service87.mimecast.com ([94.185.240.25]) by casper.infradead.org with smtp (Exim 4.76 #1 (Red Hat Linux)) id 1QXHup-0001IO-Um for linux-arm-kernel@lists.infradead.org; Thu, 16 Jun 2011 19:07:44 +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:38 +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:52 +0100 From: Marc Zyngier To: linux-arm-kernel@lists.infradead.org Subject: [RFC PATCH 04/16] ARM: local timers: move vexpress to LOCAL_TIMER_DEVICES/ARM_SMP_TWD Date: Thu, 16 Jun 2011 20:06:32 +0100 Message-Id: <1308251204-16719-5-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:52.0670 (UTC) FILETIME=[8D5369E0:01CC2C58] X-MC-Unique: 111061620073801001 X-CRM114-Version: 20090807-BlameThorstenAndJenny ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20110616_200744_095310_57608068 X-CRM114-Status: GOOD ( 13.86 ) 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: Thomas Gleixner , 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 (demeter1.kernel.org [140.211.167.41]); Thu, 16 Jun 2011 19:09:31 +0000 (UTC) Convert the vexpress platform (actually the CA9x4 tile) to use the new arm_smp_twd driver. Add the platform device and register it as early platform device. Tested on a VExpress. Signed-off-by: Marc Zyngier --- arch/arm/mach-vexpress/Kconfig | 2 ++ arch/arm/mach-vexpress/ct-ca9x4.c | 30 ++++++++++++++++++++++++++---- 2 files changed, 28 insertions(+), 4 deletions(-) diff --git a/arch/arm/mach-vexpress/Kconfig b/arch/arm/mach-vexpress/Kconfig index 6f59932..c26a5ec 100644 --- a/arch/arm/mach-vexpress/Kconfig +++ b/arch/arm/mach-vexpress/Kconfig @@ -28,6 +28,8 @@ config ARCH_VEXPRESS_CA9X4 depends on VEXPRESS_ORIGINAL_MEMORY_MAP select CPU_V7 select ARM_GIC + select LOCAL_TIMER_DEVICES + select ARM_SMP_TWD select ARM_ERRATA_720789 select ARM_ERRATA_751472 select ARM_ERRATA_753970 diff --git a/arch/arm/mach-vexpress/ct-ca9x4.c b/arch/arm/mach-vexpress/ct-ca9x4.c index b06d056..4977e09 100644 --- a/arch/arm/mach-vexpress/ct-ca9x4.c +++ b/arch/arm/mach-vexpress/ct-ca9x4.c @@ -15,7 +15,6 @@ #include #include #include -#include #include @@ -49,11 +48,32 @@ static struct map_desc ct_ca9x4_io_desc[] __initdata = { }, }; +static struct resource ct_ca9x4_twd_resources[] = { + { + .start = A9_MPCORE_TWD, + .end = A9_MPCORE_TWD + 0x10, + .flags = IORESOURCE_MEM, + }, + { + .start = IRQ_LOCALTIMER, + .end = IRQ_LOCALTIMER, + .flags = IORESOURCE_IRQ, + }, +}; + +static struct platform_device ct_ca9x4_twd_device = { + .name = "arm_smp_twd", + .id = -1, + .resource = ct_ca9x4_twd_resources, + .num_resources = ARRAY_SIZE(ct_ca9x4_twd_resources), +}; + +static struct platform_device *ct_ca9x4_early_devices[] = { + &ct_ca9x4_twd_device, +}; + static void __init ct_ca9x4_map_io(void) { -#ifdef CONFIG_LOCAL_TIMERS - twd_base = MMIO_P2V(A9_MPCORE_TWD); -#endif iotable_init(ct_ca9x4_io_desc, ARRAY_SIZE(ct_ca9x4_io_desc)); } @@ -192,6 +212,8 @@ static struct platform_device pmu_device = { static void __init ct_ca9x4_init_early(void) { clkdev_add_table(lookups, ARRAY_SIZE(lookups)); + early_platform_add_devices(ct_ca9x4_early_devices, + ARRAY_SIZE(ct_ca9x4_early_devices)); } static void __init ct_ca9x4_init(void)