From patchwork Thu Jun 16 19:06:31 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marc Zyngier X-Patchwork-Id: 888352 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 p5GJ9sgo010121 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Thu, 16 Jun 2011 19:10:15 GMT Received: from canuck.infradead.org ([2001:4978:20e::1]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1QXHwY-00049S-Uq; Thu, 16 Jun 2011 19:09:31 +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 1QXHwX-00049y-8m; Thu, 16 Jun 2011 19:09:29 +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-0003pK-7P for linux-arm-kernel@canuck.infradead.org; Thu, 16 Jun 2011 19:07:48 +0000 Received: from service87.mimecast.com ([94.185.240.25]) by casper.infradead.org with smtp (Exim 4.76 #1 (Red Hat Linux)) id 1QXHuq-0001IX-2d for linux-arm-kernel@lists.infradead.org; Thu, 16 Jun 2011 19:07:46 +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:36 +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 03/16] ARM: local timers: move realview to LOCAL_TIMER_DEVICES/ARM_SMP_TWD Date: Thu, 16 Jun 2011 20:06:31 +0100 Message-Id: <1308251204-16719-4-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.0374 (UTC) FILETIME=[8D263F60:01CC2C58] X-MC-Unique: 111061620073601701 X-CRM114-Version: 20090807-BlameThorstenAndJenny ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20110616_200744_251790_5A65CC54 X-CRM114-Status: GOOD ( 13.42 ) 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 (demeter2.kernel.org [140.211.167.43]); Thu, 16 Jun 2011 19:10:15 +0000 (UTC) Convert the RealView platforms to use the new arm_smp_twd driver. Add the platform devices and register them as early platform devices. Tested on a PB11MP. Signed-off-by: Marc Zyngier --- arch/arm/mach-realview/Kconfig | 8 +++++++ arch/arm/mach-realview/realview_eb.c | 31 ++++++++++++++++++++++++++--- arch/arm/mach-realview/realview_pb11mp.c | 30 +++++++++++++++++++++++++--- arch/arm/mach-realview/realview_pbx.c | 31 +++++++++++++++++++++++++---- 4 files changed, 87 insertions(+), 13 deletions(-) diff --git a/arch/arm/mach-realview/Kconfig b/arch/arm/mach-realview/Kconfig index b9a9805..7eec270 100644 --- a/arch/arm/mach-realview/Kconfig +++ b/arch/arm/mach-realview/Kconfig @@ -12,6 +12,8 @@ config REALVIEW_EB_A9MP bool "Support Multicore Cortex-A9 Tile" depends on MACH_REALVIEW_EB select CPU_V7 + select LOCAL_TIMER_DEVICES + select ARM_SMP_TWD help Enable support for the Cortex-A9MPCore tile fitted to the Realview(R) Emulation Baseboard platform. @@ -21,6 +23,8 @@ config REALVIEW_EB_ARM11MP depends on MACH_REALVIEW_EB select CPU_V6K select ARCH_HAS_BARRIERS if SMP + select LOCAL_TIMER_DEVICES + select ARM_SMP_TWD help Enable support for the ARM11MPCore tile fitted to the Realview(R) Emulation Baseboard platform. @@ -40,6 +44,8 @@ config MACH_REALVIEW_PB11MP select ARM_GIC select HAVE_PATA_PLATFORM select ARCH_HAS_BARRIERS if SMP + select LOCAL_TIMER_DEVICES + select ARM_SMP_TWD help Include support for the ARM(R) RealView(R) Platform Baseboard for the ARM11MPCore. This platform has an on-board ARM11MPCore and has @@ -79,6 +85,8 @@ config MACH_REALVIEW_PBX select HAVE_PATA_PLATFORM select ARCH_SPARSEMEM_ENABLE if CPU_V7 && !REALVIEW_HIGH_PHYS_OFFSET select ZONE_DMA if SPARSEMEM + select LOCAL_TIMER_DEVICES + select ARM_SMP_TWD help Include support for the ARM(R) RealView(R) Platform Baseboard Explore. diff --git a/arch/arm/mach-realview/realview_eb.c b/arch/arm/mach-realview/realview_eb.c index 10e75fa..fbc941c 100644 --- a/arch/arm/mach-realview/realview_eb.c +++ b/arch/arm/mach-realview/realview_eb.c @@ -36,7 +36,6 @@ #include #include #include -#include #include #include @@ -330,6 +329,31 @@ static struct platform_device char_lcd_device = { .resource = char_lcd_resources, }; +static struct resource eb_twd_resources[] = { + { + .start = REALVIEW_EB11MP_TWD_BASE, + .end = REALVIEW_EB11MP_TWD_BASE + 0x10, + .flags = IORESOURCE_MEM, + }, + { + .start = IRQ_LOCALTIMER, + .end = IRQ_LOCALTIMER, + .flags = IORESOURCE_IRQ, + }, +}; + +static struct platform_device eb_twd_device = { + .name = "arm_smp_twd", + .id = -1, + .resource = eb_twd_resources, + .num_resources = ARRAY_SIZE(eb_twd_resources), +}; + +static struct platform_device *eb_early_devices[] = { + &eb_twd_device, +}; + + static void __init gic_init_irq(void) { if (core_tile_eb11mp() || core_tile_a9mp()) { @@ -401,14 +425,13 @@ static void __init realview_eb_timer_init(void) timer3_va_base = __io_address(REALVIEW_EB_TIMER2_3_BASE) + 0x20; if (core_tile_eb11mp() || core_tile_a9mp()) { -#ifdef CONFIG_LOCAL_TIMERS - twd_base = __io_address(REALVIEW_EB11MP_TWD_BASE); -#endif timer_irq = IRQ_EB11MP_TIMER0_1; } else timer_irq = IRQ_EB_TIMER0_1; realview_timer_init(timer_irq); + early_platform_add_devices(eb_early_devices, + ARRAY_SIZE(eb_early_devices)); } static struct sys_timer realview_eb_timer = { diff --git a/arch/arm/mach-realview/realview_pb11mp.c b/arch/arm/mach-realview/realview_pb11mp.c index b2985fc..9ed17c1 100644 --- a/arch/arm/mach-realview/realview_pb11mp.c +++ b/arch/arm/mach-realview/realview_pb11mp.c @@ -36,7 +36,6 @@ #include #include #include -#include #include #include @@ -276,6 +275,30 @@ static struct platform_device pmu_device = { .resource = pmu_resources, }; +static struct resource realview_pb11mp_twd_resources[] = { + { + .start = REALVIEW_TC11MP_TWD_BASE, + .end = REALVIEW_TC11MP_TWD_BASE + 0x10, + .flags = IORESOURCE_MEM, + }, + { + .start = IRQ_LOCALTIMER, + .end = IRQ_LOCALTIMER, + .flags = IORESOURCE_IRQ, + }, +}; + +static struct platform_device realview_pb11mp_twd_device = { + .name = "arm_smp_twd", + .id = -1, + .resource = realview_pb11mp_twd_resources, + .num_resources = ARRAY_SIZE(realview_pb11mp_twd_resources), +}; + +static struct platform_device *realview_pb11mp_early_devices[] = { + &realview_pb11mp_twd_device, +}; + static void __init gic_init_irq(void) { unsigned int pldctrl; @@ -305,10 +328,9 @@ static void __init realview_pb11mp_timer_init(void) timer2_va_base = __io_address(REALVIEW_PB11MP_TIMER2_3_BASE); timer3_va_base = __io_address(REALVIEW_PB11MP_TIMER2_3_BASE) + 0x20; -#ifdef CONFIG_LOCAL_TIMERS - twd_base = __io_address(REALVIEW_TC11MP_TWD_BASE); -#endif realview_timer_init(IRQ_TC11MP_TIMER0_1); + early_platform_add_devices(realview_pb11mp_early_devices, + ARRAY_SIZE(realview_pb11mp_early_devices)); } static struct sys_timer realview_pb11mp_timer = { diff --git a/arch/arm/mach-realview/realview_pbx.c b/arch/arm/mach-realview/realview_pbx.c index 92ace2c..768faec 100644 --- a/arch/arm/mach-realview/realview_pbx.c +++ b/arch/arm/mach-realview/realview_pbx.c @@ -31,7 +31,6 @@ #include #include #include -#include #include #include #include @@ -288,6 +287,30 @@ static struct platform_device pmu_device = { .resource = pmu_resources, }; +static struct resource realview_pbx_twd_resources[] = { + { + .start = REALVIEW_PBX_TILE_TWD_BASE, + .end = REALVIEW_PBX_TILE_TWD_BASE + 0x10, + .flags = IORESOURCE_MEM, + }, + { + .start = IRQ_LOCALTIMER, + .end = IRQ_LOCALTIMER, + .flags = IORESOURCE_IRQ, + }, +}; + +static struct platform_device realview_pbx_twd_device = { + .name = "arm_smp_twd", + .id = -1, + .resource = realview_pbx_twd_resources, + .num_resources = ARRAY_SIZE(realview_pbx_twd_resources), +}; + +static struct platform_device *realview_pbx_early_devices[] = { + &realview_pbx_twd_device, +}; + static void __init gic_init_irq(void) { /* ARM PBX on-board GIC */ @@ -308,11 +331,9 @@ static void __init realview_pbx_timer_init(void) timer2_va_base = __io_address(REALVIEW_PBX_TIMER2_3_BASE); timer3_va_base = __io_address(REALVIEW_PBX_TIMER2_3_BASE) + 0x20; -#ifdef CONFIG_LOCAL_TIMERS - if (core_tile_pbx11mp() || core_tile_pbxa9mp()) - twd_base = __io_address(REALVIEW_PBX_TILE_TWD_BASE); -#endif realview_timer_init(IRQ_PBX_TIMER0_1); + early_platform_add_devices(realview_pbx_early_devices, + ARRAY_SIZE(realview_pbx_early_devices)); } static struct sys_timer realview_pbx_timer = {