aboutsummaryrefslogtreecommitdiffstats
path: root/arch/blackfin
diff options
context:
space:
mode:
Diffstat (limited to 'arch/blackfin')
-rw-r--r--arch/blackfin/kernel/nmi.c30
-rw-r--r--arch/blackfin/kernel/time-ts.c35
-rw-r--r--arch/blackfin/mach-common/dpmc.c3
-rw-r--r--arch/blackfin/mach-common/smp.c3
4 files changed, 14 insertions, 57 deletions
diff --git a/arch/blackfin/kernel/nmi.c b/arch/blackfin/kernel/nmi.c
index 0b5f72f17fd0..401eb1d8e3b4 100644
--- a/arch/blackfin/kernel/nmi.c
+++ b/arch/blackfin/kernel/nmi.c
@@ -12,7 +12,7 @@
12 12
13#include <linux/bitops.h> 13#include <linux/bitops.h>
14#include <linux/hardirq.h> 14#include <linux/hardirq.h>
15#include <linux/sysdev.h> 15#include <linux/syscore_ops.h>
16#include <linux/pm.h> 16#include <linux/pm.h>
17#include <linux/nmi.h> 17#include <linux/nmi.h>
18#include <linux/smp.h> 18#include <linux/smp.h>
@@ -196,43 +196,31 @@ void touch_nmi_watchdog(void)
196 196
197/* Suspend/resume support */ 197/* Suspend/resume support */
198#ifdef CONFIG_PM 198#ifdef CONFIG_PM
199static int nmi_wdt_suspend(struct sys_device *dev, pm_message_t state) 199static int nmi_wdt_suspend(void)
200{ 200{
201 nmi_wdt_stop(); 201 nmi_wdt_stop();
202 return 0; 202 return 0;
203} 203}
204 204
205static int nmi_wdt_resume(struct sys_device *dev) 205static void nmi_wdt_resume(void)
206{ 206{
207 if (nmi_active) 207 if (nmi_active)
208 nmi_wdt_start(); 208 nmi_wdt_start();
209 return 0;
210} 209}
211 210
212static struct sysdev_class nmi_sysclass = { 211static struct syscore_ops nmi_syscore_ops = {
213 .name = DRV_NAME,
214 .resume = nmi_wdt_resume, 212 .resume = nmi_wdt_resume,
215 .suspend = nmi_wdt_suspend, 213 .suspend = nmi_wdt_suspend,
216}; 214};
217 215
218static struct sys_device device_nmi_wdt = { 216static int __init init_nmi_wdt_syscore(void)
219 .id = 0,
220 .cls = &nmi_sysclass,
221};
222
223static int __init init_nmi_wdt_sysfs(void)
224{ 217{
225 int error; 218 if (nmi_active)
226 219 register_syscore_ops(&nmi_syscore_ops);
227 if (!nmi_active)
228 return 0;
229 220
230 error = sysdev_class_register(&nmi_sysclass); 221 return 0;
231 if (!error)
232 error = sysdev_register(&device_nmi_wdt);
233 return error;
234} 222}
235late_initcall(init_nmi_wdt_sysfs); 223late_initcall(init_nmi_wdt_syscore);
236 224
237#endif /* CONFIG_PM */ 225#endif /* CONFIG_PM */
238 226
diff --git a/arch/blackfin/kernel/time-ts.c b/arch/blackfin/kernel/time-ts.c
index cdb4beb6bc8f..9e9b60d969dc 100644
--- a/arch/blackfin/kernel/time-ts.c
+++ b/arch/blackfin/kernel/time-ts.c
@@ -23,29 +23,6 @@
23#include <asm/gptimers.h> 23#include <asm/gptimers.h>
24#include <asm/nmi.h> 24#include <asm/nmi.h>
25 25
26/* Accelerators for sched_clock()
27 * convert from cycles(64bits) => nanoseconds (64bits)
28 * basic equation:
29 * ns = cycles / (freq / ns_per_sec)
30 * ns = cycles * (ns_per_sec / freq)
31 * ns = cycles * (10^9 / (cpu_khz * 10^3))
32 * ns = cycles * (10^6 / cpu_khz)
33 *
34 * Then we use scaling math (suggested by george@mvista.com) to get:
35 * ns = cycles * (10^6 * SC / cpu_khz) / SC
36 * ns = cycles * cyc2ns_scale / SC
37 *
38 * And since SC is a constant power of two, we can convert the div
39 * into a shift.
40 *
41 * We can use khz divisor instead of mhz to keep a better precision, since
42 * cyc2ns_scale is limited to 10^6 * 2^10, which fits in 32 bits.
43 * (mathieu.desnoyers@polymtl.ca)
44 *
45 * -johnstul@us.ibm.com "math is hard, lets go shopping!"
46 */
47
48#define CYC2NS_SCALE_FACTOR 10 /* 2^10, carefully chosen */
49 26
50#if defined(CONFIG_CYCLES_CLOCKSOURCE) 27#if defined(CONFIG_CYCLES_CLOCKSOURCE)
51 28
@@ -63,7 +40,6 @@ static struct clocksource bfin_cs_cycles = {
63 .rating = 400, 40 .rating = 400,
64 .read = bfin_read_cycles, 41 .read = bfin_read_cycles,
65 .mask = CLOCKSOURCE_MASK(64), 42 .mask = CLOCKSOURCE_MASK(64),
66 .shift = CYC2NS_SCALE_FACTOR,
67 .flags = CLOCK_SOURCE_IS_CONTINUOUS, 43 .flags = CLOCK_SOURCE_IS_CONTINUOUS,
68}; 44};
69 45
@@ -75,10 +51,7 @@ static inline unsigned long long bfin_cs_cycles_sched_clock(void)
75 51
76static int __init bfin_cs_cycles_init(void) 52static int __init bfin_cs_cycles_init(void)
77{ 53{
78 bfin_cs_cycles.mult = \ 54 if (clocksource_register_hz(&bfin_cs_cycles, get_cclk()))
79 clocksource_hz2mult(get_cclk(), bfin_cs_cycles.shift);
80
81 if (clocksource_register(&bfin_cs_cycles))
82 panic("failed to register clocksource"); 55 panic("failed to register clocksource");
83 56
84 return 0; 57 return 0;
@@ -111,7 +84,6 @@ static struct clocksource bfin_cs_gptimer0 = {
111 .rating = 350, 84 .rating = 350,
112 .read = bfin_read_gptimer0, 85 .read = bfin_read_gptimer0,
113 .mask = CLOCKSOURCE_MASK(32), 86 .mask = CLOCKSOURCE_MASK(32),
114 .shift = CYC2NS_SCALE_FACTOR,
115 .flags = CLOCK_SOURCE_IS_CONTINUOUS, 87 .flags = CLOCK_SOURCE_IS_CONTINUOUS,
116}; 88};
117 89
@@ -125,10 +97,7 @@ static int __init bfin_cs_gptimer0_init(void)
125{ 97{
126 setup_gptimer0(); 98 setup_gptimer0();
127 99
128 bfin_cs_gptimer0.mult = \ 100 if (clocksource_register_hz(&bfin_cs_gptimer0, get_sclk()))
129 clocksource_hz2mult(get_sclk(), bfin_cs_gptimer0.shift);
130
131 if (clocksource_register(&bfin_cs_gptimer0))
132 panic("failed to register clocksource"); 101 panic("failed to register clocksource");
133 102
134 return 0; 103 return 0;
diff --git a/arch/blackfin/mach-common/dpmc.c b/arch/blackfin/mach-common/dpmc.c
index 382099fd5561..5e4112e518a9 100644
--- a/arch/blackfin/mach-common/dpmc.c
+++ b/arch/blackfin/mach-common/dpmc.c
@@ -19,9 +19,6 @@
19 19
20#define DRIVER_NAME "bfin dpmc" 20#define DRIVER_NAME "bfin dpmc"
21 21
22#define dprintk(msg...) \
23 cpufreq_debug_printk(CPUFREQ_DEBUG_DRIVER, DRIVER_NAME, msg)
24
25struct bfin_dpmc_platform_data *pdata; 22struct bfin_dpmc_platform_data *pdata;
26 23
27/** 24/**
diff --git a/arch/blackfin/mach-common/smp.c b/arch/blackfin/mach-common/smp.c
index 8bce5ed031e4..1fbd94c44457 100644
--- a/arch/blackfin/mach-common/smp.c
+++ b/arch/blackfin/mach-common/smp.c
@@ -177,6 +177,9 @@ static irqreturn_t ipi_handler_int1(int irq, void *dev_instance)
177 while (msg_queue->count) { 177 while (msg_queue->count) {
178 msg = &msg_queue->ipi_message[msg_queue->head]; 178 msg = &msg_queue->ipi_message[msg_queue->head];
179 switch (msg->type) { 179 switch (msg->type) {
180 case BFIN_IPI_RESCHEDULE:
181 scheduler_ipi();
182 break;
180 case BFIN_IPI_CALL_FUNC: 183 case BFIN_IPI_CALL_FUNC:
181 spin_unlock_irqrestore(&msg_queue->lock, flags); 184 spin_unlock_irqrestore(&msg_queue->lock, flags);
182 ipi_call_function(cpu, msg); 185 ipi_call_function(cpu, msg);