summaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorGraf Yang <graf.yang@analog.com>2009-01-07 16:14:39 +0100
committerBryan Wu <cooloney@kernel.org>2009-01-07 16:14:39 +0100
commitf994607a2e118aedf1116a58ecd16126dbb83d28 (patch)
tree2b1764e2a037c904aa1358a54852eeb6e349cf6f /arch
parentBlackfin arch: fix bugs in linker script when using upstream binutils (diff)
downloadlinux-f994607a2e118aedf1116a58ecd16126dbb83d28.tar.xz
linux-f994607a2e118aedf1116a58ecd16126dbb83d28.zip
Blackfin arch: get oprofile work for user space
Signed-off-by: Graf Yang <graf.yang@analog.com> Signed-off-by: Bryan Wu <cooloney@kernel.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/blackfin/Kconfig10
-rw-r--r--arch/blackfin/mach-common/interrupt.S12
-rw-r--r--arch/blackfin/mach-common/irqpanic.c4
-rw-r--r--arch/blackfin/oprofile/common.c14
-rw-r--r--arch/blackfin/oprofile/op_blackfin.h2
-rw-r--r--arch/blackfin/oprofile/op_model_bf533.c4
6 files changed, 21 insertions, 25 deletions
diff --git a/arch/blackfin/Kconfig b/arch/blackfin/Kconfig
index 5f09d9349322..a394957ddaf4 100644
--- a/arch/blackfin/Kconfig
+++ b/arch/blackfin/Kconfig
@@ -60,10 +60,6 @@ config GENERIC_CALIBRATE_DELAY
bool
default y
-config HARDWARE_PM
- def_bool y
- depends on OPROFILE
-
source "init/Kconfig"
source "kernel/Kconfig.preempt"
@@ -1019,6 +1015,12 @@ config EBIU_FCTLVAL
hex "Flash Memory Bank Control Register"
depends on BF54x
default 6
+
+config HARDWARE_PM
+ bool "OProfile use hardware porformance monitor"
+ depends on OPROFILE
+ default n
+
endmenu
#############################################################################
diff --git a/arch/blackfin/mach-common/interrupt.S b/arch/blackfin/mach-common/interrupt.S
index 4a2ec7a9675a..2604b532897c 100644
--- a/arch/blackfin/mach-common/interrupt.S
+++ b/arch/blackfin/mach-common/interrupt.S
@@ -152,6 +152,12 @@ ENTRY(_evt_ivhw)
1:
#endif
+ # We are going to dump something out, so make sure we print IPEND properly
+ p2.l = lo(IPEND);
+ p2.h = hi(IPEND);
+ r0 = [p2];
+ [sp + PT_IPEND] = r0;
+
#ifdef CONFIG_HARDWARE_PM
r7 = [sp + PT_SEQSTAT];
r7 = r7 >>> 0xe;
@@ -161,11 +167,6 @@ ENTRY(_evt_ivhw)
cc = r7 == r5;
if cc jump .Lcall_do_ovf; /* deal with performance counter overflow */
#endif
- # We are going to dump something out, so make sure we print IPEND properly
- p2.l = lo(IPEND);
- p2.h = hi(IPEND);
- r0 = [p2];
- [sp + PT_IPEND] = r0;
/* set the EXCAUSE to HWERR for trap_c */
r0 = [sp + PT_SEQSTAT];
@@ -196,6 +197,7 @@ ENTRY(_evt_ivhw)
#ifdef CONFIG_HARDWARE_PM
.Lcall_do_ovf:
+ R0 = SP;
SP += -12;
call _pm_overflow;
SP += 12;
diff --git a/arch/blackfin/mach-common/irqpanic.c b/arch/blackfin/mach-common/irqpanic.c
index 606ded9ff4e1..7b69413c1556 100644
--- a/arch/blackfin/mach-common/irqpanic.c
+++ b/arch/blackfin/mach-common/irqpanic.c
@@ -139,8 +139,8 @@ asmlinkage void irq_panic(int reason, struct pt_regs *regs)
/*
* call the handler of Performance overflow
*/
-asmlinkage void pm_overflow(int irq, struct pt_regs *regs)
+asmlinkage void pm_overflow(struct pt_regs *regs)
{
- pm_overflow_handler(irq, regs);
+ pm_overflow_handler(regs);
}
#endif
diff --git a/arch/blackfin/oprofile/common.c b/arch/blackfin/oprofile/common.c
index f34795a2e481..cf8f48848d1b 100644
--- a/arch/blackfin/oprofile/common.c
+++ b/arch/blackfin/oprofile/common.c
@@ -126,20 +126,12 @@ static int op_bfin_create_files(struct super_block *sb, struct dentry *root)
int __init oprofile_arch_init(struct oprofile_operations *ops)
{
#ifdef CONFIG_HARDWARE_PM
- unsigned int dspid;
-
mutex_init(&pfmon_lock);
- dspid = bfin_dspid();
-
- printk(KERN_INFO "Oprofile got the cpu id is 0x%x. \n", dspid);
- switch (dspid) {
- case BFIN_533_ID:
- model = &op_model_bfin533;
- model->num_counters = 2;
- break;
- case BFIN_537_ID:
+ switch (bfin_read_CHIPID() & CHIPID_MANUFACTURE) {
+ case 0xca:
+ printk(KERN_INFO "Oprofile: cpu vendor is Analog Devices.\n");
model = &op_model_bfin533;
model->num_counters = 2;
break;
diff --git a/arch/blackfin/oprofile/op_blackfin.h b/arch/blackfin/oprofile/op_blackfin.h
index 05dd08c9d154..37aec0eb00d0 100644
--- a/arch/blackfin/oprofile/op_blackfin.h
+++ b/arch/blackfin/oprofile/op_blackfin.h
@@ -93,6 +93,6 @@ static inline void count_write(unsigned int *count)
CSYNC();
}
-extern int pm_overflow_handler(int irq, struct pt_regs *regs);
+extern int pm_overflow_handler(struct pt_regs *regs);
#endif
diff --git a/arch/blackfin/oprofile/op_model_bf533.c b/arch/blackfin/oprofile/op_model_bf533.c
index d1c698bb9ee5..0e34df169b2d 100644
--- a/arch/blackfin/oprofile/op_model_bf533.c
+++ b/arch/blackfin/oprofile/op_model_bf533.c
@@ -52,7 +52,7 @@ static unsigned curr_pfctl, curr_count[2];
static int bfin533_reg_setup(struct op_counter_config *ctr)
{
- unsigned int pfctl = ctr_read();
+ unsigned int pfctl = 0;
unsigned int count[2];
/* set Blackfin perf monitor regs with ctr */
@@ -118,7 +118,7 @@ static int get_kernel(void)
return is_kernel;
}
-int pm_overflow_handler(int irq, struct pt_regs *regs)
+int pm_overflow_handler(struct pt_regs *regs)
{
int is_kernel;
int i, cpu;