From patchwork Thu Sep 6 11:14:06 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tetsuyuki Kobayashi X-Patchwork-Id: 1413081 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 9A7143FC71 for ; Thu, 6 Sep 2012 11:16:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751342Ab2IFLQP (ORCPT ); Thu, 6 Sep 2012 07:16:15 -0400 Received: from vrgw4.firstserver.ne.jp ([164.46.1.47]:58513 "EHLO vrgw4.firstserver.ne.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751004Ab2IFLQO (ORCPT ); Thu, 6 Sep 2012 07:16:14 -0400 Received: from fvrsp22.firstserver.ne.jp (fvrsp22.firstserver.ne.jp [203.183.196.4]) by vrgw4.firstserver.ne.jp (8.13.8/8.13.8/FirstServer) with ESMTP id q86BFeq8023544; Thu, 6 Sep 2012 20:15:40 +0900 (envelope-from koba@kmckk.co.jp) Received: from 203.137.25.97 (203.137.25.97) by fvrsp22.firstserver.ne.jp (F-Secure/virusgw_smtp/407/fvrsp22.firstserver.ne.jp); Thu, 06 Sep 2012 20:15:40 +0900 (JST) X-Virus-Status: clean(F-Secure/virusgw_smtp/407/fvrsp22.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 q86BFeEr001911; Thu, 6 Sep 2012 20:15:40 +0900 From: Tetsuyuki Kobayshi To: will.deacon@arm.com Cc: horms@verge.net.au, linux-sh@vger.kernel.org, magnus.damm@gmail.com, kuninori.morimoto.gx@renesas.com, lethal@linux-sh.org, arm@kernel.org, linux-arm-kernel@lists.infradead.org, Tetsuyuki Kobayashi Subject: [PATCH v3 1/2] ARM: shmobile: sh73a0: enable PMU(Performance Monitoring Unit) Date: Thu, 6 Sep 2012 20:14:06 +0900 Message-Id: <1346930047-9541-2-git-send-email-koba@kmckk.co.jp> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1346930047-9541-1-git-send-email-koba@kmckk.co.jp> References: <50487370.6000409@kmckk.co.jp> <1346930047-9541-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 sh73a0. Signed-off-by: Tetsuyuki Kobayashi --- Changes for v2: - Removed #ifdef CONFIG_HW_PERF_EVENTS - Added kzm9g_defconfig Changes for v3: - Rebased to pmu/clean on arm-soc. arch/arm/configs/kzm9g_defconfig | 1 + arch/arm/mach-shmobile/setup-sh73a0.c | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/arch/arm/configs/kzm9g_defconfig b/arch/arm/configs/kzm9g_defconfig index 2388c86..5d0c667 100644 --- a/arch/arm/configs/kzm9g_defconfig +++ b/arch/arm/configs/kzm9g_defconfig @@ -14,6 +14,7 @@ CONFIG_NAMESPACES=y CONFIG_CC_OPTIMIZE_FOR_SIZE=y CONFIG_SYSCTL_SYSCALL=y CONFIG_EMBEDDED=y +CONFIG_PERF_EVENTS=y CONFIG_SLAB=y CONFIG_MODULES=y CONFIG_MODULE_FORCE_LOAD=y diff --git a/arch/arm/mach-shmobile/setup-sh73a0.c b/arch/arm/mach-shmobile/setup-sh73a0.c index d230af6..38ed2dd 100644 --- a/arch/arm/mach-shmobile/setup-sh73a0.c +++ b/arch/arm/mach-shmobile/setup-sh73a0.c @@ -734,6 +734,26 @@ static struct platform_device mpdma0_device = { }, }; +static struct resource pmu_resources[] = { + [0] = { + .start = gic_spi(55), + .end = gic_spi(55), + .flags = IORESOURCE_IRQ, + }, + [1] = { + .start = gic_spi(56), + .end = gic_spi(56), + .flags = IORESOURCE_IRQ, + }, +}; + +static struct platform_device pmu_device = { + .name = "arm-pmu", + .id = -1, + .num_resources = ARRAY_SIZE(pmu_resources), + .resource = pmu_resources, +}; + static struct platform_device *sh73a0_early_devices[] __initdata = { &scif0_device, &scif1_device, @@ -757,6 +777,7 @@ static struct platform_device *sh73a0_late_devices[] __initdata = { &i2c4_device, &dma0_device, &mpdma0_device, + &pmu_device, }; #define SRCR2 0xe61580b0