7ab5ff76bd8b9252e6b0ef451a5d37f618b6c48c
[openwrt/svn-archive/archive.git] / target / linux / lantiq / patches-3.2 / 0018-MIPS-lantiq-enable-oprofile-support-on-lantiq-target.patch
1 From e0bd3f1b16fbce1f0f7900a0dd624f9dc8a47f78 Mon Sep 17 00:00:00 2001
2 From: John Crispin <blogic@openwrt.org>
3 Date: Wed, 24 Aug 2011 13:28:55 +0200
4 Subject: [PATCH 18/70] MIPS: lantiq: enable oprofile support on lantiq
5 targets
6
7 This patch sets the performance counters irq and HAVE_OPROFILE flag for Lantiq
8 SoCs.
9
10 Signed-off-by: John Crispin <blogic@openwrt.org>
11 ---
12 arch/mips/Kconfig | 1 +
13 arch/mips/lantiq/irq.c | 5 +++++
14 2 files changed, 6 insertions(+), 0 deletions(-)
15
16 diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
17 index d46f1da..c1ceadb 100644
18 --- a/arch/mips/Kconfig
19 +++ b/arch/mips/Kconfig
20 @@ -226,6 +226,7 @@ config LANTIQ
21 select SWAP_IO_SPACE
22 select BOOT_RAW
23 select HAVE_CLK
24 + select HAVE_OPROFILE
25 select MIPS_MACHINE
26
27 config LASAT
28 diff --git a/arch/mips/lantiq/irq.c b/arch/mips/lantiq/irq.c
29 index 17c057f..0b2ed87 100644
30 --- a/arch/mips/lantiq/irq.c
31 +++ b/arch/mips/lantiq/irq.c
32 @@ -40,6 +40,9 @@
33
34 #define MAX_EIU 6
35
36 +/* the performance counter */
37 +#define LTQ_PERF_IRQ (INT_NUM_IM4_IRL0 + 31)
38 +
39 /* irqs generated by device attached to the EBU need to be acked in
40 * a special manner
41 */
42 @@ -318,6 +321,8 @@ void __init arch_init_irq(void)
43 set_c0_status(IE_SW0 | IE_SW1 | IE_IRQ0 | IE_IRQ1 |
44 IE_IRQ2 | IE_IRQ3 | IE_IRQ4 | IE_IRQ5);
45 #endif
46 +
47 + cp0_perfcount_irq = LTQ_PERF_IRQ;
48 }
49
50 unsigned int __cpuinit get_c0_compare_int(void)
51 --
52 1.7.7.1
53