From patchwork Wed Sep 5 02:48:37 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tetsuyuki Kobayashi X-Patchwork-Id: 1404911 Return-Path: X-Original-To: patchwork-linux-sh@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 4AD2C3FC71 for ; Wed, 5 Sep 2012 02:49:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752953Ab2IECt2 (ORCPT ); Tue, 4 Sep 2012 22:49:28 -0400 Received: from vrgw4.firstserver.ne.jp ([164.46.1.47]:45733 "EHLO vrgw4.firstserver.ne.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751844Ab2IECt1 (ORCPT ); Tue, 4 Sep 2012 22:49:27 -0400 Received: from fvrsp18.firstserver.ne.jp (fvrsp18.firstserver.ne.jp [203.183.56.4]) by vrgw4.firstserver.ne.jp (8.13.8/8.13.8/FirstServer) with ESMTP id q852nKPK021523; Wed, 5 Sep 2012 11:49:20 +0900 (envelope-from koba@kmckk.co.jp) Received: from 203.137.25.97 (203.137.25.97) by fvrsp18.firstserver.ne.jp (F-Secure/virusgw_smtp/407/fvrsp18.firstserver.ne.jp); Wed, 05 Sep 2012 11:49:20 +0900 (JST) X-Virus-Status: clean(F-Secure/virusgw_smtp/407/fvrsp18.firstserver.ne.jp) Received: from localhost (58-188-103-12f2.kns1.eonet.ne.jp [58.188.103.12]) (authenticated (0 bits)) by mail.kmckk.co.jp (8.14.3/8.11.3) with ESMTP id q852nK6J006376; Wed, 5 Sep 2012 11:49:20 +0900 From: Tetsuyuki Kobayshi To: horms@verge.net.au, linux-sh@vger.kernel.org Cc: magnus.damm@gmail.com, kuninori.morimoto.gx@renesas.com, Tetsuyuki Kobayashi Subject: [PATCH 2/2] ARM: shmobile: emev2: enable PMU(Performance Monitoring Unit) Date: Wed, 5 Sep 2012 11:48:37 +0900 Message-Id: <1346813317-4030-3-git-send-email-koba@kmckk.co.jp> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1346813317-4030-1-git-send-email-koba@kmckk.co.jp> References: <1346813317-4030-1-git-send-email-koba@kmckk.co.jp> Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org From: Tetsuyuki Kobayashi This patch enables PMU(Performance Monitoring Unit) for emev2 when compiled with CONFIG_HW_PERF_EVENTS. Signed-off-by: Tetsuyuki Kobayashi --- arch/arm/mach-shmobile/setup-emev2.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/arch/arm/mach-shmobile/setup-emev2.c b/arch/arm/mach-shmobile/setup-emev2.c index dae9aa6..f3ff171 100644 --- a/arch/arm/mach-shmobile/setup-emev2.c +++ b/arch/arm/mach-shmobile/setup-emev2.c @@ -36,6 +36,7 @@ #include #include #include +#include static struct map_desc emev2_io_desc[] __initdata = { #ifdef CONFIG_SMP @@ -356,6 +357,28 @@ static struct platform_device gio4_device = { }, }; +#ifdef CONFIG_HW_PERF_EVENTS +static struct resource pmu_resources[] = { + [0] = { + .start = 152, + .end = 152, + .flags = IORESOURCE_IRQ, + }, + [1] = { + .start = 153, + .end = 153, + .flags = IORESOURCE_IRQ, + }, +}; + +static struct platform_device pmu_device = { + .name = "arm-pmu", + .id = ARM_PMU_DEVICE_CPU, + .num_resources = ARRAY_SIZE(pmu_resources), + .resource = pmu_resources, +}; +#endif + static struct platform_device *emev2_early_devices[] __initdata = { &uart0_device, &uart1_device, @@ -370,6 +393,9 @@ static struct platform_device *emev2_late_devices[] __initdata = { &gio2_device, &gio3_device, &gio4_device, +#ifdef CONFIG_HW_PERF_EVENTS + &pmu_device, +#endif }; void __init emev2_add_standard_devices(void)