Skip to content

Commit f994607

Browse files
Graf YangBryan Wu
authored andcommitted
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>
1 parent 6f98529 commit f994607

6 files changed

Lines changed: 21 additions & 25 deletions

File tree

‎arch/blackfin/Kconfig‎

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,6 @@ config GENERIC_CALIBRATE_DELAY
6060
bool
6161
default y
6262

63-
config HARDWARE_PM
64-
def_bool y
65-
depends on OPROFILE
66-
6763
source "init/Kconfig"
6864

6965
source "kernel/Kconfig.preempt"
@@ -1019,6 +1015,12 @@ config EBIU_FCTLVAL
10191015
hex "Flash Memory Bank Control Register"
10201016
depends on BF54x
10211017
default 6
1018+
1019+
config HARDWARE_PM
1020+
bool "OProfile use hardware porformance monitor"
1021+
depends on OPROFILE
1022+
default n
1023+
10221024
endmenu
10231025

10241026
#############################################################################

‎arch/blackfin/mach-common/interrupt.S‎

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,12 @@ ENTRY(_evt_ivhw)
152152
1:
153153
#endif
154154

155+
# We are going to dump something out, so make sure we print IPEND properly
156+
p2.l = lo(IPEND);
157+
p2.h = hi(IPEND);
158+
r0 = [p2];
159+
[sp + PT_IPEND] = r0;
160+
155161
#ifdef CONFIG_HARDWARE_PM
156162
r7 = [sp + PT_SEQSTAT];
157163
r7 = r7 >>> 0xe;
@@ -161,11 +167,6 @@ ENTRY(_evt_ivhw)
161167
cc = r7 == r5;
162168
if cc jump .Lcall_do_ovf; /* deal with performance counter overflow */
163169
#endif
164-
# We are going to dump something out, so make sure we print IPEND properly
165-
p2.l = lo(IPEND);
166-
p2.h = hi(IPEND);
167-
r0 = [p2];
168-
[sp + PT_IPEND] = r0;
169170

170171
/* set the EXCAUSE to HWERR for trap_c */
171172
r0 = [sp + PT_SEQSTAT];
@@ -196,6 +197,7 @@ ENTRY(_evt_ivhw)
196197
#ifdef CONFIG_HARDWARE_PM
197198
.Lcall_do_ovf:
198199

200+
R0 = SP;
199201
SP += -12;
200202
call _pm_overflow;
201203
SP += 12;

‎arch/blackfin/mach-common/irqpanic.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,8 +139,8 @@ asmlinkage void irq_panic(int reason, struct pt_regs *regs)
139139
/*
140140
* call the handler of Performance overflow
141141
*/
142-
asmlinkage void pm_overflow(int irq, struct pt_regs *regs)
142+
asmlinkage void pm_overflow(struct pt_regs *regs)
143143
{
144-
pm_overflow_handler(irq, regs);
144+
pm_overflow_handler(regs);
145145
}
146146
#endif

‎arch/blackfin/oprofile/common.c‎

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -126,20 +126,12 @@ static int op_bfin_create_files(struct super_block *sb, struct dentry *root)
126126
int __init oprofile_arch_init(struct oprofile_operations *ops)
127127
{
128128
#ifdef CONFIG_HARDWARE_PM
129-
unsigned int dspid;
130-
131129
mutex_init(&pfmon_lock);
132130

133-
dspid = bfin_dspid();
134-
135-
printk(KERN_INFO "Oprofile got the cpu id is 0x%x. \n", dspid);
136131

137-
switch (dspid) {
138-
case BFIN_533_ID:
139-
model = &op_model_bfin533;
140-
model->num_counters = 2;
141-
break;
142-
case BFIN_537_ID:
132+
switch (bfin_read_CHIPID() & CHIPID_MANUFACTURE) {
133+
case 0xca:
134+
printk(KERN_INFO "Oprofile: cpu vendor is Analog Devices.\n");
143135
model = &op_model_bfin533;
144136
model->num_counters = 2;
145137
break;

‎arch/blackfin/oprofile/op_blackfin.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,6 @@ static inline void count_write(unsigned int *count)
9393
CSYNC();
9494
}
9595

96-
extern int pm_overflow_handler(int irq, struct pt_regs *regs);
96+
extern int pm_overflow_handler(struct pt_regs *regs);
9797

9898
#endif

‎arch/blackfin/oprofile/op_model_bf533.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ static unsigned curr_pfctl, curr_count[2];
5252

5353
static int bfin533_reg_setup(struct op_counter_config *ctr)
5454
{
55-
unsigned int pfctl = ctr_read();
55+
unsigned int pfctl = 0;
5656
unsigned int count[2];
5757

5858
/* set Blackfin perf monitor regs with ctr */
@@ -118,7 +118,7 @@ static int get_kernel(void)
118118
return is_kernel;
119119
}
120120

121-
int pm_overflow_handler(int irq, struct pt_regs *regs)
121+
int pm_overflow_handler(struct pt_regs *regs)
122122
{
123123
int is_kernel;
124124
int i, cpu;

0 commit comments

Comments
 (0)