Skip to content

Commit

Permalink
Blackfin arch: remove hardware PM code, oprofile not use it
Browse files Browse the repository at this point in the history
Signed-off-by: Graf Yang <graf.yang@analog.com>
Signed-off-by: Bryan Wu <cooloney@kernel.org>
  • Loading branch information
Graf Yang authored and Bryan Wu committed Jan 7, 2009
1 parent e32f55d commit 172e65e
Show file tree
Hide file tree
Showing 8 changed files with 0 additions and 492 deletions.
6 changes: 0 additions & 6 deletions arch/blackfin/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -1007,12 +1007,6 @@ 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=y
default n

endmenu

#############################################################################
Expand Down
22 changes: 0 additions & 22 deletions arch/blackfin/mach-common/interrupt.S
Original file line number Diff line number Diff line change
Expand Up @@ -165,16 +165,6 @@ ENTRY(_evt_ivhw)
r0 = [p2];
[sp + PT_IPEND] = r0;

#ifdef CONFIG_HARDWARE_PM
r7 = [sp + PT_SEQSTAT];
r7 = r7 >>> 0xe;
r6 = 0x1F;
r7 = r7 & r6;
r5 = 0x12;
cc = r7 == r5;
if cc jump .Lcall_do_ovf; /* deal with performance counter overflow */
#endif

/* set the EXCAUSE to HWERR for trap_c */
r0 = [sp + PT_SEQSTAT];
R1.L = LO(VEC_HWERR);
Expand All @@ -200,18 +190,6 @@ ENTRY(_evt_ivhw)
.Lcommon_restore_all_sys:
RESTORE_ALL_SYS
rti;

#ifdef CONFIG_HARDWARE_PM
.Lcall_do_ovf:

R0 = SP;
SP += -12;
call _pm_overflow;
SP += 12;

jump .Lcommon_restore_all_sys;
#endif

ENDPROC(_evt_ivhw)

/* Interrupt routine for evt2 (NMI).
Expand Down
12 changes: 0 additions & 12 deletions arch/blackfin/mach-common/irqpanic.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@
#include <asm/traps.h>
#include <asm/blackfin.h>

#include "../oprofile/op_blackfin.h"

#ifdef CONFIG_DEBUG_ICACHE_CHECK
#define L1_ICACHE_START 0xffa10000
#define L1_ICACHE_END 0xffa13fff
Expand Down Expand Up @@ -134,13 +132,3 @@ asmlinkage void irq_panic(int reason, struct pt_regs *regs)
#endif

}

#ifdef CONFIG_HARDWARE_PM
/*
* call the handler of Performance overflow
*/
asmlinkage void pm_overflow(struct pt_regs *regs)
{
pm_overflow_handler(regs);
}
#endif
1 change: 0 additions & 1 deletion arch/blackfin/oprofile/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,3 @@ DRIVER_OBJS := $(addprefix ../../../drivers/oprofile/, \
timer_int.o )

oprofile-y := $(DRIVER_OBJS) common.o
oprofile-$(CONFIG_HARDWARE_PM) += op_model_bf533.o
119 changes: 0 additions & 119 deletions arch/blackfin/oprofile/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,129 +30,10 @@

#include <linux/oprofile.h>
#include <linux/init.h>
#include <linux/smp.h>
#include <linux/errno.h>
#include <linux/mutex.h>
#include <linux/ptrace.h>
#include <linux/irq.h>
#include <linux/io.h>

#include <asm/system.h>
#include <asm/blackfin.h>

#include "op_blackfin.h"

#define BFIN_533_ID 0xE5040003
#define BFIN_537_ID 0xE5040002

static int pfmon_enabled;
static struct mutex pfmon_lock;

struct op_bfin533_model *model;

struct op_counter_config ctr[OP_MAX_COUNTER];

static int op_bfin_setup(void)
{
int ret;

/* Pre-compute the values to stuff in the hardware registers. */
spin_lock(&oprofilefs_lock);
ret = model->reg_setup(ctr);
spin_unlock(&oprofilefs_lock);

return ret;
}

static void op_bfin_shutdown(void)
{
#if 0
/* what is the difference between shutdown and stop? */
#endif
}

static int op_bfin_start(void)
{
int ret = -EBUSY;

printk(KERN_INFO "KSDBG:in %s\n", __func__);
mutex_lock(&pfmon_lock);
if (!pfmon_enabled) {
ret = model->start(ctr);
pfmon_enabled = !ret;
}
mutex_unlock(&pfmon_lock);

return ret;
}

static void op_bfin_stop(void)
{
mutex_lock(&pfmon_lock);
if (pfmon_enabled) {
model->stop();
pfmon_enabled = 0;
}
mutex_unlock(&pfmon_lock);
}

static int op_bfin_create_files(struct super_block *sb, struct dentry *root)
{
int i;

for (i = 0; i < model->num_counters; ++i) {
struct dentry *dir;
char buf[3];
printk(KERN_INFO "Oprofile: creating files... \n");

snprintf(buf, sizeof buf, "%d", i);
dir = oprofilefs_mkdir(sb, root, buf);

oprofilefs_create_ulong(sb, dir, "enabled", &ctr[i].enabled);
oprofilefs_create_ulong(sb, dir, "event", &ctr[i].event);
oprofilefs_create_ulong(sb, dir, "count", &ctr[i].count);
/*
* We dont support per counter user/kernel selection, but
* we leave the entries because userspace expects them
*/
oprofilefs_create_ulong(sb, dir, "kernel", &ctr[i].kernel);
oprofilefs_create_ulong(sb, dir, "user", &ctr[i].user);
oprofilefs_create_ulong(sb, dir, "unit_mask",
&ctr[i].unit_mask);
}

return 0;
}
int __init oprofile_arch_init(struct oprofile_operations *ops)
{
#ifdef CONFIG_HARDWARE_PM
mutex_init(&pfmon_lock);


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;
default:
return -ENODEV;
}

ops->cpu_type = model->name;
ops->create_files = op_bfin_create_files;
ops->setup = op_bfin_setup;
ops->shutdown = op_bfin_shutdown;
ops->start = op_bfin_start;
ops->stop = op_bfin_stop;

printk(KERN_INFO "oprofile: using %s performance monitoring.\n",
ops->cpu_type);

return 0;
#else
return -1;
#endif
}

void oprofile_arch_exit(void)
Expand Down
98 changes: 0 additions & 98 deletions arch/blackfin/oprofile/op_blackfin.h

This file was deleted.

Loading

0 comments on commit 172e65e

Please sign in to comment.