From 2915d35f5d245524f766c38eaea10d622b7d5c35 Mon Sep 17 00:00:00 2001 From: Christopher Kenna Date: Wed, 10 Oct 2012 01:11:42 -0400 Subject: Naively enable some performance counters. --- arch/arm/mach-omap2/board-omap4panda.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'arch/arm/mach-omap2') diff --git a/arch/arm/mach-omap2/board-omap4panda.c b/arch/arm/mach-omap2/board-omap4panda.c index ecb59588e47..b37d395407a 100644 --- a/arch/arm/mach-omap2/board-omap4panda.c +++ b/arch/arm/mach-omap2/board-omap4panda.c @@ -737,6 +737,19 @@ static int omap_panda_netdev_event(struct notifier_block *this, return NOTIFY_DONE; } +#ifdef CONFIG_HW_PERF_EVENTS +#define enable_perf_counters() do { } while (0) +#else +static void __init enable_perf_counters(void) +{ + /* enable user-mode access to the performance counter */ + asm volatile("mcr p15, 0, %0, c9, c14, 0" : : "r" (1)); + + /* disable counter overflow interrupts (just in case) */ + asm volatile("mcr p15, 0, %0, c9, c14, 2" : : "r" (0x8000000f)); +} +#endif + static struct notifier_block omap_panda_netdev_notifier = { .notifier_call = omap_panda_netdev_event, .priority = 1, @@ -765,6 +778,7 @@ static void __init omap4_panda_init(void) omap4_ehci_init(); usb_musb_init(&musb_board_data); omap4_panda_display_init(); + enable_perf_counters(); } static void __init omap4_panda_map_io(void) -- cgit v1.2.2