aboutsummaryrefslogtreecommitdiffstats
path: root/arch/frv
diff options
context:
space:
mode:
authorGrant Likely <grant.likely@secretlab.ca>2010-05-22 02:36:56 -0400
committerGrant Likely <grant.likely@secretlab.ca>2010-05-22 02:36:56 -0400
commitcf9b59e9d3e008591d1f54830f570982bb307a0d (patch)
tree113478ce8fd8c832ba726ffdf59b82cb46356476 /arch/frv
parent44504b2bebf8b5823c59484e73096a7d6574471d (diff)
parentf4b87dee923342505e1ddba8d34ce9de33e75050 (diff)
Merge remote branch 'origin' into secretlab/next-devicetree
Merging in current state of Linus' tree to deal with merge conflicts and build failures in vio.c after merge. Conflicts: drivers/i2c/busses/i2c-cpm.c drivers/i2c/busses/i2c-mpc.c drivers/net/gianfar.c Also fixed up one line in arch/powerpc/kernel/vio.c to use the correct node pointer. Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Diffstat (limited to 'arch/frv')
-rw-r--r--arch/frv/include/asm/atomic.h2
-rw-r--r--arch/frv/include/asm/thread_info.h2
-rw-r--r--arch/frv/kernel/time.c34
3 files changed, 9 insertions, 29 deletions
diff --git a/arch/frv/include/asm/atomic.h b/arch/frv/include/asm/atomic.h
index 00a57af79af..fae32c7fdcb 100644
--- a/arch/frv/include/asm/atomic.h
+++ b/arch/frv/include/asm/atomic.h
@@ -36,7 +36,7 @@
36#define smp_mb__after_atomic_inc() barrier() 36#define smp_mb__after_atomic_inc() barrier()
37 37
38#define ATOMIC_INIT(i) { (i) } 38#define ATOMIC_INIT(i) { (i) }
39#define atomic_read(v) ((v)->counter) 39#define atomic_read(v) (*(volatile int *)&(v)->counter)
40#define atomic_set(v, i) (((v)->counter) = (i)) 40#define atomic_set(v, i) (((v)->counter) = (i))
41 41
42#ifndef CONFIG_FRV_OUTOFLINE_ATOMIC_OPS 42#ifndef CONFIG_FRV_OUTOFLINE_ATOMIC_OPS
diff --git a/arch/frv/include/asm/thread_info.h b/arch/frv/include/asm/thread_info.h
index e608e056bb5..11f33ead29b 100644
--- a/arch/frv/include/asm/thread_info.h
+++ b/arch/frv/include/asm/thread_info.h
@@ -113,7 +113,7 @@ register struct thread_info *__current_thread_info asm("gr15");
113#define TIF_SINGLESTEP 4 /* restore singlestep on return to user mode */ 113#define TIF_SINGLESTEP 4 /* restore singlestep on return to user mode */
114#define TIF_RESTORE_SIGMASK 5 /* restore signal mask in do_signal() */ 114#define TIF_RESTORE_SIGMASK 5 /* restore signal mask in do_signal() */
115#define TIF_POLLING_NRFLAG 16 /* true if poll_idle() is polling TIF_NEED_RESCHED */ 115#define TIF_POLLING_NRFLAG 16 /* true if poll_idle() is polling TIF_NEED_RESCHED */
116#define TIF_MEMDIE 17 /* OOM killer killed process */ 116#define TIF_MEMDIE 17 /* is terminating due to OOM killer */
117#define TIF_FREEZE 18 /* freezing for suspend */ 117#define TIF_FREEZE 18 /* freezing for suspend */
118 118
119#define _TIF_SYSCALL_TRACE (1 << TIF_SYSCALL_TRACE) 119#define _TIF_SYSCALL_TRACE (1 << TIF_SYSCALL_TRACE)
diff --git a/arch/frv/kernel/time.c b/arch/frv/kernel/time.c
index fb0ce757722..0ddbbae83cb 100644
--- a/arch/frv/kernel/time.c
+++ b/arch/frv/kernel/time.c
@@ -48,20 +48,12 @@ static struct irqaction timer_irq = {
48 .name = "timer", 48 .name = "timer",
49}; 49};
50 50
51static inline int set_rtc_mmss(unsigned long nowtime)
52{
53 return -1;
54}
55
56/* 51/*
57 * timer_interrupt() needs to keep up the real-time clock, 52 * timer_interrupt() needs to keep up the real-time clock,
58 * as well as call the "do_timer()" routine every clocktick 53 * as well as call the "do_timer()" routine every clocktick
59 */ 54 */
60static irqreturn_t timer_interrupt(int irq, void *dummy) 55static irqreturn_t timer_interrupt(int irq, void *dummy)
61{ 56{
62 /* last time the cmos clock got updated */
63 static long last_rtc_update = 0;
64
65 profile_tick(CPU_PROFILING); 57 profile_tick(CPU_PROFILING);
66 /* 58 /*
67 * Here we are in the timer irq handler. We just have irqs locally 59 * Here we are in the timer irq handler. We just have irqs locally
@@ -74,22 +66,6 @@ static irqreturn_t timer_interrupt(int irq, void *dummy)
74 66
75 do_timer(1); 67 do_timer(1);
76 68
77 /*
78 * If we have an externally synchronized Linux clock, then update
79 * CMOS clock accordingly every ~11 minutes. Set_rtc_mmss() has to be
80 * called as close as possible to 500 ms before the new second starts.
81 */
82 if (ntp_synced() &&
83 xtime.tv_sec > last_rtc_update + 660 &&
84 (xtime.tv_nsec / 1000) >= 500000 - ((unsigned) TICK_SIZE) / 2 &&
85 (xtime.tv_nsec / 1000) <= 500000 + ((unsigned) TICK_SIZE) / 2
86 ) {
87 if (set_rtc_mmss(xtime.tv_sec) == 0)
88 last_rtc_update = xtime.tv_sec;
89 else
90 last_rtc_update = xtime.tv_sec - 600; /* do it again in 60 s */
91 }
92
93#ifdef CONFIG_HEARTBEAT 69#ifdef CONFIG_HEARTBEAT
94 static unsigned short n; 70 static unsigned short n;
95 n++; 71 n++;
@@ -119,7 +95,8 @@ void time_divisor_init(void)
119 __set_TCSR_DATA(0, base >> 8); 95 __set_TCSR_DATA(0, base >> 8);
120} 96}
121 97
122void time_init(void) 98
99void read_persistent_clock(struct timespec *ts)
123{ 100{
124 unsigned int year, mon, day, hour, min, sec; 101 unsigned int year, mon, day, hour, min, sec;
125 102
@@ -135,9 +112,12 @@ void time_init(void)
135 112
136 if ((year += 1900) < 1970) 113 if ((year += 1900) < 1970)
137 year += 100; 114 year += 100;
138 xtime.tv_sec = mktime(year, mon, day, hour, min, sec); 115 ts->tv_sec = mktime(year, mon, day, hour, min, sec);
139 xtime.tv_nsec = 0; 116 ts->tv_nsec = 0;
117}
140 118
119void time_init(void)
120{
141 /* install scheduling interrupt handler */ 121 /* install scheduling interrupt handler */
142 setup_irq(IRQ_CPU_TIMER0, &timer_irq); 122 setup_irq(IRQ_CPU_TIMER0, &timer_irq);
143 123