diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2014-01-27 11:12:20 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-01-27 11:12:20 -0500 |
commit | 562e74fefc36eb57286455c68a60f2776659a7e1 (patch) | |
tree | 1eeaeb09bc06ca65aad5e0c8882caab2bdcf1e90 /arch/cris | |
parent | 77d143de75812596a58d126606f42d1214e09dde (diff) | |
parent | e269a869417cd4053b37da1b19186902d3cbf63b (diff) |
Merge tag 'cris-for-3.14' of git://jni.nu/cris
Pull cris changes from Jesper Nilsson:
"Mostly removal of deprecated or old code, but also a long promised
update of the CRIS syscalls"
* tag 'cris-for-3.14' of git://jni.nu/cris:
Drop code for CRISv10 CPU simulator
Cleanup whitespace, remove old author tag
CRIS: Add missing syscalls
cris: sync_serial: remove interruptible_sleep_on
cris: remove deprecated IRQF_DISABLED
Diffstat (limited to 'arch/cris')
28 files changed, 299 insertions, 333 deletions
diff --git a/arch/cris/Kconfig b/arch/cris/Kconfig index 9c957c81c688..ed0fcdf7e990 100644 --- a/arch/cris/Kconfig +++ b/arch/cris/Kconfig | |||
@@ -122,12 +122,6 @@ config ETRAX100LX_V2 | |||
122 | help | 122 | help |
123 | Support version 2 of the ETRAX 100LX. | 123 | Support version 2 of the ETRAX 100LX. |
124 | 124 | ||
125 | config SVINTO_SIM | ||
126 | bool "ETRAX-100LX-for-xsim-simulator" | ||
127 | select ARCH_USES_GETTIMEOFFSET | ||
128 | help | ||
129 | Support the xsim ETRAX Simulator. | ||
130 | |||
131 | config ETRAXFS | 125 | config ETRAXFS |
132 | bool "ETRAX-FS-V32" | 126 | bool "ETRAX-FS-V32" |
133 | help | 127 | help |
diff --git a/arch/cris/arch-v10/drivers/gpio.c b/arch/cris/arch-v10/drivers/gpio.c index 609d5510410e..f4374bae4fb4 100644 --- a/arch/cris/arch-v10/drivers/gpio.c +++ b/arch/cris/arch-v10/drivers/gpio.c | |||
@@ -838,13 +838,13 @@ static int __init gpio_init(void) | |||
838 | * in some tests. | 838 | * in some tests. |
839 | */ | 839 | */ |
840 | res = request_irq(TIMER0_IRQ_NBR, gpio_poll_timer_interrupt, | 840 | res = request_irq(TIMER0_IRQ_NBR, gpio_poll_timer_interrupt, |
841 | IRQF_SHARED | IRQF_DISABLED, "gpio poll", gpio_name); | 841 | IRQF_SHARED, "gpio poll", gpio_name); |
842 | if (res) { | 842 | if (res) { |
843 | printk(KERN_CRIT "err: timer0 irq for gpio\n"); | 843 | printk(KERN_CRIT "err: timer0 irq for gpio\n"); |
844 | return res; | 844 | return res; |
845 | } | 845 | } |
846 | res = request_irq(PA_IRQ_NBR, gpio_interrupt, | 846 | res = request_irq(PA_IRQ_NBR, gpio_interrupt, |
847 | IRQF_SHARED | IRQF_DISABLED, "gpio PA", gpio_name); | 847 | IRQF_SHARED, "gpio PA", gpio_name); |
848 | if (res) | 848 | if (res) |
849 | printk(KERN_CRIT "err: PA irq for gpio\n"); | 849 | printk(KERN_CRIT "err: PA irq for gpio\n"); |
850 | 850 | ||
diff --git a/arch/cris/arch-v10/drivers/sync_serial.c b/arch/cris/arch-v10/drivers/sync_serial.c index a1c498d18d31..29eb02ab3f25 100644 --- a/arch/cris/arch-v10/drivers/sync_serial.c +++ b/arch/cris/arch-v10/drivers/sync_serial.c | |||
@@ -22,6 +22,7 @@ | |||
22 | #include <linux/init.h> | 22 | #include <linux/init.h> |
23 | #include <linux/mutex.h> | 23 | #include <linux/mutex.h> |
24 | #include <linux/timer.h> | 24 | #include <linux/timer.h> |
25 | #include <linux/wait.h> | ||
25 | #include <asm/irq.h> | 26 | #include <asm/irq.h> |
26 | #include <asm/dma.h> | 27 | #include <asm/dma.h> |
27 | #include <asm/io.h> | 28 | #include <asm/io.h> |
@@ -580,7 +581,7 @@ static int sync_serial_open(struct inode *inode, struct file *file) | |||
580 | if (port == &ports[0]) { | 581 | if (port == &ports[0]) { |
581 | if (request_irq(8, | 582 | if (request_irq(8, |
582 | manual_interrupt, | 583 | manual_interrupt, |
583 | IRQF_SHARED | IRQF_DISABLED, | 584 | IRQF_SHARED, |
584 | "synchronous serial manual irq", | 585 | "synchronous serial manual irq", |
585 | &ports[0])) { | 586 | &ports[0])) { |
586 | printk(KERN_CRIT "Can't alloc " | 587 | printk(KERN_CRIT "Can't alloc " |
@@ -590,7 +591,7 @@ static int sync_serial_open(struct inode *inode, struct file *file) | |||
590 | } else if (port == &ports[1]) { | 591 | } else if (port == &ports[1]) { |
591 | if (request_irq(8, | 592 | if (request_irq(8, |
592 | manual_interrupt, | 593 | manual_interrupt, |
593 | IRQF_SHARED | IRQF_DISABLED, | 594 | IRQF_SHARED, |
594 | "synchronous serial manual irq", | 595 | "synchronous serial manual irq", |
595 | &ports[1])) { | 596 | &ports[1])) { |
596 | printk(KERN_CRIT "Can't alloc " | 597 | printk(KERN_CRIT "Can't alloc " |
@@ -1136,7 +1137,8 @@ static ssize_t sync_serial_read(struct file *file, char *buf, | |||
1136 | if (file->f_flags & O_NONBLOCK) | 1137 | if (file->f_flags & O_NONBLOCK) |
1137 | return -EAGAIN; | 1138 | return -EAGAIN; |
1138 | 1139 | ||
1139 | interruptible_sleep_on(&port->in_wait_q); | 1140 | wait_event_interruptible(port->in_wait_q, |
1141 | !(start == end && !port->full)); | ||
1140 | if (signal_pending(current)) | 1142 | if (signal_pending(current)) |
1141 | return -EINTR; | 1143 | return -EINTR; |
1142 | 1144 | ||
diff --git a/arch/cris/arch-v10/kernel/Makefile b/arch/cris/arch-v10/kernel/Makefile index dcfec41d3533..4841e822cdd1 100644 --- a/arch/cris/arch-v10/kernel/Makefile +++ b/arch/cris/arch-v10/kernel/Makefile | |||
@@ -1,4 +1,3 @@ | |||
1 | # $Id: Makefile,v 1.6 2004/12/13 12:21:51 starvik Exp $ | ||
2 | # | 1 | # |
3 | # Makefile for the linux kernel. | 2 | # Makefile for the linux kernel. |
4 | # | 3 | # |
diff --git a/arch/cris/arch-v10/kernel/debugport.c b/arch/cris/arch-v10/kernel/debugport.c index f932c85fbde4..7d307cce8bd8 100644 --- a/arch/cris/arch-v10/kernel/debugport.c +++ b/arch/cris/arch-v10/kernel/debugport.c | |||
@@ -19,7 +19,6 @@ | |||
19 | #include <linux/delay.h> | 19 | #include <linux/delay.h> |
20 | #include <linux/tty.h> | 20 | #include <linux/tty.h> |
21 | #include <arch/svinto.h> | 21 | #include <arch/svinto.h> |
22 | #include <asm/io.h> /* Get SIMCOUT. */ | ||
23 | 22 | ||
24 | extern void reset_watchdog(void); | 23 | extern void reset_watchdog(void); |
25 | 24 | ||
@@ -318,12 +317,6 @@ console_write(struct console *co, const char *buf, unsigned int len) | |||
318 | if (!port) | 317 | if (!port) |
319 | return; | 318 | return; |
320 | 319 | ||
321 | #ifdef CONFIG_SVINTO_SIM | ||
322 | /* no use to simulate the serial debug output */ | ||
323 | SIMCOUT(buf, len); | ||
324 | return; | ||
325 | #endif | ||
326 | |||
327 | console_write_direct(co, buf, len); | 320 | console_write_direct(co, buf, len); |
328 | } | 321 | } |
329 | 322 | ||
diff --git a/arch/cris/arch-v10/kernel/entry.S b/arch/cris/arch-v10/kernel/entry.S index 897bba67bf7a..81570fcd0412 100644 --- a/arch/cris/arch-v10/kernel/entry.S +++ b/arch/cris/arch-v10/kernel/entry.S | |||
@@ -13,8 +13,8 @@ | |||
13 | * after a timer-interrupt and after each system call. | 13 | * after a timer-interrupt and after each system call. |
14 | * | 14 | * |
15 | * Stack layout in 'ret_from_system_call': | 15 | * Stack layout in 'ret_from_system_call': |
16 | * ptrace needs to have all regs on the stack. | 16 | * ptrace needs to have all regs on the stack. |
17 | * if the order here is changed, it needs to be | 17 | * if the order here is changed, it needs to be |
18 | * updated in fork.c:copy_process, signal.c:do_signal, | 18 | * updated in fork.c:copy_process, signal.c:do_signal, |
19 | * ptrace.c and ptrace.h | 19 | * ptrace.c and ptrace.h |
20 | * | 20 | * |
@@ -31,7 +31,7 @@ | |||
31 | #include <asm/pgtable.h> | 31 | #include <asm/pgtable.h> |
32 | 32 | ||
33 | ;; functions exported from this file | 33 | ;; functions exported from this file |
34 | 34 | ||
35 | .globl system_call | 35 | .globl system_call |
36 | .globl ret_from_intr | 36 | .globl ret_from_intr |
37 | .globl ret_from_fork | 37 | .globl ret_from_fork |
@@ -46,10 +46,10 @@ | |||
46 | .globl do_sigtrap | 46 | .globl do_sigtrap |
47 | .globl gdb_handle_breakpoint | 47 | .globl gdb_handle_breakpoint |
48 | .globl sys_call_table | 48 | .globl sys_call_table |
49 | 49 | ||
50 | ;; below are various parts of system_call which are not in the fast-path | 50 | ;; below are various parts of system_call which are not in the fast-path |
51 | 51 | ||
52 | #ifdef CONFIG_PREEMPT | 52 | #ifdef CONFIG_PREEMPT |
53 | ; Check if preemptive kernel scheduling should be done | 53 | ; Check if preemptive kernel scheduling should be done |
54 | _resume_kernel: | 54 | _resume_kernel: |
55 | di | 55 | di |
@@ -74,7 +74,7 @@ _need_resched: | |||
74 | nop | 74 | nop |
75 | #else | 75 | #else |
76 | #define _resume_kernel _Rexit | 76 | #define _resume_kernel _Rexit |
77 | #endif | 77 | #endif |
78 | 78 | ||
79 | ; Called at exit from fork. schedule_tail must be called to drop | 79 | ; Called at exit from fork. schedule_tail must be called to drop |
80 | ; spinlock if CONFIG_PREEMPT | 80 | ; spinlock if CONFIG_PREEMPT |
@@ -91,16 +91,16 @@ ret_from_kernel_thread: | |||
91 | ba ret_from_sys_call | 91 | ba ret_from_sys_call |
92 | 92 | ||
93 | ret_from_intr: | 93 | ret_from_intr: |
94 | ;; check for resched if preemptive kernel or if we're going back to user-mode | 94 | ;; check for resched if preemptive kernel or if we're going back to user-mode |
95 | ;; this test matches the user_regs(regs) macro | 95 | ;; this test matches the user_regs(regs) macro |
96 | ;; we cannot simply test $dccr, because that does not necessarily | 96 | ;; we cannot simply test $dccr, because that does not necessarily |
97 | ;; reflect what mode we'll return into. | 97 | ;; reflect what mode we'll return into. |
98 | 98 | ||
99 | move.d [$sp + PT_dccr], $r0; regs->dccr | 99 | move.d [$sp + PT_dccr], $r0; regs->dccr |
100 | btstq 8, $r0 ; U-flag | 100 | btstq 8, $r0 ; U-flag |
101 | bpl _resume_kernel | 101 | bpl _resume_kernel |
102 | ; Note that di below is in delay slot | 102 | ; Note that di below is in delay slot |
103 | 103 | ||
104 | _resume_userspace: | 104 | _resume_userspace: |
105 | di ; so need_resched and sigpending don't change | 105 | di ; so need_resched and sigpending don't change |
106 | 106 | ||
@@ -113,7 +113,7 @@ _resume_userspace: | |||
113 | nop | 113 | nop |
114 | ba _Rexit | 114 | ba _Rexit |
115 | nop | 115 | nop |
116 | 116 | ||
117 | ;; The system_call is called by a BREAK instruction, which works like | 117 | ;; The system_call is called by a BREAK instruction, which works like |
118 | ;; an interrupt call but it stores the return PC in BRP instead of IRP. | 118 | ;; an interrupt call but it stores the return PC in BRP instead of IRP. |
119 | ;; Since we dont really want to have two epilogues (one for system calls | 119 | ;; Since we dont really want to have two epilogues (one for system calls |
@@ -123,7 +123,7 @@ _resume_userspace: | |||
123 | ;; | 123 | ;; |
124 | ;; Since we can't have system calls inside interrupts, it should not matter | 124 | ;; Since we can't have system calls inside interrupts, it should not matter |
125 | ;; that we don't stack IRP. | 125 | ;; that we don't stack IRP. |
126 | ;; | 126 | ;; |
127 | ;; In r9 we have the wanted syscall number. Arguments come in r10,r11,r12,r13,mof,srp | 127 | ;; In r9 we have the wanted syscall number. Arguments come in r10,r11,r12,r13,mof,srp |
128 | ;; | 128 | ;; |
129 | ;; This function looks on the _surface_ like spaghetti programming, but it's | 129 | ;; This function looks on the _surface_ like spaghetti programming, but it's |
@@ -140,7 +140,7 @@ system_call: | |||
140 | movem $r13, [$sp] ; push r0-r13 | 140 | movem $r13, [$sp] ; push r0-r13 |
141 | push $r10 ; push orig_r10 | 141 | push $r10 ; push orig_r10 |
142 | clear.d [$sp=$sp-4] ; frametype == 0, normal stackframe | 142 | clear.d [$sp=$sp-4] ; frametype == 0, normal stackframe |
143 | 143 | ||
144 | movs.w -ENOSYS, $r0 | 144 | movs.w -ENOSYS, $r0 |
145 | move.d $r0, [$sp+PT_r10] ; put the default return value in r10 in the frame | 145 | move.d $r0, [$sp+PT_r10] ; put the default return value in r10 in the frame |
146 | 146 | ||
@@ -148,17 +148,17 @@ system_call: | |||
148 | 148 | ||
149 | movs.w -8192, $r0 ; THREAD_SIZE == 8192 | 149 | movs.w -8192, $r0 ; THREAD_SIZE == 8192 |
150 | and.d $sp, $r0 | 150 | and.d $sp, $r0 |
151 | 151 | ||
152 | move.d [$r0+TI_flags], $r0 | 152 | move.d [$r0+TI_flags], $r0 |
153 | btstq TIF_SYSCALL_TRACE, $r0 | 153 | btstq TIF_SYSCALL_TRACE, $r0 |
154 | bmi _syscall_trace_entry | 154 | bmi _syscall_trace_entry |
155 | nop | 155 | nop |
156 | 156 | ||
157 | _syscall_traced: | 157 | _syscall_traced: |
158 | 158 | ||
159 | ;; check for sanity in the requested syscall number | 159 | ;; check for sanity in the requested syscall number |
160 | 160 | ||
161 | cmpu.w NR_syscalls, $r9 | 161 | cmpu.w NR_syscalls, $r9 |
162 | bcc ret_from_sys_call | 162 | bcc ret_from_sys_call |
163 | lslq 2, $r9 ; multiply by 4, in the delay slot | 163 | lslq 2, $r9 ; multiply by 4, in the delay slot |
164 | 164 | ||
@@ -166,28 +166,28 @@ _syscall_traced: | |||
166 | ;; of the register structure itself. some syscalls need this. | 166 | ;; of the register structure itself. some syscalls need this. |
167 | 167 | ||
168 | push $sp | 168 | push $sp |
169 | 169 | ||
170 | ;; the parameter carrying registers r10, r11, r12 and 13 are intact. | 170 | ;; the parameter carrying registers r10, r11, r12 and 13 are intact. |
171 | ;; the fifth and sixth parameters (if any) was in mof and srp | 171 | ;; the fifth and sixth parameters (if any) was in mof and srp |
172 | ;; respectively, and we need to put them on the stack. | 172 | ;; respectively, and we need to put them on the stack. |
173 | 173 | ||
174 | push $srp | 174 | push $srp |
175 | push $mof | 175 | push $mof |
176 | 176 | ||
177 | jsr [$r9+sys_call_table] ; actually do the system call | 177 | jsr [$r9+sys_call_table] ; actually do the system call |
178 | addq 3*4, $sp ; pop the mof, srp and regs parameters | 178 | addq 3*4, $sp ; pop the mof, srp and regs parameters |
179 | move.d $r10, [$sp+PT_r10] ; save the return value | 179 | move.d $r10, [$sp+PT_r10] ; save the return value |
180 | 180 | ||
181 | moveq 1, $r9 ; "parameter" to ret_from_sys_call to show it was a sys call | 181 | moveq 1, $r9 ; "parameter" to ret_from_sys_call to show it was a sys call |
182 | 182 | ||
183 | ;; fall through into ret_from_sys_call to return | 183 | ;; fall through into ret_from_sys_call to return |
184 | 184 | ||
185 | ret_from_sys_call: | 185 | ret_from_sys_call: |
186 | ;; r9 is a parameter - if >=1 we came from a syscall, if 0, from an irq | 186 | ;; r9 is a parameter - if >=1 we came from a syscall, if 0, from an irq |
187 | 187 | ||
188 | ;; get the current task-struct pointer (see top for defs) | 188 | ;; get the current task-struct pointer (see top for defs) |
189 | 189 | ||
190 | movs.w -8192, $r0 ; THREAD_SIZE == 8192 | 190 | movs.w -8192, $r0 ; THREAD_SIZE == 8192 |
191 | and.d $sp, $r0 | 191 | and.d $sp, $r0 |
192 | 192 | ||
193 | di ; make sure need_resched and sigpending don't change | 193 | di ; make sure need_resched and sigpending don't change |
@@ -202,7 +202,7 @@ _Rexit: | |||
202 | bne _RBFexit ; was not CRIS_FRAME_NORMAL, handle otherwise | 202 | bne _RBFexit ; was not CRIS_FRAME_NORMAL, handle otherwise |
203 | addq 4, $sp ; skip orig_r10, in delayslot | 203 | addq 4, $sp ; skip orig_r10, in delayslot |
204 | movem [$sp+], $r13 ; registers r0-r13 | 204 | movem [$sp+], $r13 ; registers r0-r13 |
205 | pop $mof ; multiply overflow register | 205 | pop $mof ; multiply overflow register |
206 | pop $dccr ; condition codes | 206 | pop $dccr ; condition codes |
207 | pop $srp ; subroutine return pointer | 207 | pop $srp ; subroutine return pointer |
208 | ;; now we have a 4-word SBFS frame which we do not want to restore | 208 | ;; now we have a 4-word SBFS frame which we do not want to restore |
@@ -216,14 +216,14 @@ _Rexit: | |||
216 | 216 | ||
217 | _RBFexit: | 217 | _RBFexit: |
218 | movem [$sp+], $r13 ; registers r0-r13, in delay slot | 218 | movem [$sp+], $r13 ; registers r0-r13, in delay slot |
219 | pop $mof ; multiply overflow register | 219 | pop $mof ; multiply overflow register |
220 | pop $dccr ; condition codes | 220 | pop $dccr ; condition codes |
221 | pop $srp ; subroutine return pointer | 221 | pop $srp ; subroutine return pointer |
222 | rbf [$sp+] ; return by popping the CPU status | 222 | rbf [$sp+] ; return by popping the CPU status |
223 | 223 | ||
224 | ;; We get here after doing a syscall if extra work might need to be done | 224 | ;; We get here after doing a syscall if extra work might need to be done |
225 | ;; perform syscall exit tracing if needed | 225 | ;; perform syscall exit tracing if needed |
226 | 226 | ||
227 | _syscall_exit_work: | 227 | _syscall_exit_work: |
228 | ;; $r0 contains current at this point and irq's are disabled | 228 | ;; $r0 contains current at this point and irq's are disabled |
229 | 229 | ||
@@ -231,22 +231,22 @@ _syscall_exit_work: | |||
231 | btstq TIF_SYSCALL_TRACE, $r1 | 231 | btstq TIF_SYSCALL_TRACE, $r1 |
232 | bpl _work_pending | 232 | bpl _work_pending |
233 | nop | 233 | nop |
234 | 234 | ||
235 | ei | 235 | ei |
236 | 236 | ||
237 | move.d $r9, $r1 ; preserve r9 | 237 | move.d $r9, $r1 ; preserve r9 |
238 | jsr do_syscall_trace | 238 | jsr do_syscall_trace |
239 | move.d $r1, $r9 | 239 | move.d $r1, $r9 |
240 | 240 | ||
241 | ba _resume_userspace | 241 | ba _resume_userspace |
242 | nop | 242 | nop |
243 | 243 | ||
244 | _work_pending: | 244 | _work_pending: |
245 | move.d [$r0+TI_flags], $r1 | 245 | move.d [$r0+TI_flags], $r1 |
246 | btstq TIF_NEED_RESCHED, $r1 | 246 | btstq TIF_NEED_RESCHED, $r1 |
247 | bpl _work_notifysig ; was neither trace nor sched, must be signal/notify | 247 | bpl _work_notifysig ; was neither trace nor sched, must be signal/notify |
248 | nop | 248 | nop |
249 | 249 | ||
250 | _work_resched: | 250 | _work_resched: |
251 | move.d $r9, $r1 ; preserve r9 | 251 | move.d $r9, $r1 ; preserve r9 |
252 | jsr schedule | 252 | jsr schedule |
@@ -268,17 +268,17 @@ _work_notifysig: | |||
268 | move.d $sp, $r11 ; the regs param | 268 | move.d $sp, $r11 ; the regs param |
269 | move.d $r1, $r12 ; the thread_info_flags parameter | 269 | move.d $r1, $r12 ; the thread_info_flags parameter |
270 | jsr do_notify_resume | 270 | jsr do_notify_resume |
271 | 271 | ||
272 | ba _Rexit | 272 | ba _Rexit |
273 | nop | 273 | nop |
274 | 274 | ||
275 | ;; We get here as a sidetrack when we've entered a syscall with the | 275 | ;; We get here as a sidetrack when we've entered a syscall with the |
276 | ;; trace-bit set. We need to call do_syscall_trace and then continue | 276 | ;; trace-bit set. We need to call do_syscall_trace and then continue |
277 | ;; with the call. | 277 | ;; with the call. |
278 | 278 | ||
279 | _syscall_trace_entry: | 279 | _syscall_trace_entry: |
280 | ;; PT_r10 in the frame contains -ENOSYS as required, at this point | 280 | ;; PT_r10 in the frame contains -ENOSYS as required, at this point |
281 | 281 | ||
282 | jsr do_syscall_trace | 282 | jsr do_syscall_trace |
283 | 283 | ||
284 | ;; now re-enter the syscall code to do the syscall itself | 284 | ;; now re-enter the syscall code to do the syscall itself |
@@ -292,10 +292,10 @@ _syscall_trace_entry: | |||
292 | move.d [$sp+PT_r13], $r13 | 292 | move.d [$sp+PT_r13], $r13 |
293 | move [$sp+PT_mof], $mof | 293 | move [$sp+PT_mof], $mof |
294 | move [$sp+PT_srp], $srp | 294 | move [$sp+PT_srp], $srp |
295 | 295 | ||
296 | ba _syscall_traced | 296 | ba _syscall_traced |
297 | nop | 297 | nop |
298 | 298 | ||
299 | ;; resume performs the actual task-switching, by switching stack pointers | 299 | ;; resume performs the actual task-switching, by switching stack pointers |
300 | ;; input arguments: r10 = prev, r11 = next, r12 = thread offset in task struct | 300 | ;; input arguments: r10 = prev, r11 = next, r12 = thread offset in task struct |
301 | ;; returns old current in r10 | 301 | ;; returns old current in r10 |
@@ -303,29 +303,29 @@ _syscall_trace_entry: | |||
303 | ;; TODO: see the i386 version. The switch_to which calls resume in our version | 303 | ;; TODO: see the i386 version. The switch_to which calls resume in our version |
304 | ;; could really be an inline asm of this. | 304 | ;; could really be an inline asm of this. |
305 | 305 | ||
306 | resume: | 306 | resume: |
307 | push $srp ; we keep the old/new PC on the stack | 307 | push $srp ; we keep the old/new PC on the stack |
308 | add.d $r12, $r10 ; r10 = current tasks tss | 308 | add.d $r12, $r10 ; r10 = current tasks tss |
309 | move $dccr, [$r10+THREAD_dccr]; save irq enable state | 309 | move $dccr, [$r10+THREAD_dccr]; save irq enable state |
310 | di | 310 | di |
311 | 311 | ||
312 | move $usp, [$r10+ THREAD_usp] ; save user-mode stackpointer | 312 | move $usp, [$r10+ THREAD_usp] ; save user-mode stackpointer |
313 | 313 | ||
314 | ;; See copy_thread for the reason why register R9 is saved. | 314 | ;; See copy_thread for the reason why register R9 is saved. |
315 | subq 10*4, $sp | 315 | subq 10*4, $sp |
316 | movem $r9, [$sp] ; save non-scratch registers and R9. | 316 | movem $r9, [$sp] ; save non-scratch registers and R9. |
317 | 317 | ||
318 | move.d $sp, [$r10+THREAD_ksp] ; save the kernel stack pointer for the old task | 318 | move.d $sp, [$r10+THREAD_ksp] ; save the kernel stack pointer for the old task |
319 | move.d $sp, $r10 ; return last running task in r10 | 319 | move.d $sp, $r10 ; return last running task in r10 |
320 | and.d -8192, $r10 ; get thread_info from stackpointer | 320 | and.d -8192, $r10 ; get thread_info from stackpointer |
321 | move.d [$r10+TI_task], $r10 ; get task | 321 | move.d [$r10+TI_task], $r10 ; get task |
322 | add.d $r12, $r11 ; find the new tasks tss | 322 | add.d $r12, $r11 ; find the new tasks tss |
323 | move.d [$r11+THREAD_ksp], $sp ; switch into the new stackframe by restoring kernel sp | 323 | move.d [$r11+THREAD_ksp], $sp ; switch into the new stackframe by restoring kernel sp |
324 | 324 | ||
325 | movem [$sp+], $r9 ; restore non-scratch registers and R9. | 325 | movem [$sp+], $r9 ; restore non-scratch registers and R9. |
326 | 326 | ||
327 | move [$r11+THREAD_usp], $usp ; restore user-mode stackpointer | 327 | move [$r11+THREAD_usp], $usp ; restore user-mode stackpointer |
328 | 328 | ||
329 | move [$r11+THREAD_dccr], $dccr ; restore irq enable status | 329 | move [$r11+THREAD_dccr], $dccr ; restore irq enable status |
330 | jump [$sp+] ; restore PC | 330 | jump [$sp+] ; restore PC |
331 | 331 | ||
@@ -401,7 +401,7 @@ mmu_bus_fault: | |||
401 | push $r10 ; frametype == 1, BUSFAULT frame type | 401 | push $r10 ; frametype == 1, BUSFAULT frame type |
402 | 402 | ||
403 | move.d $sp, $r10 ; pt_regs argument to handle_mmu_bus_fault | 403 | move.d $sp, $r10 ; pt_regs argument to handle_mmu_bus_fault |
404 | 404 | ||
405 | jsr handle_mmu_bus_fault ; in arch/cris/arch-v10/mm/fault.c | 405 | jsr handle_mmu_bus_fault ; in arch/cris/arch-v10/mm/fault.c |
406 | 406 | ||
407 | ;; now we need to return through the normal path, we cannot just | 407 | ;; now we need to return through the normal path, we cannot just |
@@ -410,10 +410,10 @@ mmu_bus_fault: | |||
410 | ;; whatever. | 410 | ;; whatever. |
411 | 411 | ||
412 | moveq 0, $r9 ; busfault is equivalent to an irq | 412 | moveq 0, $r9 ; busfault is equivalent to an irq |
413 | 413 | ||
414 | ba ret_from_intr | 414 | ba ret_from_intr |
415 | nop | 415 | nop |
416 | 416 | ||
417 | ;; special handlers for breakpoint and NMI | 417 | ;; special handlers for breakpoint and NMI |
418 | hwbreakpoint: | 418 | hwbreakpoint: |
419 | push $dccr | 419 | push $dccr |
@@ -429,7 +429,7 @@ hwbreakpoint: | |||
429 | pop $dccr | 429 | pop $dccr |
430 | retb | 430 | retb |
431 | nop | 431 | nop |
432 | 432 | ||
433 | IRQ1_interrupt: | 433 | IRQ1_interrupt: |
434 | ;; this prologue MUST match the one in irq.h and the struct in ptregs.h!!! | 434 | ;; this prologue MUST match the one in irq.h and the struct in ptregs.h!!! |
435 | move $brp,[$sp=$sp-16]; instruction pointer and room for a fake SBFS frame | 435 | move $brp,[$sp=$sp-16]; instruction pointer and room for a fake SBFS frame |
@@ -457,7 +457,7 @@ IRQ1_interrupt: | |||
457 | ba _Rexit ; Return the standard way | 457 | ba _Rexit ; Return the standard way |
458 | nop | 458 | nop |
459 | wdog: | 459 | wdog: |
460 | #if defined(CONFIG_ETRAX_WATCHDOG) && !defined(CONFIG_SVINTO_SIM) | 460 | #if defined(CONFIG_ETRAX_WATCHDOG) |
461 | ;; Check if we're waiting for reset to happen, as signalled by | 461 | ;; Check if we're waiting for reset to happen, as signalled by |
462 | ;; hard_reset_now setting cause_of_death to a magic value. If so, just | 462 | ;; hard_reset_now setting cause_of_death to a magic value. If so, just |
463 | ;; get stuck until reset happens. | 463 | ;; get stuck until reset happens. |
@@ -500,7 +500,7 @@ Watchdog_bite: | |||
500 | move.d $r10, [$r11] | 500 | move.d $r10, [$r11] |
501 | 501 | ||
502 | #endif | 502 | #endif |
503 | 503 | ||
504 | ;; Note that we don't do "setf m" here (or after two necessary NOPs), | 504 | ;; Note that we don't do "setf m" here (or after two necessary NOPs), |
505 | ;; since *not* doing that saves us from re-entrancy checks. We don't want | 505 | ;; since *not* doing that saves us from re-entrancy checks. We don't want |
506 | ;; to get here again due to possible subsequent NMIs; we want the watchdog | 506 | ;; to get here again due to possible subsequent NMIs; we want the watchdog |
@@ -523,16 +523,16 @@ _watchdogmsg: | |||
523 | .ascii "Oops: bitten by watchdog\n\0" | 523 | .ascii "Oops: bitten by watchdog\n\0" |
524 | .previous | 524 | .previous |
525 | 525 | ||
526 | #endif /* CONFIG_ETRAX_WATCHDOG and not CONFIG_SVINTO_SIM */ | 526 | #endif /* CONFIG_ETRAX_WATCHDOG */ |
527 | 527 | ||
528 | spurious_interrupt: | 528 | spurious_interrupt: |
529 | di | 529 | di |
530 | jump hard_reset_now | 530 | jump hard_reset_now |
531 | 531 | ||
532 | ;; this handles the case when multiple interrupts arrive at the same time | 532 | ;; this handles the case when multiple interrupts arrive at the same time |
533 | ;; we jump to the first set interrupt bit in a priority fashion | 533 | ;; we jump to the first set interrupt bit in a priority fashion |
534 | ;; the hardware will call the unserved interrupts after the handler finishes | 534 | ;; the hardware will call the unserved interrupts after the handler finishes |
535 | 535 | ||
536 | multiple_interrupt: | 536 | multiple_interrupt: |
537 | ;; this prologue MUST match the one in irq.h and the struct in ptregs.h!!! | 537 | ;; this prologue MUST match the one in irq.h and the struct in ptregs.h!!! |
538 | move $irp,[$sp=$sp-16]; instruction pointer and room for a fake SBFS frame | 538 | move $irp,[$sp=$sp-16]; instruction pointer and room for a fake SBFS frame |
@@ -551,7 +551,7 @@ multiple_interrupt: | |||
551 | jump ret_from_intr | 551 | jump ret_from_intr |
552 | 552 | ||
553 | do_sigtrap: | 553 | do_sigtrap: |
554 | ;; | 554 | ;; |
555 | ;; SIGTRAP the process that executed the break instruction. | 555 | ;; SIGTRAP the process that executed the break instruction. |
556 | ;; Make a frame that Rexit in entry.S expects. | 556 | ;; Make a frame that Rexit in entry.S expects. |
557 | ;; | 557 | ;; |
@@ -568,30 +568,30 @@ do_sigtrap: | |||
568 | movs.w -8192,$r9 ; THREAD_SIZE == 8192 | 568 | movs.w -8192,$r9 ; THREAD_SIZE == 8192 |
569 | and.d $sp, $r9 | 569 | and.d $sp, $r9 |
570 | move.d [$r9+TI_task], $r10 | 570 | move.d [$r9+TI_task], $r10 |
571 | move.d [$r10+TASK_pid], $r10 ; current->pid as arg1. | 571 | move.d [$r10+TASK_pid], $r10 ; current->pid as arg1. |
572 | moveq 5, $r11 ; SIGTRAP as arg2. | 572 | moveq 5, $r11 ; SIGTRAP as arg2. |
573 | jsr sys_kill | 573 | jsr sys_kill |
574 | jump ret_from_intr ; Use the return routine for interrupts. | 574 | jump ret_from_intr ; Use the return routine for interrupts. |
575 | 575 | ||
576 | gdb_handle_breakpoint: | 576 | gdb_handle_breakpoint: |
577 | push $dccr | 577 | push $dccr |
578 | push $r0 | 578 | push $r0 |
579 | #ifdef CONFIG_ETRAX_KGDB | 579 | #ifdef CONFIG_ETRAX_KGDB |
580 | move $dccr, $r0 ; U-flag not affected by previous insns. | 580 | move $dccr, $r0 ; U-flag not affected by previous insns. |
581 | btstq 8, $r0 ; Test the U-flag. | 581 | btstq 8, $r0 ; Test the U-flag. |
582 | bmi _ugdb_handle_breakpoint ; Go to user mode debugging. | 582 | bmi _ugdb_handle_breakpoint ; Go to user mode debugging. |
583 | nop ; Empty delay slot (cannot pop r0 here). | 583 | nop ; Empty delay slot (cannot pop r0 here). |
584 | pop $r0 ; Restore r0. | 584 | pop $r0 ; Restore r0. |
585 | ba kgdb_handle_breakpoint ; Go to kernel debugging. | 585 | ba kgdb_handle_breakpoint ; Go to kernel debugging. |
586 | pop $dccr ; Restore dccr in delay slot. | 586 | pop $dccr ; Restore dccr in delay slot. |
587 | #endif | 587 | #endif |
588 | 588 | ||
589 | _ugdb_handle_breakpoint: | 589 | _ugdb_handle_breakpoint: |
590 | move $brp, $r0 ; Use r0 temporarily for calculation. | 590 | move $brp, $r0 ; Use r0 temporarily for calculation. |
591 | subq 2, $r0 ; Set to address of previous instruction. | 591 | subq 2, $r0 ; Set to address of previous instruction. |
592 | move $r0, $brp | 592 | move $r0, $brp |
593 | pop $r0 ; Restore r0. | 593 | pop $r0 ; Restore r0. |
594 | ba do_sigtrap ; SIGTRAP the offending process. | 594 | ba do_sigtrap ; SIGTRAP the offending process. |
595 | pop $dccr ; Restore dccr in delay slot. | 595 | pop $dccr ; Restore dccr in delay slot. |
596 | 596 | ||
597 | .data | 597 | .data |
@@ -602,7 +602,7 @@ hw_bp_trig_ptr: | |||
602 | .dword hw_bp_trigs | 602 | .dword hw_bp_trigs |
603 | 603 | ||
604 | .section .rodata,"a" | 604 | .section .rodata,"a" |
605 | sys_call_table: | 605 | sys_call_table: |
606 | .long sys_restart_syscall /* 0 - old "setup()" system call, used for restarting */ | 606 | .long sys_restart_syscall /* 0 - old "setup()" system call, used for restarting */ |
607 | .long sys_exit | 607 | .long sys_exit |
608 | .long sys_fork | 608 | .long sys_fork |
@@ -713,7 +713,7 @@ sys_call_table: | |||
713 | .long sys_newlstat | 713 | .long sys_newlstat |
714 | .long sys_newfstat | 714 | .long sys_newfstat |
715 | .long sys_ni_syscall /* old sys_uname holder */ | 715 | .long sys_ni_syscall /* old sys_uname holder */ |
716 | .long sys_ni_syscall /* sys_iopl in i386 */ | 716 | .long sys_ni_syscall /* 110 */ /* sys_iopl in i386 */ |
717 | .long sys_vhangup | 717 | .long sys_vhangup |
718 | .long sys_ni_syscall /* old "idle" system call */ | 718 | .long sys_ni_syscall /* old "idle" system call */ |
719 | .long sys_ni_syscall /* vm86old in i386 */ | 719 | .long sys_ni_syscall /* vm86old in i386 */ |
@@ -730,7 +730,7 @@ sys_call_table: | |||
730 | .long sys_adjtimex | 730 | .long sys_adjtimex |
731 | .long sys_mprotect /* 125 */ | 731 | .long sys_mprotect /* 125 */ |
732 | .long sys_sigprocmask | 732 | .long sys_sigprocmask |
733 | .long sys_ni_syscall /* old "create_module" */ | 733 | .long sys_ni_syscall /* old "create_module" */ |
734 | .long sys_init_module | 734 | .long sys_init_module |
735 | .long sys_delete_module | 735 | .long sys_delete_module |
736 | .long sys_ni_syscall /* 130: old "get_kernel_syms" */ | 736 | .long sys_ni_syscall /* 130: old "get_kernel_syms" */ |
@@ -795,7 +795,7 @@ sys_call_table: | |||
795 | .long sys_ni_syscall /* streams2 */ | 795 | .long sys_ni_syscall /* streams2 */ |
796 | .long sys_vfork /* 190 */ | 796 | .long sys_vfork /* 190 */ |
797 | .long sys_getrlimit | 797 | .long sys_getrlimit |
798 | .long sys_mmap2 | 798 | .long sys_mmap2 /* mmap_pgoff */ |
799 | .long sys_truncate64 | 799 | .long sys_truncate64 |
800 | .long sys_ftruncate64 | 800 | .long sys_ftruncate64 |
801 | .long sys_stat64 /* 195 */ | 801 | .long sys_stat64 /* 195 */ |
@@ -861,21 +861,21 @@ sys_call_table: | |||
861 | .long sys_epoll_ctl /* 255 */ | 861 | .long sys_epoll_ctl /* 255 */ |
862 | .long sys_epoll_wait | 862 | .long sys_epoll_wait |
863 | .long sys_remap_file_pages | 863 | .long sys_remap_file_pages |
864 | .long sys_set_tid_address | 864 | .long sys_set_tid_address |
865 | .long sys_timer_create | 865 | .long sys_timer_create |
866 | .long sys_timer_settime /* 260 */ | 866 | .long sys_timer_settime /* 260 */ |
867 | .long sys_timer_gettime | 867 | .long sys_timer_gettime |
868 | .long sys_timer_getoverrun | 868 | .long sys_timer_getoverrun |
869 | .long sys_timer_delete | 869 | .long sys_timer_delete |
870 | .long sys_clock_settime | 870 | .long sys_clock_settime |
871 | .long sys_clock_gettime /* 265 */ | 871 | .long sys_clock_gettime /* 265 */ |
872 | .long sys_clock_getres | 872 | .long sys_clock_getres |
873 | .long sys_clock_nanosleep | 873 | .long sys_clock_nanosleep |
874 | .long sys_statfs64 | 874 | .long sys_statfs64 |
875 | .long sys_fstatfs64 | 875 | .long sys_fstatfs64 |
876 | .long sys_tgkill /* 270 */ | 876 | .long sys_tgkill /* 270 */ |
877 | .long sys_utimes | 877 | .long sys_utimes |
878 | .long sys_fadvise64_64 | 878 | .long sys_fadvise64_64 |
879 | .long sys_ni_syscall /* sys_vserver */ | 879 | .long sys_ni_syscall /* sys_vserver */ |
880 | .long sys_ni_syscall /* sys_mbind */ | 880 | .long sys_ni_syscall /* sys_mbind */ |
881 | .long sys_ni_syscall /* 275 sys_get_mempolicy */ | 881 | .long sys_ni_syscall /* 275 sys_get_mempolicy */ |
@@ -886,7 +886,7 @@ sys_call_table: | |||
886 | .long sys_mq_timedreceive /* 280 */ | 886 | .long sys_mq_timedreceive /* 280 */ |
887 | .long sys_mq_notify | 887 | .long sys_mq_notify |
888 | .long sys_mq_getsetattr | 888 | .long sys_mq_getsetattr |
889 | .long sys_ni_syscall /* reserved for kexec */ | 889 | .long sys_ni_syscall |
890 | .long sys_waitid | 890 | .long sys_waitid |
891 | .long sys_ni_syscall /* 285 */ /* available */ | 891 | .long sys_ni_syscall /* 285 */ /* available */ |
892 | .long sys_add_key | 892 | .long sys_add_key |
@@ -939,6 +939,22 @@ sys_call_table: | |||
939 | .long sys_preadv | 939 | .long sys_preadv |
940 | .long sys_pwritev | 940 | .long sys_pwritev |
941 | .long sys_setns /* 335 */ | 941 | .long sys_setns /* 335 */ |
942 | .long sys_name_to_handle_at | ||
943 | .long sys_open_by_handle_at | ||
944 | .long sys_rt_tgsigqueueinfo | ||
945 | .long sys_perf_event_open | ||
946 | .long sys_recvmmsg /* 340 */ | ||
947 | .long sys_accept4 | ||
948 | .long sys_fanotify_init | ||
949 | .long sys_fanotify_mark | ||
950 | .long sys_prlimit64 | ||
951 | .long sys_clock_adjtime /* 345 */ | ||
952 | .long sys_syncfs | ||
953 | .long sys_sendmmsg | ||
954 | .long sys_process_vm_readv | ||
955 | .long sys_process_vm_writev | ||
956 | .long sys_kcmp /* 350 */ | ||
957 | .long sys_finit_module | ||
942 | 958 | ||
943 | /* | 959 | /* |
944 | * NOTE!! This doesn't have to be exact - we just have | 960 | * NOTE!! This doesn't have to be exact - we just have |
@@ -950,4 +966,4 @@ sys_call_table: | |||
950 | .rept NR_syscalls-(.-sys_call_table)/4 | 966 | .rept NR_syscalls-(.-sys_call_table)/4 |
951 | .long sys_ni_syscall | 967 | .long sys_ni_syscall |
952 | .endr | 968 | .endr |
953 | 969 | ||
diff --git a/arch/cris/arch-v10/kernel/head.S b/arch/cris/arch-v10/kernel/head.S index a1f2014b4e3b..4a146e1749c9 100644 --- a/arch/cris/arch-v10/kernel/head.S +++ b/arch/cris/arch-v10/kernel/head.S | |||
@@ -1,12 +1,10 @@ | |||
1 | /* | 1 | /* |
2 | * Head of the kernel - alter with care | 2 | * Head of the kernel - alter with care |
3 | * | 3 | * |
4 | * Copyright (C) 2000, 2001 Axis Communications AB | 4 | * Copyright (C) 2000, 2001, 2010 Axis Communications AB |
5 | * | 5 | * |
6 | * Authors: Bjorn Wesen (bjornw@axis.com) | ||
7 | * | ||
8 | */ | 6 | */ |
9 | 7 | ||
10 | #define ASSEMBLER_MACROS_ONLY | 8 | #define ASSEMBLER_MACROS_ONLY |
11 | /* The IO_* macros use the ## token concatenation operator, so | 9 | /* The IO_* macros use the ## token concatenation operator, so |
12 | -traditional must not be used when assembling this file. */ | 10 | -traditional must not be used when assembling this file. */ |
@@ -18,15 +16,15 @@ | |||
18 | 16 | ||
19 | #define START_ETHERNET_CLOCK IO_STATE(R_NETWORK_GEN_CONFIG, enable, on) |\ | 17 | #define START_ETHERNET_CLOCK IO_STATE(R_NETWORK_GEN_CONFIG, enable, on) |\ |
20 | IO_STATE(R_NETWORK_GEN_CONFIG, phy, mii_clk) | 18 | IO_STATE(R_NETWORK_GEN_CONFIG, phy, mii_clk) |
21 | 19 | ||
22 | ;; exported symbols | 20 | ;; exported symbols |
23 | 21 | ||
24 | .globl etrax_irv | 22 | .globl etrax_irv |
25 | .globl romfs_start | 23 | .globl romfs_start |
26 | .globl romfs_length | 24 | .globl romfs_length |
27 | .globl romfs_in_flash | 25 | .globl romfs_in_flash |
28 | .globl swapper_pg_dir | 26 | .globl swapper_pg_dir |
29 | 27 | ||
30 | .text | 28 | .text |
31 | 29 | ||
32 | ;; This is the entry point of the kernel. We are in supervisor mode. | 30 | ;; This is the entry point of the kernel. We are in supervisor mode. |
@@ -35,10 +33,10 @@ | |||
35 | ;; put a nop (2 bytes) here first so we dont accidentally skip the di | 33 | ;; put a nop (2 bytes) here first so we dont accidentally skip the di |
36 | ;; | 34 | ;; |
37 | ;; NOTICE! The registers r8 and r9 are used as parameters carrying | 35 | ;; NOTICE! The registers r8 and r9 are used as parameters carrying |
38 | ;; information from the decompressor (if the kernel was compressed). | 36 | ;; information from the decompressor (if the kernel was compressed). |
39 | ;; They should not be used in the code below until read. | 37 | ;; They should not be used in the code below until read. |
40 | 38 | ||
41 | nop | 39 | nop |
42 | di | 40 | di |
43 | 41 | ||
44 | ;; First setup the kseg_c mapping from where the kernel is linked | 42 | ;; First setup the kseg_c mapping from where the kernel is linked |
@@ -58,19 +56,19 @@ | |||
58 | 56 | ||
59 | #ifdef CONFIG_CRIS_LOW_MAP | 57 | #ifdef CONFIG_CRIS_LOW_MAP |
60 | ; kseg mappings, temporary map of 0xc0->0x40 | 58 | ; kseg mappings, temporary map of 0xc0->0x40 |
61 | move.d IO_FIELD (R_MMU_KBASE_HI, base_c, 4) \ | 59 | move.d IO_FIELD (R_MMU_KBASE_HI, base_c, 4) \ |
62 | | IO_FIELD (R_MMU_KBASE_HI, base_b, 0xb) \ | 60 | | IO_FIELD (R_MMU_KBASE_HI, base_b, 0xb) \ |
63 | | IO_FIELD (R_MMU_KBASE_HI, base_9, 9) \ | 61 | | IO_FIELD (R_MMU_KBASE_HI, base_9, 9) \ |
64 | | IO_FIELD (R_MMU_KBASE_HI, base_8, 8), $r0 | 62 | | IO_FIELD (R_MMU_KBASE_HI, base_8, 8), $r0 |
65 | move.d $r0, [R_MMU_KBASE_HI] | 63 | move.d $r0, [R_MMU_KBASE_HI] |
66 | 64 | ||
67 | ; temporary map of 0x40->0x40 and 0x60->0x40 | 65 | ; temporary map of 0x40->0x40 and 0x60->0x40 |
68 | move.d IO_FIELD (R_MMU_KBASE_LO, base_6, 4) \ | 66 | move.d IO_FIELD (R_MMU_KBASE_LO, base_6, 4) \ |
69 | | IO_FIELD (R_MMU_KBASE_LO, base_4, 4), $r0 | 67 | | IO_FIELD (R_MMU_KBASE_LO, base_4, 4), $r0 |
70 | move.d $r0, [R_MMU_KBASE_LO] | 68 | move.d $r0, [R_MMU_KBASE_LO] |
71 | 69 | ||
72 | ; mmu enable, segs e,c,b,a,6,5,4,0 segment mapped | 70 | ; mmu enable, segs e,c,b,a,6,5,4,0 segment mapped |
73 | move.d IO_STATE (R_MMU_CONFIG, mmu_enable, enable) \ | 71 | move.d IO_STATE (R_MMU_CONFIG, mmu_enable, enable) \ |
74 | | IO_STATE (R_MMU_CONFIG, inv_excp, enable) \ | 72 | | IO_STATE (R_MMU_CONFIG, inv_excp, enable) \ |
75 | | IO_STATE (R_MMU_CONFIG, acc_excp, enable) \ | 73 | | IO_STATE (R_MMU_CONFIG, acc_excp, enable) \ |
76 | | IO_STATE (R_MMU_CONFIG, we_excp, enable) \ | 74 | | IO_STATE (R_MMU_CONFIG, we_excp, enable) \ |
@@ -93,17 +91,17 @@ | |||
93 | move.d $r0, [R_MMU_CONFIG] | 91 | move.d $r0, [R_MMU_CONFIG] |
94 | #else | 92 | #else |
95 | ; kseg mappings | 93 | ; kseg mappings |
96 | move.d IO_FIELD (R_MMU_KBASE_HI, base_e, 8) \ | 94 | move.d IO_FIELD (R_MMU_KBASE_HI, base_e, 8) \ |
97 | | IO_FIELD (R_MMU_KBASE_HI, base_c, 4) \ | 95 | | IO_FIELD (R_MMU_KBASE_HI, base_c, 4) \ |
98 | | IO_FIELD (R_MMU_KBASE_HI, base_b, 0xb), $r0 | 96 | | IO_FIELD (R_MMU_KBASE_HI, base_b, 0xb), $r0 |
99 | move.d $r0, [R_MMU_KBASE_HI] | 97 | move.d $r0, [R_MMU_KBASE_HI] |
100 | 98 | ||
101 | ; temporary map of 0x40->0x40 and 0x00->0x00 | 99 | ; temporary map of 0x40->0x40 and 0x00->0x00 |
102 | move.d IO_FIELD (R_MMU_KBASE_LO, base_4, 4), $r0 | 100 | move.d IO_FIELD (R_MMU_KBASE_LO, base_4, 4), $r0 |
103 | move.d $r0, [R_MMU_KBASE_LO] | 101 | move.d $r0, [R_MMU_KBASE_LO] |
104 | 102 | ||
105 | ; mmu enable, segs f,e,c,b,4,0 segment mapped | 103 | ; mmu enable, segs f,e,c,b,4,0 segment mapped |
106 | move.d IO_STATE (R_MMU_CONFIG, mmu_enable, enable) \ | 104 | move.d IO_STATE (R_MMU_CONFIG, mmu_enable, enable) \ |
107 | | IO_STATE (R_MMU_CONFIG, inv_excp, enable) \ | 105 | | IO_STATE (R_MMU_CONFIG, inv_excp, enable) \ |
108 | | IO_STATE (R_MMU_CONFIG, acc_excp, enable) \ | 106 | | IO_STATE (R_MMU_CONFIG, acc_excp, enable) \ |
109 | | IO_STATE (R_MMU_CONFIG, we_excp, enable) \ | 107 | | IO_STATE (R_MMU_CONFIG, we_excp, enable) \ |
@@ -141,12 +139,12 @@ | |||
141 | ;; | 139 | ;; |
142 | ;; In both cases, we start in un-cached mode, and need to jump into a | 140 | ;; In both cases, we start in un-cached mode, and need to jump into a |
143 | ;; cached PC after we're done fiddling around with the segments. | 141 | ;; cached PC after we're done fiddling around with the segments. |
144 | ;; | 142 | ;; |
145 | ;; arch/etrax100/etrax100.ld sets some symbols that define the start | 143 | ;; arch/etrax100/etrax100.ld sets some symbols that define the start |
146 | ;; and end of each segment. | 144 | ;; and end of each segment. |
147 | 145 | ||
148 | ;; Check if we start from DRAM or FLASH by testing PC | 146 | ;; Check if we start from DRAM or FLASH by testing PC |
149 | 147 | ||
150 | move.d $pc,$r0 | 148 | move.d $pc,$r0 |
151 | and.d 0x7fffffff,$r0 ; get rid of the non-cache bit | 149 | and.d 0x7fffffff,$r0 ; get rid of the non-cache bit |
152 | cmp.d 0x10000,$r0 ; arbitrary... just something above this code | 150 | cmp.d 0x10000,$r0 ; arbitrary... just something above this code |
@@ -163,30 +161,28 @@ _inflash0: | |||
163 | ;; after init. | 161 | ;; after init. |
164 | .section ".init.text", "ax" | 162 | .section ".init.text", "ax" |
165 | _inflash: | 163 | _inflash: |
166 | #ifdef CONFIG_ETRAX_ETHERNET | 164 | #ifdef CONFIG_ETRAX_ETHERNET |
167 | ;; Start MII clock to make sure it is running when tranceiver is reset | 165 | ;; Start MII clock to make sure it is running when tranceiver is reset |
168 | move.d START_ETHERNET_CLOCK, $r0 | 166 | move.d START_ETHERNET_CLOCK, $r0 |
169 | move.d $r0, [R_NETWORK_GEN_CONFIG] | 167 | move.d $r0, [R_NETWORK_GEN_CONFIG] |
170 | #endif | 168 | #endif |
171 | 169 | ||
172 | ;; Set up waitstates etc according to kernel configuration. | 170 | ;; Set up waitstates etc according to kernel configuration. |
173 | #ifndef CONFIG_SVINTO_SIM | ||
174 | move.d CONFIG_ETRAX_DEF_R_WAITSTATES, $r0 | 171 | move.d CONFIG_ETRAX_DEF_R_WAITSTATES, $r0 |
175 | move.d $r0, [R_WAITSTATES] | 172 | move.d $r0, [R_WAITSTATES] |
176 | 173 | ||
177 | move.d CONFIG_ETRAX_DEF_R_BUS_CONFIG, $r0 | 174 | move.d CONFIG_ETRAX_DEF_R_BUS_CONFIG, $r0 |
178 | move.d $r0, [R_BUS_CONFIG] | 175 | move.d $r0, [R_BUS_CONFIG] |
179 | #endif | ||
180 | 176 | ||
181 | ;; We need to initialze DRAM registers before we start using the DRAM | 177 | ;; We need to initialze DRAM registers before we start using the DRAM |
182 | 178 | ||
183 | cmp.d RAM_INIT_MAGIC, $r8 ; Already initialized? | 179 | cmp.d RAM_INIT_MAGIC, $r8 ; Already initialized? |
184 | beq _dram_init_finished | 180 | beq _dram_init_finished |
185 | nop | 181 | nop |
186 | 182 | ||
187 | #include "../lib/dram_init.S" | 183 | #include "../lib/dram_init.S" |
188 | 184 | ||
189 | _dram_init_finished: | 185 | _dram_init_finished: |
190 | ;; Copy text+data to DRAM | 186 | ;; Copy text+data to DRAM |
191 | ;; This is fragile - the calculation of r4 as the image size depends | 187 | ;; This is fragile - the calculation of r4 as the image size depends |
192 | ;; on that the labels below actually are the first and last positions | 188 | ;; on that the labels below actually are the first and last positions |
@@ -198,7 +194,7 @@ _dram_init_finished: | |||
198 | ;; between the physical start of the flash and the flash-image start, | 194 | ;; between the physical start of the flash and the flash-image start, |
199 | ;; and when run with compression, the kernel is actually unpacked to | 195 | ;; and when run with compression, the kernel is actually unpacked to |
200 | ;; DRAM and we never get here in the first place :)) | 196 | ;; DRAM and we never get here in the first place :)) |
201 | 197 | ||
202 | moveq 0, $r0 ; source | 198 | moveq 0, $r0 ; source |
203 | move.d text_start, $r1 ; destination | 199 | move.d text_start, $r1 ; destination |
204 | move.d __vmlinux_end, $r2 ; end destination | 200 | move.d __vmlinux_end, $r2 ; end destination |
@@ -229,10 +225,10 @@ _dram_init_finished: | |||
229 | add.d 0xf0000000, $r4 ; add flash start in virtual memory (cached) | 225 | add.d 0xf0000000, $r4 ; add flash start in virtual memory (cached) |
230 | #endif | 226 | #endif |
231 | move.d $r4, [romfs_start] | 227 | move.d $r4, [romfs_start] |
232 | 1: | 228 | 1: |
233 | moveq 1, $r0 | 229 | moveq 1, $r0 |
234 | move.d $r0, [romfs_in_flash] | 230 | move.d $r0, [romfs_in_flash] |
235 | 231 | ||
236 | jump _start_it ; enter code, cached this time | 232 | jump _start_it ; enter code, cached this time |
237 | 233 | ||
238 | _inram: | 234 | _inram: |
@@ -241,7 +237,7 @@ _inram: | |||
241 | 237 | ||
242 | moveq 0, $r0 | 238 | moveq 0, $r0 |
243 | move.d $r0, [romfs_length] ; default if there is no cramfs | 239 | move.d $r0, [romfs_length] ; default if there is no cramfs |
244 | 240 | ||
245 | ;; The kernel could have been unpacked to DRAM by the loader, but | 241 | ;; The kernel could have been unpacked to DRAM by the loader, but |
246 | ;; the cramfs image could still be in the Flash directly after the | 242 | ;; the cramfs image could still be in the Flash directly after the |
247 | ;; compressed kernel image. The loader passes the address of the | 243 | ;; compressed kernel image. The loader passes the address of the |
@@ -251,7 +247,7 @@ _inram: | |||
251 | ;; (Notice that if this is not booted from the loader, r9 will be | 247 | ;; (Notice that if this is not booted from the loader, r9 will be |
252 | ;; garbage but we do sanity checks on it, the chance that it points | 248 | ;; garbage but we do sanity checks on it, the chance that it points |
253 | ;; to a cramfs magic is small.. ) | 249 | ;; to a cramfs magic is small.. ) |
254 | 250 | ||
255 | cmp.d 0x0ffffff8, $r9 | 251 | cmp.d 0x0ffffff8, $r9 |
256 | bhs _no_romfs_in_flash ; r9 points outside the flash area | 252 | bhs _no_romfs_in_flash ; r9 points outside the flash area |
257 | nop | 253 | nop |
@@ -274,7 +270,7 @@ _inram: | |||
274 | jump _start_it ; enter code, cached this time | 270 | jump _start_it ; enter code, cached this time |
275 | 271 | ||
276 | _no_romfs_in_flash: | 272 | _no_romfs_in_flash: |
277 | 273 | ||
278 | ;; Check if there is a cramfs (magic value). | 274 | ;; Check if there is a cramfs (magic value). |
279 | ;; Notice that we check for cramfs magic value - which is | 275 | ;; Notice that we check for cramfs magic value - which is |
280 | ;; the "rom fs" we'll possibly use in 2.4 if not JFFS (which does | 276 | ;; the "rom fs" we'll possibly use in 2.4 if not JFFS (which does |
@@ -286,8 +282,8 @@ _no_romfs_in_flash: | |||
286 | bne 2f | 282 | bne 2f |
287 | nop | 283 | nop |
288 | 284 | ||
289 | ;; Ok. What is its size ? | 285 | ;; Ok. What is its size ? |
290 | 286 | ||
291 | move.d [$r0 + 4], $r2 ; cramfs_super.size (again, no need to swapwb) | 287 | move.d [$r0 + 4], $r2 ; cramfs_super.size (again, no need to swapwb) |
292 | 288 | ||
293 | ;; We want to copy it to the end of the BSS | 289 | ;; We want to copy it to the end of the BSS |
@@ -303,7 +299,7 @@ _no_romfs_in_flash: | |||
303 | 299 | ||
304 | add.d $r2, $r0 | 300 | add.d $r2, $r0 |
305 | add.d $r2, $r1 | 301 | add.d $r2, $r1 |
306 | 302 | ||
307 | ;; Go ahead. Make my loop. | 303 | ;; Go ahead. Make my loop. |
308 | 304 | ||
309 | lsrq 1, $r2 ; size is in bytes, we copy words | 305 | lsrq 1, $r2 ; size is in bytes, we copy words |
@@ -314,14 +310,14 @@ _no_romfs_in_flash: | |||
314 | bne 1b | 310 | bne 1b |
315 | nop | 311 | nop |
316 | 312 | ||
317 | 2: | 313 | 2: |
318 | ;; Dont worry that the BSS is tainted. It will be cleared later. | 314 | ;; Dont worry that the BSS is tainted. It will be cleared later. |
319 | 315 | ||
320 | moveq 0, $r0 | 316 | moveq 0, $r0 |
321 | move.d $r0, [romfs_in_flash] | 317 | move.d $r0, [romfs_in_flash] |
322 | 318 | ||
323 | jump _start_it ; better skip the additional cramfs check below | 319 | jump _start_it ; better skip the additional cramfs check below |
324 | 320 | ||
325 | _start_it: | 321 | _start_it: |
326 | 322 | ||
327 | ;; Check if kernel command line is supplied | 323 | ;; Check if kernel command line is supplied |
@@ -348,7 +344,7 @@ no_command_line: | |||
348 | move.d ibr_start,$r0 ; this symbol is set by the linker script | 344 | move.d ibr_start,$r0 ; this symbol is set by the linker script |
349 | move $r0,$ibr | 345 | move $r0,$ibr |
350 | move.d $r0,[etrax_irv] ; set the interrupt base register and pointer | 346 | move.d $r0,[etrax_irv] ; set the interrupt base register and pointer |
351 | 347 | ||
352 | ;; Clear BSS region, from _bss_start to _end | 348 | ;; Clear BSS region, from _bss_start to _end |
353 | 349 | ||
354 | move.d __bss_start, $r0 | 350 | move.d __bss_start, $r0 |
@@ -357,7 +353,7 @@ no_command_line: | |||
357 | cmp.d $r1, $r0 | 353 | cmp.d $r1, $r0 |
358 | blo 1b | 354 | blo 1b |
359 | nop | 355 | nop |
360 | 356 | ||
361 | #ifdef CONFIG_BLK_DEV_ETRAXIDE | 357 | #ifdef CONFIG_BLK_DEV_ETRAXIDE |
362 | ;; disable ATA before enabling it in genconfig below | 358 | ;; disable ATA before enabling it in genconfig below |
363 | moveq 0,$r0 | 359 | moveq 0,$r0 |
@@ -380,7 +376,7 @@ no_command_line: | |||
380 | 376 | ||
381 | #ifdef CONFIG_JULIETTE | 377 | #ifdef CONFIG_JULIETTE |
382 | ;; configure external DMA channel 0 before enabling it in genconfig | 378 | ;; configure external DMA channel 0 before enabling it in genconfig |
383 | 379 | ||
384 | moveq 0,$r0 | 380 | moveq 0,$r0 |
385 | move.d $r0,[R_EXT_DMA_0_ADDR] | 381 | move.d $r0,[R_EXT_DMA_0_ADDR] |
386 | ; cnt enable, word size, output, stop, size 0 | 382 | ; cnt enable, word size, output, stop, size 0 |
@@ -395,7 +391,7 @@ no_command_line: | |||
395 | move.d $r0,[R_EXT_DMA_0_CMD] | 391 | move.d $r0,[R_EXT_DMA_0_CMD] |
396 | 392 | ||
397 | ;; reset dma4 and wait for completion | 393 | ;; reset dma4 and wait for completion |
398 | 394 | ||
399 | moveq IO_STATE (R_DMA_CH4_CMD, cmd, reset),$r0 | 395 | moveq IO_STATE (R_DMA_CH4_CMD, cmd, reset),$r0 |
400 | move.b $r0,[R_DMA_CH4_CMD] | 396 | move.b $r0,[R_DMA_CH4_CMD] |
401 | 1: move.b [R_DMA_CH4_CMD],$r0 | 397 | 1: move.b [R_DMA_CH4_CMD],$r0 |
@@ -405,7 +401,7 @@ no_command_line: | |||
405 | nop | 401 | nop |
406 | 402 | ||
407 | ;; reset dma5 and wait for completion | 403 | ;; reset dma5 and wait for completion |
408 | 404 | ||
409 | moveq IO_STATE (R_DMA_CH5_CMD, cmd, reset),$r0 | 405 | moveq IO_STATE (R_DMA_CH5_CMD, cmd, reset),$r0 |
410 | move.b $r0,[R_DMA_CH5_CMD] | 406 | move.b $r0,[R_DMA_CH5_CMD] |
411 | 1: move.b [R_DMA_CH5_CMD],$r0 | 407 | 1: move.b [R_DMA_CH5_CMD],$r0 |
@@ -413,8 +409,8 @@ no_command_line: | |||
413 | cmp.b IO_STATE (R_DMA_CH5_CMD, cmd, reset),$r0 | 409 | cmp.b IO_STATE (R_DMA_CH5_CMD, cmd, reset),$r0 |
414 | beq 1b | 410 | beq 1b |
415 | nop | 411 | nop |
416 | #endif | 412 | #endif |
417 | 413 | ||
418 | ;; Etrax product HW genconfig setup | 414 | ;; Etrax product HW genconfig setup |
419 | 415 | ||
420 | moveq 0,$r0 | 416 | moveq 0,$r0 |
@@ -468,7 +464,6 @@ no_command_line: | |||
468 | 464 | ||
469 | move.d $r0,[genconfig_shadow] ; init a shadow register of R_GEN_CONFIG | 465 | move.d $r0,[genconfig_shadow] ; init a shadow register of R_GEN_CONFIG |
470 | 466 | ||
471 | #ifndef CONFIG_SVINTO_SIM | ||
472 | move.d $r0,[R_GEN_CONFIG] | 467 | move.d $r0,[R_GEN_CONFIG] |
473 | 468 | ||
474 | #if 0 | 469 | #if 0 |
@@ -486,7 +481,7 @@ no_command_line: | |||
486 | beq 1b | 481 | beq 1b |
487 | nop | 482 | nop |
488 | #endif | 483 | #endif |
489 | 484 | ||
490 | moveq IO_STATE (R_DMA_CH8_CMD, cmd, reset),$r0 | 485 | moveq IO_STATE (R_DMA_CH8_CMD, cmd, reset),$r0 |
491 | move.b $r0,[R_DMA_CH8_CMD] ; reset (ser1 dma out) | 486 | move.b $r0,[R_DMA_CH8_CMD] ; reset (ser1 dma out) |
492 | move.b $r0,[R_DMA_CH9_CMD] ; reset (ser1 dma in) | 487 | move.b $r0,[R_DMA_CH9_CMD] ; reset (ser1 dma in) |
@@ -503,7 +498,7 @@ no_command_line: | |||
503 | 498 | ||
504 | ;; setup port PA and PB default initial directions and data | 499 | ;; setup port PA and PB default initial directions and data |
505 | ;; including their shadow registers | 500 | ;; including their shadow registers |
506 | 501 | ||
507 | move.b CONFIG_ETRAX_DEF_R_PORT_PA_DIR,$r0 | 502 | move.b CONFIG_ETRAX_DEF_R_PORT_PA_DIR,$r0 |
508 | #if defined(CONFIG_BLUETOOTH) && defined(CONFIG_BLUETOOTH_RESET_PA7) | 503 | #if defined(CONFIG_BLUETOOTH) && defined(CONFIG_BLUETOOTH_RESET_PA7) |
509 | or.b IO_STATE (R_PORT_PA_DIR, dir7, output),$r0 | 504 | or.b IO_STATE (R_PORT_PA_DIR, dir7, output),$r0 |
@@ -520,7 +515,7 @@ no_command_line: | |||
520 | #endif | 515 | #endif |
521 | move.b $r0,[port_pa_data_shadow] | 516 | move.b $r0,[port_pa_data_shadow] |
522 | move.b $r0,[R_PORT_PA_DATA] | 517 | move.b $r0,[R_PORT_PA_DATA] |
523 | 518 | ||
524 | move.b CONFIG_ETRAX_DEF_R_PORT_PB_CONFIG,$r0 | 519 | move.b CONFIG_ETRAX_DEF_R_PORT_PB_CONFIG,$r0 |
525 | move.b $r0,[port_pb_config_shadow] | 520 | move.b $r0,[port_pb_config_shadow] |
526 | move.b $r0,[R_PORT_PB_CONFIG] | 521 | move.b $r0,[R_PORT_PB_CONFIG] |
@@ -562,13 +557,13 @@ no_command_line: | |||
562 | #endif | 557 | #endif |
563 | move.d $r0,[port_g_data_shadow] | 558 | move.d $r0,[port_g_data_shadow] |
564 | move.d $r0,[R_PORT_G_DATA] | 559 | move.d $r0,[R_PORT_G_DATA] |
565 | 560 | ||
566 | ;; setup the serial port 0 at 115200 baud for debug purposes | 561 | ;; setup the serial port 0 at 115200 baud for debug purposes |
567 | 562 | ||
568 | moveq IO_STATE (R_SERIAL0_XOFF, tx_stop, enable) \ | 563 | moveq IO_STATE (R_SERIAL0_XOFF, tx_stop, enable) \ |
569 | | IO_STATE (R_SERIAL0_XOFF, auto_xoff, disable) \ | 564 | | IO_STATE (R_SERIAL0_XOFF, auto_xoff, disable) \ |
570 | | IO_FIELD (R_SERIAL0_XOFF, xoff_char, 0),$r0 | 565 | | IO_FIELD (R_SERIAL0_XOFF, xoff_char, 0),$r0 |
571 | move.d $r0,[R_SERIAL0_XOFF] | 566 | move.d $r0,[R_SERIAL0_XOFF] |
572 | 567 | ||
573 | ; 115.2kbaud for both transmit and receive | 568 | ; 115.2kbaud for both transmit and receive |
574 | move.b IO_STATE (R_SERIAL0_BAUD, tr_baud, c115k2Hz) \ | 569 | move.b IO_STATE (R_SERIAL0_BAUD, tr_baud, c115k2Hz) \ |
@@ -584,8 +579,8 @@ no_command_line: | |||
584 | | IO_STATE (R_SERIAL0_REC_CTRL, rec_par, even) \ | 579 | | IO_STATE (R_SERIAL0_REC_CTRL, rec_par, even) \ |
585 | | IO_STATE (R_SERIAL0_REC_CTRL, rec_par_en, disable) \ | 580 | | IO_STATE (R_SERIAL0_REC_CTRL, rec_par_en, disable) \ |
586 | | IO_STATE (R_SERIAL0_REC_CTRL, rec_bitnr, rec_8bit),$r0 | 581 | | IO_STATE (R_SERIAL0_REC_CTRL, rec_bitnr, rec_8bit),$r0 |
587 | move.b $r0,[R_SERIAL0_REC_CTRL] | 582 | move.b $r0,[R_SERIAL0_REC_CTRL] |
588 | 583 | ||
589 | ; Set up and enable the serial0 transmitter. | 584 | ; Set up and enable the serial0 transmitter. |
590 | move.b IO_FIELD (R_SERIAL0_TR_CTRL, txd, 0) \ | 585 | move.b IO_FIELD (R_SERIAL0_TR_CTRL, txd, 0) \ |
591 | | IO_STATE (R_SERIAL0_TR_CTRL, tr_enable, enable) \ | 586 | | IO_STATE (R_SERIAL0_TR_CTRL, tr_enable, enable) \ |
@@ -598,11 +593,11 @@ no_command_line: | |||
598 | move.b $r0,[R_SERIAL0_TR_CTRL] | 593 | move.b $r0,[R_SERIAL0_TR_CTRL] |
599 | 594 | ||
600 | ;; setup the serial port 1 at 115200 baud for debug purposes | 595 | ;; setup the serial port 1 at 115200 baud for debug purposes |
601 | 596 | ||
602 | moveq IO_STATE (R_SERIAL1_XOFF, tx_stop, enable) \ | 597 | moveq IO_STATE (R_SERIAL1_XOFF, tx_stop, enable) \ |
603 | | IO_STATE (R_SERIAL1_XOFF, auto_xoff, disable) \ | 598 | | IO_STATE (R_SERIAL1_XOFF, auto_xoff, disable) \ |
604 | | IO_FIELD (R_SERIAL1_XOFF, xoff_char, 0),$r0 | 599 | | IO_FIELD (R_SERIAL1_XOFF, xoff_char, 0),$r0 |
605 | move.d $r0,[R_SERIAL1_XOFF] | 600 | move.d $r0,[R_SERIAL1_XOFF] |
606 | 601 | ||
607 | ; 115.2kbaud for both transmit and receive | 602 | ; 115.2kbaud for both transmit and receive |
608 | move.b IO_STATE (R_SERIAL1_BAUD, tr_baud, c115k2Hz) \ | 603 | move.b IO_STATE (R_SERIAL1_BAUD, tr_baud, c115k2Hz) \ |
@@ -618,8 +613,8 @@ no_command_line: | |||
618 | | IO_STATE (R_SERIAL1_REC_CTRL, rec_par, even) \ | 613 | | IO_STATE (R_SERIAL1_REC_CTRL, rec_par, even) \ |
619 | | IO_STATE (R_SERIAL1_REC_CTRL, rec_par_en, disable) \ | 614 | | IO_STATE (R_SERIAL1_REC_CTRL, rec_par_en, disable) \ |
620 | | IO_STATE (R_SERIAL1_REC_CTRL, rec_bitnr, rec_8bit),$r0 | 615 | | IO_STATE (R_SERIAL1_REC_CTRL, rec_bitnr, rec_8bit),$r0 |
621 | move.b $r0,[R_SERIAL1_REC_CTRL] | 616 | move.b $r0,[R_SERIAL1_REC_CTRL] |
622 | 617 | ||
623 | ; Set up and enable the serial1 transmitter. | 618 | ; Set up and enable the serial1 transmitter. |
624 | move.b IO_FIELD (R_SERIAL1_TR_CTRL, txd, 0) \ | 619 | move.b IO_FIELD (R_SERIAL1_TR_CTRL, txd, 0) \ |
625 | | IO_STATE (R_SERIAL1_TR_CTRL, tr_enable, enable) \ | 620 | | IO_STATE (R_SERIAL1_TR_CTRL, tr_enable, enable) \ |
@@ -666,14 +661,14 @@ no_command_line: | |||
666 | | IO_STATE (R_SERIAL2_TR_CTRL, tr_bitnr, tr_8bit),$r0 | 661 | | IO_STATE (R_SERIAL2_TR_CTRL, tr_bitnr, tr_8bit),$r0 |
667 | move.b $r0,[R_SERIAL2_TR_CTRL] | 662 | move.b $r0,[R_SERIAL2_TR_CTRL] |
668 | #endif | 663 | #endif |
669 | 664 | ||
670 | #ifdef CONFIG_ETRAX_SERIAL_PORT3 | 665 | #ifdef CONFIG_ETRAX_SERIAL_PORT3 |
671 | ;; setup the serial port 3 at 115200 baud for debug purposes | 666 | ;; setup the serial port 3 at 115200 baud for debug purposes |
672 | 667 | ||
673 | moveq IO_STATE (R_SERIAL3_XOFF, tx_stop, enable) \ | 668 | moveq IO_STATE (R_SERIAL3_XOFF, tx_stop, enable) \ |
674 | | IO_STATE (R_SERIAL3_XOFF, auto_xoff, disable) \ | 669 | | IO_STATE (R_SERIAL3_XOFF, auto_xoff, disable) \ |
675 | | IO_FIELD (R_SERIAL3_XOFF, xoff_char, 0),$r0 | 670 | | IO_FIELD (R_SERIAL3_XOFF, xoff_char, 0),$r0 |
676 | move.d $r0,[R_SERIAL3_XOFF] | 671 | move.d $r0,[R_SERIAL3_XOFF] |
677 | 672 | ||
678 | ; 115.2kbaud for both transmit and receive | 673 | ; 115.2kbaud for both transmit and receive |
679 | move.b IO_STATE (R_SERIAL3_BAUD, tr_baud, c115k2Hz) \ | 674 | move.b IO_STATE (R_SERIAL3_BAUD, tr_baud, c115k2Hz) \ |
@@ -689,8 +684,8 @@ no_command_line: | |||
689 | | IO_STATE (R_SERIAL3_REC_CTRL, rec_par, even) \ | 684 | | IO_STATE (R_SERIAL3_REC_CTRL, rec_par, even) \ |
690 | | IO_STATE (R_SERIAL3_REC_CTRL, rec_par_en, disable) \ | 685 | | IO_STATE (R_SERIAL3_REC_CTRL, rec_par_en, disable) \ |
691 | | IO_STATE (R_SERIAL3_REC_CTRL, rec_bitnr, rec_8bit),$r0 | 686 | | IO_STATE (R_SERIAL3_REC_CTRL, rec_bitnr, rec_8bit),$r0 |
692 | move.b $r0,[R_SERIAL3_REC_CTRL] | 687 | move.b $r0,[R_SERIAL3_REC_CTRL] |
693 | 688 | ||
694 | ; Set up and enable the serial3 transmitter. | 689 | ; Set up and enable the serial3 transmitter. |
695 | move.b IO_FIELD (R_SERIAL3_TR_CTRL, txd, 0) \ | 690 | move.b IO_FIELD (R_SERIAL3_TR_CTRL, txd, 0) \ |
696 | | IO_STATE (R_SERIAL3_TR_CTRL, tr_enable, enable) \ | 691 | | IO_STATE (R_SERIAL3_TR_CTRL, tr_enable, enable) \ |
@@ -702,13 +697,11 @@ no_command_line: | |||
702 | | IO_STATE (R_SERIAL3_TR_CTRL, tr_bitnr, tr_8bit),$r0 | 697 | | IO_STATE (R_SERIAL3_TR_CTRL, tr_bitnr, tr_8bit),$r0 |
703 | move.b $r0,[R_SERIAL3_TR_CTRL] | 698 | move.b $r0,[R_SERIAL3_TR_CTRL] |
704 | #endif | 699 | #endif |
705 | |||
706 | #endif /* CONFIG_SVINTO_SIM */ | ||
707 | 700 | ||
708 | jump start_kernel ; jump into the C-function start_kernel in init/main.c | 701 | jump start_kernel ; jump into the C-function start_kernel in init/main.c |
709 | 702 | ||
710 | .data | 703 | .data |
711 | etrax_irv: | 704 | etrax_irv: |
712 | .dword 0 | 705 | .dword 0 |
713 | romfs_start: | 706 | romfs_start: |
714 | .dword 0 | 707 | .dword 0 |
@@ -716,13 +709,13 @@ romfs_length: | |||
716 | .dword 0 | 709 | .dword 0 |
717 | romfs_in_flash: | 710 | romfs_in_flash: |
718 | .dword 0 | 711 | .dword 0 |
719 | 712 | ||
720 | ;; put some special pages at the beginning of the kernel aligned | 713 | ;; put some special pages at the beginning of the kernel aligned |
721 | ;; to page boundaries - the kernel cannot start until after this | 714 | ;; to page boundaries - the kernel cannot start until after this |
722 | 715 | ||
723 | #ifdef CONFIG_CRIS_LOW_MAP | 716 | #ifdef CONFIG_CRIS_LOW_MAP |
724 | swapper_pg_dir = 0x60002000 | 717 | swapper_pg_dir = 0x60002000 |
725 | #else | 718 | #else |
726 | swapper_pg_dir = 0xc0002000 | 719 | swapper_pg_dir = 0xc0002000 |
727 | #endif | 720 | #endif |
728 | 721 | ||
diff --git a/arch/cris/arch-v10/kernel/irq.c b/arch/cris/arch-v10/kernel/irq.c index ba0e5965d6e3..09cae80a834a 100644 --- a/arch/cris/arch-v10/kernel/irq.c +++ b/arch/cris/arch-v10/kernel/irq.c | |||
@@ -5,7 +5,7 @@ | |||
5 | * | 5 | * |
6 | * Authors: Bjorn Wesen (bjornw@axis.com) | 6 | * Authors: Bjorn Wesen (bjornw@axis.com) |
7 | * | 7 | * |
8 | * This file contains the interrupt vectors and some | 8 | * This file contains the interrupt vectors and some |
9 | * helper functions | 9 | * helper functions |
10 | * | 10 | * |
11 | */ | 11 | */ |
@@ -182,19 +182,14 @@ void do_multiple_IRQ(struct pt_regs* regs) | |||
182 | setting the irq vector table. | 182 | setting the irq vector table. |
183 | */ | 183 | */ |
184 | 184 | ||
185 | void __init | 185 | void __init init_IRQ(void) |
186 | init_IRQ(void) | ||
187 | { | 186 | { |
188 | int i; | 187 | int i; |
189 | 188 | ||
190 | /* clear all interrupt masks */ | 189 | /* clear all interrupt masks */ |
191 | |||
192 | #ifndef CONFIG_SVINTO_SIM | ||
193 | *R_IRQ_MASK0_CLR = 0xffffffff; | 190 | *R_IRQ_MASK0_CLR = 0xffffffff; |
194 | *R_IRQ_MASK1_CLR = 0xffffffff; | 191 | *R_IRQ_MASK1_CLR = 0xffffffff; |
195 | *R_IRQ_MASK2_CLR = 0xffffffff; | 192 | *R_IRQ_MASK2_CLR = 0xffffffff; |
196 | #endif | ||
197 | |||
198 | *R_VECT_MASK_CLR = 0xffffffff; | 193 | *R_VECT_MASK_CLR = 0xffffffff; |
199 | 194 | ||
200 | for (i = 0; i < 256; i++) | 195 | for (i = 0; i < 256; i++) |
@@ -211,25 +206,20 @@ init_IRQ(void) | |||
211 | executed by the associated break handler, rather than just a jump | 206 | executed by the associated break handler, rather than just a jump |
212 | address. therefore we need to setup a default breakpoint handler | 207 | address. therefore we need to setup a default breakpoint handler |
213 | for all breakpoints */ | 208 | for all breakpoints */ |
214 | |||
215 | for (i = 0; i < 16; i++) | 209 | for (i = 0; i < 16; i++) |
216 | set_break_vector(i, do_sigtrap); | 210 | set_break_vector(i, do_sigtrap); |
217 | |||
218 | /* except IRQ 15 which is the multiple-IRQ handler on Etrax100 */ | ||
219 | 211 | ||
212 | /* except IRQ 15 which is the multiple-IRQ handler on Etrax100 */ | ||
220 | set_int_vector(15, multiple_interrupt); | 213 | set_int_vector(15, multiple_interrupt); |
221 | |||
222 | /* 0 and 1 which are special breakpoint/NMI traps */ | ||
223 | 214 | ||
215 | /* 0 and 1 which are special breakpoint/NMI traps */ | ||
224 | set_int_vector(0, hwbreakpoint); | 216 | set_int_vector(0, hwbreakpoint); |
225 | set_int_vector(1, IRQ1_interrupt); | 217 | set_int_vector(1, IRQ1_interrupt); |
226 | 218 | ||
227 | /* and irq 14 which is the mmu bus fault handler */ | 219 | /* and irq 14 which is the mmu bus fault handler */ |
228 | |||
229 | set_int_vector(14, mmu_bus_fault); | 220 | set_int_vector(14, mmu_bus_fault); |
230 | 221 | ||
231 | /* setup the system-call trap, which is reached by BREAK 13 */ | 222 | /* setup the system-call trap, which is reached by BREAK 13 */ |
232 | |||
233 | set_break_vector(13, system_call); | 223 | set_break_vector(13, system_call); |
234 | 224 | ||
235 | /* setup a breakpoint handler for debugging used for both user and | 225 | /* setup a breakpoint handler for debugging used for both user and |
diff --git a/arch/cris/arch-v10/kernel/process.c b/arch/cris/arch-v10/kernel/process.c index 753e9a03cf87..c20e4e8c3663 100644 --- a/arch/cris/arch-v10/kernel/process.c +++ b/arch/cris/arch-v10/kernel/process.c | |||
@@ -14,7 +14,6 @@ | |||
14 | #include <linux/slab.h> | 14 | #include <linux/slab.h> |
15 | #include <linux/err.h> | 15 | #include <linux/err.h> |
16 | #include <linux/fs.h> | 16 | #include <linux/fs.h> |
17 | #include <arch/svinto.h> | ||
18 | #include <linux/init.h> | 17 | #include <linux/init.h> |
19 | #include <arch/system.h> | 18 | #include <arch/system.h> |
20 | #include <linux/ptrace.h> | 19 | #include <linux/ptrace.h> |
@@ -56,14 +55,14 @@ void hard_reset_now (void) | |||
56 | * code to know about it than the watchdog handler in entry.S and | 55 | * code to know about it than the watchdog handler in entry.S and |
57 | * this code, implementing hard reset through the watchdog. | 56 | * this code, implementing hard reset through the watchdog. |
58 | */ | 57 | */ |
59 | #if defined(CONFIG_ETRAX_WATCHDOG) && !defined(CONFIG_SVINTO_SIM) | 58 | #if defined(CONFIG_ETRAX_WATCHDOG) |
60 | extern int cause_of_death; | 59 | extern int cause_of_death; |
61 | #endif | 60 | #endif |
62 | 61 | ||
63 | printk("*** HARD RESET ***\n"); | 62 | printk("*** HARD RESET ***\n"); |
64 | local_irq_disable(); | 63 | local_irq_disable(); |
65 | 64 | ||
66 | #if defined(CONFIG_ETRAX_WATCHDOG) && !defined(CONFIG_SVINTO_SIM) | 65 | #if defined(CONFIG_ETRAX_WATCHDOG) |
67 | cause_of_death = 0xbedead; | 66 | cause_of_death = 0xbedead; |
68 | #else | 67 | #else |
69 | /* Since we dont plan to keep on resetting the watchdog, | 68 | /* Since we dont plan to keep on resetting the watchdog, |
diff --git a/arch/cris/arch-v10/kernel/time.c b/arch/cris/arch-v10/kernel/time.c index fce7c541d70d..b5eb5cd2f60b 100644 --- a/arch/cris/arch-v10/kernel/time.c +++ b/arch/cris/arch-v10/kernel/time.c | |||
@@ -14,7 +14,6 @@ | |||
14 | #include <linux/sched.h> | 14 | #include <linux/sched.h> |
15 | #include <linux/init.h> | 15 | #include <linux/init.h> |
16 | #include <linux/mm.h> | 16 | #include <linux/mm.h> |
17 | #include <arch/svinto.h> | ||
18 | #include <asm/types.h> | 17 | #include <asm/types.h> |
19 | #include <asm/signal.h> | 18 | #include <asm/signal.h> |
20 | #include <asm/io.h> | 19 | #include <asm/io.h> |
@@ -34,7 +33,7 @@ unsigned long get_ns_in_jiffie(void) | |||
34 | 33 | ||
35 | local_irq_save(flags); | 34 | local_irq_save(flags); |
36 | timer_count = *R_TIMER0_DATA; | 35 | timer_count = *R_TIMER0_DATA; |
37 | presc_count = *R_TIM_PRESC_STATUS; | 36 | presc_count = *R_TIM_PRESC_STATUS; |
38 | /* presc_count might be wrapped */ | 37 | /* presc_count might be wrapped */ |
39 | t1 = *R_TIMER0_DATA; | 38 | t1 = *R_TIMER0_DATA; |
40 | 39 | ||
@@ -50,7 +49,7 @@ unsigned long get_ns_in_jiffie(void) | |||
50 | presc_count = PRESCALE_VALUE - presc_count - PRESCALE_VALUE/2; | 49 | presc_count = PRESCALE_VALUE - presc_count - PRESCALE_VALUE/2; |
51 | } | 50 | } |
52 | 51 | ||
53 | ns = ( (TIMER0_DIV - timer_count) * ((1000000000/HZ)/TIMER0_DIV )) + | 52 | ns = ( (TIMER0_DIV - timer_count) * ((1000000000/HZ)/TIMER0_DIV )) + |
54 | ( (presc_count) * (1000000000/PRESCALE_FREQ)); | 53 | ( (presc_count) * (1000000000/PRESCALE_FREQ)); |
55 | return ns; | 54 | return ns; |
56 | } | 55 | } |
@@ -80,7 +79,7 @@ static u32 cris_v10_gettimeoffset(void) | |||
80 | * by the R_WATCHDOG register. The R_WATCHDOG register contains an enable bit | 79 | * by the R_WATCHDOG register. The R_WATCHDOG register contains an enable bit |
81 | * and a 3-bit key value. The effect of writing to the R_WATCHDOG register is | 80 | * and a 3-bit key value. The effect of writing to the R_WATCHDOG register is |
82 | * described in the table below: | 81 | * described in the table below: |
83 | * | 82 | * |
84 | * Watchdog Value written: | 83 | * Watchdog Value written: |
85 | * state: To enable: To key: Operation: | 84 | * state: To enable: To key: Operation: |
86 | * -------- ---------- ------- ---------- | 85 | * -------- ---------- ------- ---------- |
@@ -89,15 +88,15 @@ static u32 cris_v10_gettimeoffset(void) | |||
89 | * started 0 ~key Stop watchdog | 88 | * started 0 ~key Stop watchdog |
90 | * started 1 ~key Restart watchdog with key = ~key. | 89 | * started 1 ~key Restart watchdog with key = ~key. |
91 | * started X new_key_val Change key to new_key_val. | 90 | * started X new_key_val Change key to new_key_val. |
92 | * | 91 | * |
93 | * Note: '~' is the bitwise NOT operator. | 92 | * Note: '~' is the bitwise NOT operator. |
94 | * | 93 | * |
95 | */ | 94 | */ |
96 | 95 | ||
97 | /* right now, starting the watchdog is the same as resetting it */ | 96 | /* right now, starting the watchdog is the same as resetting it */ |
98 | #define start_watchdog reset_watchdog | 97 | #define start_watchdog reset_watchdog |
99 | 98 | ||
100 | #if defined(CONFIG_ETRAX_WATCHDOG) && !defined(CONFIG_SVINTO_SIM) | 99 | #ifdef CONFIG_ETRAX_WATCHDOG |
101 | static int watchdog_key = 0; /* arbitrary number */ | 100 | static int watchdog_key = 0; /* arbitrary number */ |
102 | #endif | 101 | #endif |
103 | 102 | ||
@@ -107,10 +106,9 @@ static int watchdog_key = 0; /* arbitrary number */ | |||
107 | 106 | ||
108 | #define WATCHDOG_MIN_FREE_PAGES 8 | 107 | #define WATCHDOG_MIN_FREE_PAGES 8 |
109 | 108 | ||
110 | void | 109 | void reset_watchdog(void) |
111 | reset_watchdog(void) | ||
112 | { | 110 | { |
113 | #if defined(CONFIG_ETRAX_WATCHDOG) && !defined(CONFIG_SVINTO_SIM) | 111 | #if defined(CONFIG_ETRAX_WATCHDOG) |
114 | /* only keep watchdog happy as long as we have memory left! */ | 112 | /* only keep watchdog happy as long as we have memory left! */ |
115 | if(nr_free_pages() > WATCHDOG_MIN_FREE_PAGES) { | 113 | if(nr_free_pages() > WATCHDOG_MIN_FREE_PAGES) { |
116 | /* reset the watchdog with the inverse of the old key */ | 114 | /* reset the watchdog with the inverse of the old key */ |
@@ -123,28 +121,23 @@ reset_watchdog(void) | |||
123 | 121 | ||
124 | /* stop the watchdog - we still need the correct key */ | 122 | /* stop the watchdog - we still need the correct key */ |
125 | 123 | ||
126 | void | 124 | void stop_watchdog(void) |
127 | stop_watchdog(void) | ||
128 | { | 125 | { |
129 | #if defined(CONFIG_ETRAX_WATCHDOG) && !defined(CONFIG_SVINTO_SIM) | 126 | #ifdef CONFIG_ETRAX_WATCHDOG |
130 | watchdog_key ^= 0x7; /* invert key, which is 3 bits */ | 127 | watchdog_key ^= 0x7; /* invert key, which is 3 bits */ |
131 | *R_WATCHDOG = IO_FIELD(R_WATCHDOG, key, watchdog_key) | | 128 | *R_WATCHDOG = IO_FIELD(R_WATCHDOG, key, watchdog_key) | |
132 | IO_STATE(R_WATCHDOG, enable, stop); | 129 | IO_STATE(R_WATCHDOG, enable, stop); |
133 | #endif | 130 | #endif |
134 | } | 131 | } |
135 | 132 | ||
136 | 133 | ||
134 | extern void cris_do_profile(struct pt_regs *regs); | ||
135 | |||
137 | /* | 136 | /* |
138 | * timer_interrupt() needs to keep up the real-time clock, | 137 | * timer_interrupt() needs to keep up the real-time clock, |
139 | * as well as call the "xtime_update()" routine every clocktick | 138 | * as well as call the "xtime_update()" routine every clocktick |
140 | */ | 139 | */ |
141 | 140 | static inline irqreturn_t timer_interrupt(int irq, void *dev_id) | |
142 | //static unsigned short myjiff; /* used by our debug routine print_timestamp */ | ||
143 | |||
144 | extern void cris_do_profile(struct pt_regs *regs); | ||
145 | |||
146 | static inline irqreturn_t | ||
147 | timer_interrupt(int irq, void *dev_id) | ||
148 | { | 141 | { |
149 | struct pt_regs *regs = get_irq_regs(); | 142 | struct pt_regs *regs = get_irq_regs(); |
150 | /* acknowledge the timer irq */ | 143 | /* acknowledge the timer irq */ |
@@ -160,44 +153,39 @@ timer_interrupt(int irq, void *dev_id) | |||
160 | IO_STATE( R_TIMER_CTRL, tm0, run) | | 153 | IO_STATE( R_TIMER_CTRL, tm0, run) | |
161 | IO_STATE( R_TIMER_CTRL, clksel0, c6250kHz); | 154 | IO_STATE( R_TIMER_CTRL, clksel0, c6250kHz); |
162 | #else | 155 | #else |
163 | *R_TIMER_CTRL = r_timer_ctrl_shadow | | 156 | *R_TIMER_CTRL = r_timer_ctrl_shadow | IO_STATE(R_TIMER_CTRL, i0, clr); |
164 | IO_STATE(R_TIMER_CTRL, i0, clr); | ||
165 | #endif | 157 | #endif |
166 | 158 | ||
167 | /* reset watchdog otherwise it resets us! */ | 159 | /* reset watchdog otherwise it resets us! */ |
168 | reset_watchdog(); | 160 | reset_watchdog(); |
169 | 161 | ||
170 | /* Update statistics. */ | 162 | /* Update statistics. */ |
171 | update_process_times(user_mode(regs)); | 163 | update_process_times(user_mode(regs)); |
172 | 164 | ||
173 | /* call the real timer interrupt handler */ | 165 | /* call the real timer interrupt handler */ |
174 | |||
175 | xtime_update(1); | 166 | xtime_update(1); |
176 | 167 | ||
177 | cris_do_profile(regs); /* Save profiling information */ | 168 | cris_do_profile(regs); /* Save profiling information */ |
178 | return IRQ_HANDLED; | 169 | return IRQ_HANDLED; |
179 | } | 170 | } |
180 | 171 | ||
181 | /* timer is IRQF_SHARED so drivers can add stuff to the timer irq chain | 172 | /* timer is IRQF_SHARED so drivers can add stuff to the timer irq chain */ |
182 | * it needs to be IRQF_DISABLED to make the jiffies update work properly | ||
183 | */ | ||
184 | 173 | ||
185 | static struct irqaction irq2 = { | 174 | static struct irqaction irq2 = { |
186 | .handler = timer_interrupt, | 175 | .handler = timer_interrupt, |
187 | .flags = IRQF_SHARED | IRQF_DISABLED, | 176 | .flags = IRQF_SHARED, |
188 | .name = "timer", | 177 | .name = "timer", |
189 | }; | 178 | }; |
190 | 179 | ||
191 | void __init | 180 | void __init time_init(void) |
192 | time_init(void) | 181 | { |
193 | { | ||
194 | arch_gettimeoffset = cris_v10_gettimeoffset; | 182 | arch_gettimeoffset = cris_v10_gettimeoffset; |
195 | 183 | ||
196 | /* probe for the RTC and read it if it exists | 184 | /* probe for the RTC and read it if it exists |
197 | * Before the RTC can be probed the loops_per_usec variable needs | 185 | * Before the RTC can be probed the loops_per_usec variable needs |
198 | * to be initialized to make usleep work. A better value for | 186 | * to be initialized to make usleep work. A better value for |
199 | * loops_per_usec is calculated by the kernel later once the | 187 | * loops_per_usec is calculated by the kernel later once the |
200 | * clock has started. | 188 | * clock has started. |
201 | */ | 189 | */ |
202 | loops_per_usec = 50; | 190 | loops_per_usec = 50; |
203 | 191 | ||
@@ -208,7 +196,7 @@ time_init(void) | |||
208 | * Remember that linux/timex.h contains #defines that rely on the | 196 | * Remember that linux/timex.h contains #defines that rely on the |
209 | * timer settings below (hz and divide factor) !!! | 197 | * timer settings below (hz and divide factor) !!! |
210 | */ | 198 | */ |
211 | 199 | ||
212 | #ifdef USE_CASCADE_TIMERS | 200 | #ifdef USE_CASCADE_TIMERS |
213 | *R_TIMER_CTRL = | 201 | *R_TIMER_CTRL = |
214 | IO_FIELD( R_TIMER_CTRL, timerdiv1, 0) | | 202 | IO_FIELD( R_TIMER_CTRL, timerdiv1, 0) | |
@@ -219,8 +207,8 @@ time_init(void) | |||
219 | IO_STATE( R_TIMER_CTRL, i0, nop) | | 207 | IO_STATE( R_TIMER_CTRL, i0, nop) | |
220 | IO_STATE( R_TIMER_CTRL, tm0, stop_ld) | | 208 | IO_STATE( R_TIMER_CTRL, tm0, stop_ld) | |
221 | IO_STATE( R_TIMER_CTRL, clksel0, c6250kHz); | 209 | IO_STATE( R_TIMER_CTRL, clksel0, c6250kHz); |
222 | 210 | ||
223 | *R_TIMER_CTRL = r_timer_ctrl_shadow = | 211 | *R_TIMER_CTRL = r_timer_ctrl_shadow = |
224 | IO_FIELD( R_TIMER_CTRL, timerdiv1, 0) | | 212 | IO_FIELD( R_TIMER_CTRL, timerdiv1, 0) | |
225 | IO_FIELD( R_TIMER_CTRL, timerdiv0, 0) | | 213 | IO_FIELD( R_TIMER_CTRL, timerdiv0, 0) | |
226 | IO_STATE( R_TIMER_CTRL, i1, nop) | | 214 | IO_STATE( R_TIMER_CTRL, i1, nop) | |
@@ -230,18 +218,18 @@ time_init(void) | |||
230 | IO_STATE( R_TIMER_CTRL, tm0, run) | | 218 | IO_STATE( R_TIMER_CTRL, tm0, run) | |
231 | IO_STATE( R_TIMER_CTRL, clksel0, c6250kHz); | 219 | IO_STATE( R_TIMER_CTRL, clksel0, c6250kHz); |
232 | #else | 220 | #else |
233 | *R_TIMER_CTRL = | 221 | *R_TIMER_CTRL = |
234 | IO_FIELD(R_TIMER_CTRL, timerdiv1, 192) | | 222 | IO_FIELD(R_TIMER_CTRL, timerdiv1, 192) | |
235 | IO_FIELD(R_TIMER_CTRL, timerdiv0, TIMER0_DIV) | | 223 | IO_FIELD(R_TIMER_CTRL, timerdiv0, TIMER0_DIV) | |
236 | IO_STATE(R_TIMER_CTRL, i1, nop) | | 224 | IO_STATE(R_TIMER_CTRL, i1, nop) | |
237 | IO_STATE(R_TIMER_CTRL, tm1, stop_ld) | | 225 | IO_STATE(R_TIMER_CTRL, tm1, stop_ld) | |
238 | IO_STATE(R_TIMER_CTRL, clksel1, c19k2Hz) | | 226 | IO_STATE(R_TIMER_CTRL, clksel1, c19k2Hz) | |
239 | IO_STATE(R_TIMER_CTRL, i0, nop) | | 227 | IO_STATE(R_TIMER_CTRL, i0, nop) | |
240 | IO_STATE(R_TIMER_CTRL, tm0, stop_ld) | | 228 | IO_STATE(R_TIMER_CTRL, tm0, stop_ld) | |
241 | IO_STATE(R_TIMER_CTRL, clksel0, flexible); | 229 | IO_STATE(R_TIMER_CTRL, clksel0, flexible); |
242 | 230 | ||
243 | *R_TIMER_CTRL = r_timer_ctrl_shadow = | 231 | *R_TIMER_CTRL = r_timer_ctrl_shadow = |
244 | IO_FIELD(R_TIMER_CTRL, timerdiv1, 192) | | 232 | IO_FIELD(R_TIMER_CTRL, timerdiv1, 192) | |
245 | IO_FIELD(R_TIMER_CTRL, timerdiv0, TIMER0_DIV) | | 233 | IO_FIELD(R_TIMER_CTRL, timerdiv0, TIMER0_DIV) | |
246 | IO_STATE(R_TIMER_CTRL, i1, nop) | | 234 | IO_STATE(R_TIMER_CTRL, i1, nop) | |
247 | IO_STATE(R_TIMER_CTRL, tm1, run) | | 235 | IO_STATE(R_TIMER_CTRL, tm1, run) | |
@@ -253,16 +241,14 @@ time_init(void) | |||
253 | *R_TIMER_PRESCALE = PRESCALE_VALUE; | 241 | *R_TIMER_PRESCALE = PRESCALE_VALUE; |
254 | #endif | 242 | #endif |
255 | 243 | ||
256 | *R_IRQ_MASK0_SET = | 244 | /* unmask the timer irq */ |
257 | IO_STATE(R_IRQ_MASK0_SET, timer0, set); /* unmask the timer irq */ | 245 | *R_IRQ_MASK0_SET = IO_STATE(R_IRQ_MASK0_SET, timer0, set); |
258 | 246 | ||
259 | /* now actually register the timer irq handler that calls timer_interrupt() */ | 247 | /* now actually register the irq handler that calls timer_interrupt() */ |
260 | |||
261 | setup_irq(2, &irq2); /* irq 2 is the timer0 irq in etrax */ | 248 | setup_irq(2, &irq2); /* irq 2 is the timer0 irq in etrax */ |
262 | 249 | ||
263 | /* enable watchdog if we should use one */ | 250 | /* enable watchdog if we should use one */ |
264 | 251 | #if defined(CONFIG_ETRAX_WATCHDOG) | |
265 | #if defined(CONFIG_ETRAX_WATCHDOG) && !defined(CONFIG_SVINTO_SIM) | ||
266 | printk("Enabling watchdog...\n"); | 252 | printk("Enabling watchdog...\n"); |
267 | start_watchdog(); | 253 | start_watchdog(); |
268 | 254 | ||
@@ -275,9 +261,7 @@ time_init(void) | |||
275 | driver or infrastructure support yet. */ | 261 | driver or infrastructure support yet. */ |
276 | asm ("setf m"); | 262 | asm ("setf m"); |
277 | 263 | ||
278 | *R_IRQ_MASK0_SET = | 264 | *R_IRQ_MASK0_SET = IO_STATE(R_IRQ_MASK0_SET, watchdog_nmi, set); |
279 | IO_STATE(R_IRQ_MASK0_SET, watchdog_nmi, set); | 265 | *R_VECT_MASK_SET = IO_STATE(R_VECT_MASK_SET, nmi, set); |
280 | *R_VECT_MASK_SET = | ||
281 | IO_STATE(R_VECT_MASK_SET, nmi, set); | ||
282 | #endif | 266 | #endif |
283 | } | 267 | } |
diff --git a/arch/cris/arch-v10/lib/dram_init.S b/arch/cris/arch-v10/lib/dram_init.S index b9190ff7d0a4..e541d3d8f922 100644 --- a/arch/cris/arch-v10/lib/dram_init.S +++ b/arch/cris/arch-v10/lib/dram_init.S | |||
@@ -5,9 +5,7 @@ | |||
5 | * Note: This file may not modify r9 because r9 is used to carry | 5 | * Note: This file may not modify r9 because r9 is used to carry |
6 | * information from the decompresser to the kernel | 6 | * information from the decompresser to the kernel |
7 | * | 7 | * |
8 | * Copyright (C) 2000, 2001 Axis Communications AB | 8 | * Copyright (C) 2000-2012 Axis Communications AB |
9 | * | ||
10 | * Authors: Mikael Starvik (starvik@axis.com) | ||
11 | * | 9 | * |
12 | */ | 10 | */ |
13 | 11 | ||
@@ -18,16 +16,15 @@ | |||
18 | 16 | ||
19 | 17 | ||
20 | ;; WARNING! The registers r8 and r9 are used as parameters carrying | 18 | ;; WARNING! The registers r8 and r9 are used as parameters carrying |
21 | ;; information from the decompressor (if the kernel was compressed). | 19 | ;; information from the decompressor (if the kernel was compressed). |
22 | ;; They should not be used in the code below. | 20 | ;; They should not be used in the code below. |
23 | 21 | ||
24 | #ifndef CONFIG_SVINTO_SIM | ||
25 | move.d CONFIG_ETRAX_DEF_R_WAITSTATES, $r0 | 22 | move.d CONFIG_ETRAX_DEF_R_WAITSTATES, $r0 |
26 | move.d $r0, [R_WAITSTATES] | 23 | move.d $r0, [R_WAITSTATES] |
27 | 24 | ||
28 | move.d CONFIG_ETRAX_DEF_R_BUS_CONFIG, $r0 | 25 | move.d CONFIG_ETRAX_DEF_R_BUS_CONFIG, $r0 |
29 | move.d $r0, [R_BUS_CONFIG] | 26 | move.d $r0, [R_BUS_CONFIG] |
30 | 27 | ||
31 | #ifndef CONFIG_ETRAX_SDRAM | 28 | #ifndef CONFIG_ETRAX_SDRAM |
32 | move.d CONFIG_ETRAX_DEF_R_DRAM_CONFIG, $r0 | 29 | move.d CONFIG_ETRAX_DEF_R_DRAM_CONFIG, $r0 |
33 | move.d $r0, [R_DRAM_CONFIG] | 30 | move.d $r0, [R_DRAM_CONFIG] |
@@ -38,14 +35,14 @@ | |||
38 | ;; Samsung SDRAMs seem to require to be initialized twice to work properly. | 35 | ;; Samsung SDRAMs seem to require to be initialized twice to work properly. |
39 | moveq 2, $r6 | 36 | moveq 2, $r6 |
40 | _sdram_init: | 37 | _sdram_init: |
41 | 38 | ||
42 | ; Refer to ETRAX 100LX Designers Reference for a description of SDRAM initialization | 39 | ; Refer to ETRAX 100LX Designers Reference for a description of SDRAM initialization |
43 | 40 | ||
44 | ; Bank configuration | 41 | ; Bank configuration |
45 | move.d CONFIG_ETRAX_DEF_R_SDRAM_CONFIG, $r0 | 42 | move.d CONFIG_ETRAX_DEF_R_SDRAM_CONFIG, $r0 |
46 | move.d $r0, [R_SDRAM_CONFIG] | 43 | move.d $r0, [R_SDRAM_CONFIG] |
47 | 44 | ||
48 | ; Calculate value of mrs_data | 45 | ; Calculate value of mrs_data |
49 | ; CAS latency = 2 && bus_width = 32 => 0x40 | 46 | ; CAS latency = 2 && bus_width = 32 => 0x40 |
50 | ; CAS latency = 3 && bus_width = 32 => 0x60 | 47 | ; CAS latency = 3 && bus_width = 32 => 0x60 |
51 | ; CAS latency = 2 && bus_width = 16 => 0x20 | 48 | ; CAS latency = 2 && bus_width = 16 => 0x20 |
@@ -56,22 +53,22 @@ _sdram_init: | |||
56 | and.d 0x00ff0000, $r2 | 53 | and.d 0x00ff0000, $r2 |
57 | bne _set_timing | 54 | bne _set_timing |
58 | lsrq 16, $r2 | 55 | lsrq 16, $r2 |
59 | 56 | ||
60 | move.d 0x40, $r2 ; Assume 32 bits and CAS latency = 2 | 57 | move.d 0x40, $r2 ; Assume 32 bits and CAS latency = 2 |
61 | move.d CONFIG_ETRAX_DEF_R_SDRAM_TIMING, $r1 | 58 | move.d CONFIG_ETRAX_DEF_R_SDRAM_TIMING, $r1 |
62 | move.d $r1, $r3 | 59 | move.d $r1, $r3 |
63 | and.d 0x03, $r1 ; Get CAS latency | 60 | and.d 0x03, $r1 ; Get CAS latency |
64 | and.d 0x1000, $r3 ; 50 or 100 MHz? | 61 | and.d 0x1000, $r3 ; 50 or 100 MHz? |
65 | beq _speed_50 | 62 | beq _speed_50 |
66 | nop | 63 | nop |
67 | _speed_100: | 64 | _speed_100: |
68 | cmp.d 0x00, $r1 ; CAS latency = 2? | 65 | cmp.d 0x00, $r1 ; CAS latency = 2? |
69 | beq _bw_check | 66 | beq _bw_check |
70 | nop | 67 | nop |
71 | or.d 0x20, $r2 ; CAS latency = 3 | 68 | or.d 0x20, $r2 ; CAS latency = 3 |
72 | ba _bw_check | 69 | ba _bw_check |
73 | nop | 70 | nop |
74 | _speed_50: | 71 | _speed_50: |
75 | cmp.d 0x01, $r1 ; CAS latency = 2? | 72 | cmp.d 0x01, $r1 ; CAS latency = 2? |
76 | beq _bw_check | 73 | beq _bw_check |
77 | nop | 74 | nop |
@@ -86,19 +83,19 @@ _bw_check: | |||
86 | ; Set timing parameters. Starts master clock | 83 | ; Set timing parameters. Starts master clock |
87 | _set_timing: | 84 | _set_timing: |
88 | move.d CONFIG_ETRAX_DEF_R_SDRAM_TIMING, $r1 | 85 | move.d CONFIG_ETRAX_DEF_R_SDRAM_TIMING, $r1 |
89 | and.d 0x8000f9ff, $r1 ; Make sure mrs data and command is 0 | 86 | and.d 0x8000f9ff, $r1 ; Make sure mrs data and command is 0 |
90 | or.d 0x80000000, $r1 ; Make sure sdram enable bit is set | 87 | or.d 0x80000000, $r1 ; Make sure sdram enable bit is set |
91 | move.d $r1, $r5 | 88 | move.d $r1, $r5 |
92 | or.d 0x0000c000, $r1 ; ref = disable | 89 | or.d 0x0000c000, $r1 ; ref = disable |
93 | lslq 16, $r2 ; mrs data starts at bit 16 | 90 | lslq 16, $r2 ; mrs data starts at bit 16 |
94 | or.d $r2, $r1 | 91 | or.d $r2, $r1 |
95 | move.d $r1, [R_SDRAM_TIMING] | 92 | move.d $r1, [R_SDRAM_TIMING] |
96 | 93 | ||
97 | ; Wait 200us | 94 | ; Wait 200us |
98 | move.d 10000, $r2 | 95 | move.d 10000, $r2 |
99 | 1: bne 1b | 96 | 1: bne 1b |
100 | subq 1, $r2 | 97 | subq 1, $r2 |
101 | 98 | ||
102 | ; Issue initialization command sequence | 99 | ; Issue initialization command sequence |
103 | move.d _sdram_commands_start, $r2 | 100 | move.d _sdram_commands_start, $r2 |
104 | and.d 0x000fffff, $r2 ; Make sure commands are read from flash | 101 | and.d 0x000fffff, $r2 ; Make sure commands are read from flash |
@@ -144,7 +141,6 @@ _sdram_commands_start: | |||
144 | .byte 2 ; refresh | 141 | .byte 2 ; refresh |
145 | .byte 0 ; nop | 142 | .byte 0 ; nop |
146 | .byte 1 ; mrs | 143 | .byte 1 ; mrs |
147 | .byte 0 ; nop | 144 | .byte 0 ; nop |
148 | _sdram_commands_end: | 145 | _sdram_commands_end: |
149 | #endif | ||
150 | #endif | 146 | #endif |
diff --git a/arch/cris/arch-v32/drivers/mach-a3/gpio.c b/arch/cris/arch-v32/drivers/mach-a3/gpio.c index 0b86deedacb9..74f9fe80940c 100644 --- a/arch/cris/arch-v32/drivers/mach-a3/gpio.c +++ b/arch/cris/arch-v32/drivers/mach-a3/gpio.c | |||
@@ -978,7 +978,7 @@ static int __init gpio_init(void) | |||
978 | CRIS_LED_DISK_WRITE(0); | 978 | CRIS_LED_DISK_WRITE(0); |
979 | 979 | ||
980 | int res2 = request_irq(GIO_INTR_VECT, gpio_interrupt, | 980 | int res2 = request_irq(GIO_INTR_VECT, gpio_interrupt, |
981 | IRQF_SHARED | IRQF_DISABLED, "gpio", &alarmlist); | 981 | IRQF_SHARED, "gpio", &alarmlist); |
982 | if (res2) { | 982 | if (res2) { |
983 | printk(KERN_ERR "err: irq for gpio\n"); | 983 | printk(KERN_ERR "err: irq for gpio\n"); |
984 | return res2; | 984 | return res2; |
diff --git a/arch/cris/arch-v32/drivers/mach-fs/gpio.c b/arch/cris/arch-v32/drivers/mach-fs/gpio.c index a2ac0917f1a6..9e54273af0ca 100644 --- a/arch/cris/arch-v32/drivers/mach-fs/gpio.c +++ b/arch/cris/arch-v32/drivers/mach-fs/gpio.c | |||
@@ -964,11 +964,11 @@ gpio_init(void) | |||
964 | * in some tests. | 964 | * in some tests. |
965 | */ | 965 | */ |
966 | if (request_irq(TIMER0_INTR_VECT, gpio_poll_timer_interrupt, | 966 | if (request_irq(TIMER0_INTR_VECT, gpio_poll_timer_interrupt, |
967 | IRQF_SHARED | IRQF_DISABLED, "gpio poll", &alarmlist)) | 967 | IRQF_SHARED, "gpio poll", &alarmlist)) |
968 | printk(KERN_ERR "timer0 irq for gpio\n"); | 968 | printk(KERN_ERR "timer0 irq for gpio\n"); |
969 | 969 | ||
970 | if (request_irq(GIO_INTR_VECT, gpio_pa_interrupt, | 970 | if (request_irq(GIO_INTR_VECT, gpio_pa_interrupt, |
971 | IRQF_SHARED | IRQF_DISABLED, "gpio PA", &alarmlist)) | 971 | IRQF_SHARED, "gpio PA", &alarmlist)) |
972 | printk(KERN_ERR "PA irq for gpio\n"); | 972 | printk(KERN_ERR "PA irq for gpio\n"); |
973 | 973 | ||
974 | #ifdef CONFIG_ETRAX_VIRTUAL_GPIO | 974 | #ifdef CONFIG_ETRAX_VIRTUAL_GPIO |
diff --git a/arch/cris/arch-v32/drivers/sync_serial.c b/arch/cris/arch-v32/drivers/sync_serial.c index 219f704e3221..bbb806b68838 100644 --- a/arch/cris/arch-v32/drivers/sync_serial.c +++ b/arch/cris/arch-v32/drivers/sync_serial.c | |||
@@ -19,6 +19,7 @@ | |||
19 | #include <linux/init.h> | 19 | #include <linux/init.h> |
20 | #include <linux/timer.h> | 20 | #include <linux/timer.h> |
21 | #include <linux/spinlock.h> | 21 | #include <linux/spinlock.h> |
22 | #include <linux/wait.h> | ||
22 | 23 | ||
23 | #include <asm/io.h> | 24 | #include <asm/io.h> |
24 | #include <dma.h> | 25 | #include <dma.h> |
@@ -1144,7 +1145,8 @@ static ssize_t sync_serial_read(struct file * file, char * buf, | |||
1144 | if (file->f_flags & O_NONBLOCK) | 1145 | if (file->f_flags & O_NONBLOCK) |
1145 | return -EAGAIN; | 1146 | return -EAGAIN; |
1146 | 1147 | ||
1147 | interruptible_sleep_on(&port->in_wait_q); | 1148 | wait_event_interruptible(port->in_wait_q, |
1149 | !(start == end && !port->full)); | ||
1148 | if (signal_pending(current)) | 1150 | if (signal_pending(current)) |
1149 | return -EINTR; | 1151 | return -EINTR; |
1150 | 1152 | ||
diff --git a/arch/cris/arch-v32/kernel/entry.S b/arch/cris/arch-v32/kernel/entry.S index faa644111feb..2f19ac6217aa 100644 --- a/arch/cris/arch-v32/kernel/entry.S +++ b/arch/cris/arch-v32/kernel/entry.S | |||
@@ -424,7 +424,7 @@ nmi_interrupt: | |||
424 | bpl 1f | 424 | bpl 1f |
425 | nop | 425 | nop |
426 | jsr handle_watchdog_bite ; In time.c. | 426 | jsr handle_watchdog_bite ; In time.c. |
427 | move.d $sp, $r10 ; Pointer to registers | 427 | move.d $sp, $r10 ; Pointer to registers |
428 | 1: btstq REG_BIT(intr_vect, r_nmi, ext), $r0 | 428 | 1: btstq REG_BIT(intr_vect, r_nmi, ext), $r0 |
429 | bpl 1f | 429 | bpl 1f |
430 | nop | 430 | nop |
@@ -452,7 +452,7 @@ spurious_interrupt: | |||
452 | nop | 452 | nop |
453 | 453 | ||
454 | ;; This handles the case when multiple interrupts arrive at the same | 454 | ;; This handles the case when multiple interrupts arrive at the same |
455 | ;; time. Jump to the first set interrupt bit in a priotiry fashion. The | 455 | ;; time. Jump to the first set interrupt bit in a priority fashion. The |
456 | ;; hardware will call the unserved interrupts after the handler | 456 | ;; hardware will call the unserved interrupts after the handler |
457 | ;; finishes. | 457 | ;; finishes. |
458 | .type multiple_interrupt, @function | 458 | .type multiple_interrupt, @function |
@@ -885,13 +885,29 @@ sys_call_table: | |||
885 | .long sys_preadv | 885 | .long sys_preadv |
886 | .long sys_pwritev | 886 | .long sys_pwritev |
887 | .long sys_setns /* 335 */ | 887 | .long sys_setns /* 335 */ |
888 | 888 | .long sys_name_to_handle_at | |
889 | /* | 889 | .long sys_open_by_handle_at |
890 | * NOTE!! This doesn't have to be exact - we just have | 890 | .long sys_rt_tgsigqueueinfo |
891 | * to make sure we have _enough_ of the "sys_ni_syscall" | 891 | .long sys_perf_event_open |
892 | * entries. Don't panic if you notice that this hasn't | 892 | .long sys_recvmmsg /* 340 */ |
893 | * been shrunk every time we add a new system call. | 893 | .long sys_accept4 |
894 | */ | 894 | .long sys_fanotify_init |
895 | .long sys_fanotify_mark | ||
896 | .long sys_prlimit64 | ||
897 | .long sys_clock_adjtime /* 345 */ | ||
898 | .long sys_syncfs | ||
899 | .long sys_sendmmsg | ||
900 | .long sys_process_vm_readv | ||
901 | .long sys_process_vm_writev | ||
902 | .long sys_kcmp /* 350 */ | ||
903 | .long sys_finit_module | ||
904 | |||
905 | /* | ||
906 | * NOTE!! This doesn't have to be exact - we just have | ||
907 | * to make sure we have _enough_ of the "sys_ni_syscall" | ||
908 | * entries. Don't panic if you notice that this hasn't | ||
909 | * been shrunk every time we add a new system call. | ||
910 | */ | ||
895 | 911 | ||
896 | .rept NR_syscalls - (.-sys_call_table) / 4 | 912 | .rept NR_syscalls - (.-sys_call_table) / 4 |
897 | .long sys_ni_syscall | 913 | .long sys_ni_syscall |
diff --git a/arch/cris/arch-v32/kernel/fasttimer.c b/arch/cris/arch-v32/kernel/fasttimer.c index f6644535b17e..b130c2c5fdd8 100644 --- a/arch/cris/arch-v32/kernel/fasttimer.c +++ b/arch/cris/arch-v32/kernel/fasttimer.c | |||
@@ -786,7 +786,7 @@ int fast_timer_init(void) | |||
786 | proc_create("fasttimer", 0, NULL, &proc_fasttimer_fops); | 786 | proc_create("fasttimer", 0, NULL, &proc_fasttimer_fops); |
787 | #endif /* PROC_FS */ | 787 | #endif /* PROC_FS */ |
788 | if (request_irq(TIMER0_INTR_VECT, timer_trig_interrupt, | 788 | if (request_irq(TIMER0_INTR_VECT, timer_trig_interrupt, |
789 | IRQF_SHARED | IRQF_DISABLED, | 789 | IRQF_SHARED, |
790 | "fast timer int", &fast_timer_list)) | 790 | "fast timer int", &fast_timer_list)) |
791 | printk(KERN_ERR "err: fasttimer irq\n"); | 791 | printk(KERN_ERR "err: fasttimer irq\n"); |
792 | fast_timer_is_init = 1; | 792 | fast_timer_is_init = 1; |
diff --git a/arch/cris/arch-v32/kernel/irq.c b/arch/cris/arch-v32/kernel/irq.c index 5ebe6e841820..25437ae28128 100644 --- a/arch/cris/arch-v32/kernel/irq.c +++ b/arch/cris/arch-v32/kernel/irq.c | |||
@@ -331,11 +331,11 @@ extern void do_IRQ(int irq, struct pt_regs * regs); | |||
331 | void | 331 | void |
332 | crisv32_do_IRQ(int irq, int block, struct pt_regs* regs) | 332 | crisv32_do_IRQ(int irq, int block, struct pt_regs* regs) |
333 | { | 333 | { |
334 | /* Interrupts that may not be moved to another CPU and | 334 | /* Interrupts that may not be moved to another CPU may |
335 | * are IRQF_DISABLED may skip blocking. This is currently | 335 | * skip blocking. This is currently only valid for the |
336 | * only valid for the timer IRQ and the IPI and is used | 336 | * timer IRQ and the IPI and is used for the timer |
337 | * for the timer interrupt to avoid watchdog starvation. | 337 | * interrupt to avoid watchdog starvation. |
338 | */ | 338 | */ |
339 | if (!block) { | 339 | if (!block) { |
340 | do_IRQ(irq, regs); | 340 | do_IRQ(irq, regs); |
341 | return; | 341 | return; |
diff --git a/arch/cris/arch-v32/kernel/smp.c b/arch/cris/arch-v32/kernel/smp.c index fe8e6039db2a..0698582467ca 100644 --- a/arch/cris/arch-v32/kernel/smp.c +++ b/arch/cris/arch-v32/kernel/smp.c | |||
@@ -64,7 +64,7 @@ static irqreturn_t crisv32_ipi_interrupt(int irq, void *dev_id); | |||
64 | static int send_ipi(int vector, int wait, cpumask_t cpu_mask); | 64 | static int send_ipi(int vector, int wait, cpumask_t cpu_mask); |
65 | static struct irqaction irq_ipi = { | 65 | static struct irqaction irq_ipi = { |
66 | .handler = crisv32_ipi_interrupt, | 66 | .handler = crisv32_ipi_interrupt, |
67 | .flags = IRQF_DISABLED, | 67 | .flags = 0, |
68 | .name = "ipi", | 68 | .name = "ipi", |
69 | }; | 69 | }; |
70 | 70 | ||
diff --git a/arch/cris/arch-v32/kernel/time.c b/arch/cris/arch-v32/kernel/time.c index 8c4b45efd7b6..ee66866538f8 100644 --- a/arch/cris/arch-v32/kernel/time.c +++ b/arch/cris/arch-v32/kernel/time.c | |||
@@ -216,12 +216,10 @@ static inline irqreturn_t timer_interrupt(int irq, void *dev_id) | |||
216 | return IRQ_HANDLED; | 216 | return IRQ_HANDLED; |
217 | } | 217 | } |
218 | 218 | ||
219 | /* Timer is IRQF_SHARED so drivers can add stuff to the timer irq chain. | 219 | /* Timer is IRQF_SHARED so drivers can add stuff to the timer irq chain. */ |
220 | * It needs to be IRQF_DISABLED to make the jiffies update work properly. | ||
221 | */ | ||
222 | static struct irqaction irq_timer = { | 220 | static struct irqaction irq_timer = { |
223 | .handler = timer_interrupt, | 221 | .handler = timer_interrupt, |
224 | .flags = IRQF_SHARED | IRQF_DISABLED, | 222 | .flags = IRQF_SHARED, |
225 | .name = "timer" | 223 | .name = "timer" |
226 | }; | 224 | }; |
227 | 225 | ||
diff --git a/arch/cris/arch-v32/mach-a3/arbiter.c b/arch/cris/arch-v32/mach-a3/arbiter.c index 15f5c9de2639..ab5c421a4de8 100644 --- a/arch/cris/arch-v32/mach-a3/arbiter.c +++ b/arch/cris/arch-v32/mach-a3/arbiter.c | |||
@@ -256,11 +256,11 @@ static void crisv32_arbiter_init(void) | |||
256 | crisv32_arbiter_config(1, EXT_REGION, 0); | 256 | crisv32_arbiter_config(1, EXT_REGION, 0); |
257 | 257 | ||
258 | if (request_irq(MEMARB_FOO_INTR_VECT, crisv32_foo_arbiter_irq, | 258 | if (request_irq(MEMARB_FOO_INTR_VECT, crisv32_foo_arbiter_irq, |
259 | IRQF_DISABLED, "arbiter", NULL)) | 259 | 0, "arbiter", NULL)) |
260 | printk(KERN_ERR "Couldn't allocate arbiter IRQ\n"); | 260 | printk(KERN_ERR "Couldn't allocate arbiter IRQ\n"); |
261 | 261 | ||
262 | if (request_irq(MEMARB_BAR_INTR_VECT, crisv32_bar_arbiter_irq, | 262 | if (request_irq(MEMARB_BAR_INTR_VECT, crisv32_bar_arbiter_irq, |
263 | IRQF_DISABLED, "arbiter", NULL)) | 263 | 0, "arbiter", NULL)) |
264 | printk(KERN_ERR "Couldn't allocate arbiter IRQ\n"); | 264 | printk(KERN_ERR "Couldn't allocate arbiter IRQ\n"); |
265 | 265 | ||
266 | #ifndef CONFIG_ETRAX_KGDB | 266 | #ifndef CONFIG_ETRAX_KGDB |
diff --git a/arch/cris/arch-v32/mach-fs/arbiter.c b/arch/cris/arch-v32/mach-fs/arbiter.c index 3f8ebb5c1477..c97f4d8120f9 100644 --- a/arch/cris/arch-v32/mach-fs/arbiter.c +++ b/arch/cris/arch-v32/mach-fs/arbiter.c | |||
@@ -184,7 +184,7 @@ static void crisv32_arbiter_init(void) | |||
184 | crisv32_arbiter_config(EXT_REGION, 0); | 184 | crisv32_arbiter_config(EXT_REGION, 0); |
185 | crisv32_arbiter_config(INT_REGION, 0); | 185 | crisv32_arbiter_config(INT_REGION, 0); |
186 | 186 | ||
187 | if (request_irq(MEMARB_INTR_VECT, crisv32_arbiter_irq, IRQF_DISABLED, | 187 | if (request_irq(MEMARB_INTR_VECT, crisv32_arbiter_irq, 0, |
188 | "arbiter", NULL)) | 188 | "arbiter", NULL)) |
189 | printk(KERN_ERR "Couldn't allocate arbiter IRQ\n"); | 189 | printk(KERN_ERR "Couldn't allocate arbiter IRQ\n"); |
190 | 190 | ||
diff --git a/arch/cris/boot/rescue/kimagerescue.S b/arch/cris/boot/rescue/kimagerescue.S index 6f7b3e61260b..655b511fecf3 100644 --- a/arch/cris/boot/rescue/kimagerescue.S +++ b/arch/cris/boot/rescue/kimagerescue.S | |||
@@ -50,7 +50,6 @@ | |||
50 | 50 | ||
51 | nop | 51 | nop |
52 | di | 52 | di |
53 | #ifndef CONFIG_SVINTO_SIM | ||
54 | ;; setup port PA and PB default initial directions and data | 53 | ;; setup port PA and PB default initial directions and data |
55 | ;; (so we can flash LEDs, and so that DTR and others are set) | 54 | ;; (so we can flash LEDs, and so that DTR and others are set) |
56 | 55 | ||
@@ -67,7 +66,6 @@ | |||
67 | ;; We need to setup the bus registers before we start using the DRAM | 66 | ;; We need to setup the bus registers before we start using the DRAM |
68 | #include "../../lib/dram_init.S" | 67 | #include "../../lib/dram_init.S" |
69 | 68 | ||
70 | #endif | ||
71 | ;; Setup the stack to a suitably high address. | 69 | ;; Setup the stack to a suitably high address. |
72 | ;; We assume 8 MB is the minimum DRAM in an eLinux | 70 | ;; We assume 8 MB is the minimum DRAM in an eLinux |
73 | ;; product and put the sp at the top for now. | 71 | ;; product and put the sp at the top for now. |
diff --git a/arch/cris/include/arch-v10/arch/io.h b/arch/cris/include/arch-v10/arch/io.h index f627ad0b8a3d..4a724172877f 100644 --- a/arch/cris/include/arch-v10/arch/io.h +++ b/arch/cris/include/arch-v10/arch/io.h | |||
@@ -1,8 +1,6 @@ | |||
1 | #ifndef _ASM_ARCH_CRIS_IO_H | 1 | #ifndef _ASM_ARCH_CRIS_IO_H |
2 | #define _ASM_ARCH_CRIS_IO_H | 2 | #define _ASM_ARCH_CRIS_IO_H |
3 | 3 | ||
4 | #include <arch/svinto.h> | ||
5 | |||
6 | /* Etrax shadow registers - which live in arch/cris/kernel/shadows.c */ | 4 | /* Etrax shadow registers - which live in arch/cris/kernel/shadows.c */ |
7 | 5 | ||
8 | extern unsigned long gen_config_ii_shadow; | 6 | extern unsigned long gen_config_ii_shadow; |
@@ -34,7 +32,7 @@ extern volatile unsigned long *port_csp4_addr; | |||
34 | 32 | ||
35 | /* The LED's on various Etrax-based products are set differently. */ | 33 | /* The LED's on various Etrax-based products are set differently. */ |
36 | 34 | ||
37 | #if defined(CONFIG_ETRAX_NO_LEDS) || defined(CONFIG_SVINTO_SIM) | 35 | #if defined(CONFIG_ETRAX_NO_LEDS) |
38 | #undef CONFIG_ETRAX_PA_LEDS | 36 | #undef CONFIG_ETRAX_PA_LEDS |
39 | #undef CONFIG_ETRAX_PB_LEDS | 37 | #undef CONFIG_ETRAX_PB_LEDS |
40 | #undef CONFIG_ETRAX_CSP0_LEDS | 38 | #undef CONFIG_ETRAX_CSP0_LEDS |
@@ -171,29 +169,4 @@ extern volatile unsigned long *port_csp4_addr; | |||
171 | #define SOFT_SHUTDOWN() | 169 | #define SOFT_SHUTDOWN() |
172 | #endif | 170 | #endif |
173 | 171 | ||
174 | /* Console I/O for simulated etrax100. Use #ifdef so erroneous | ||
175 | use will be evident. */ | ||
176 | #ifdef CONFIG_SVINTO_SIM | ||
177 | /* Let's use the ucsim interface since it lets us do write(2, ...) */ | ||
178 | #define SIMCOUT(s,len) \ | ||
179 | asm ("moveq 4,$r9 \n\t" \ | ||
180 | "moveq 2,$r10 \n\t" \ | ||
181 | "move.d %0,$r11 \n\t" \ | ||
182 | "move.d %1,$r12 \n\t" \ | ||
183 | "push $irp \n\t" \ | ||
184 | "move 0f,$irp \n\t" \ | ||
185 | "jump -6809 \n" \ | ||
186 | "0: \n\t" \ | ||
187 | "pop $irp" \ | ||
188 | : : "rm" (s), "rm" (len) : "r9","r10","r11","r12","memory") | ||
189 | #define TRACE_ON() __extension__ \ | ||
190 | ({ int _Foofoo; __asm__ volatile ("bmod [%0],%0" : "=r" (_Foofoo) : "0" \ | ||
191 | (255)); _Foofoo; }) | ||
192 | |||
193 | #define TRACE_OFF() do { __asm__ volatile ("bmod [%0],%0" :: "r" (254)); } while (0) | ||
194 | #define SIM_END() do { __asm__ volatile ("bmod [%0],%0" :: "r" (28)); } while (0) | ||
195 | #define CRIS_CYCLES() __extension__ \ | ||
196 | ({ unsigned long c; asm ("bmod [%1],%0" : "=r" (c) : "r" (27)); c;}) | ||
197 | #endif /* ! defined CONFIG_SVINTO_SIM */ | ||
198 | |||
199 | #endif | 172 | #endif |
diff --git a/arch/cris/include/arch-v10/arch/irq.h b/arch/cris/include/arch-v10/arch/irq.h index ca2675ae08ed..6aecb835037d 100644 --- a/arch/cris/include/arch-v10/arch/irq.h +++ b/arch/cris/include/arch-v10/arch/irq.h | |||
@@ -141,9 +141,9 @@ __asm__ ( \ | |||
141 | * handler is run and it prioritizes the timer interrupt. However if we had BLOCK'ed | 141 | * handler is run and it prioritizes the timer interrupt. However if we had BLOCK'ed |
142 | * it here, we would not get the multiple_irq at all. | 142 | * it here, we would not get the multiple_irq at all. |
143 | * | 143 | * |
144 | * The non-blocking here is based on the knowledge that the timer interrupt is | 144 | * The non-blocking here is based on the knowledge that the timer interrupt runs |
145 | * registered as a fast interrupt (IRQF_DISABLED) so that we _know_ there will not | 145 | * with interrupts disabled, and therefore there will not be an sti() before the |
146 | * be an sti() before the timer irq handler is run to acknowledge the interrupt. | 146 | * timer irq handler is run to acknowledge the interrupt. |
147 | */ | 147 | */ |
148 | 148 | ||
149 | #define BUILD_TIMER_IRQ(nr,mask) \ | 149 | #define BUILD_TIMER_IRQ(nr,mask) \ |
diff --git a/arch/cris/include/arch-v32/arch/irq.h b/arch/cris/include/arch-v32/arch/irq.h index fe3cdd22bed4..0c1b4d3a34e7 100644 --- a/arch/cris/include/arch-v32/arch/irq.h +++ b/arch/cris/include/arch-v32/arch/irq.h | |||
@@ -102,9 +102,9 @@ __asm__ ( \ | |||
102 | * multiple_irq handler is run and it prioritizes the timer interrupt. However | 102 | * multiple_irq handler is run and it prioritizes the timer interrupt. However |
103 | * if we had BLOCK'edit here, we would not get the multiple_irq at all. | 103 | * if we had BLOCK'edit here, we would not get the multiple_irq at all. |
104 | * | 104 | * |
105 | * The non-blocking here is based on the knowledge that the timer interrupt is | 105 | * The non-blocking here is based on the knowledge that the timer interrupt runs |
106 | * registered as a fast interrupt (IRQF_DISABLED) so that we _know_ there will not | 106 | * with interrupts disabled, and therefore there will not be an sti() before the |
107 | * be an sti() before the timer irq handler is run to acknowledge the interrupt. | 107 | * timer irq handler is run to acknowledge the interrupt. |
108 | */ | 108 | */ |
109 | #define BUILD_TIMER_IRQ(nr, mask) \ | 109 | #define BUILD_TIMER_IRQ(nr, mask) \ |
110 | void IRQ_NAME(nr); \ | 110 | void IRQ_NAME(nr); \ |
diff --git a/arch/cris/include/asm/unistd.h b/arch/cris/include/asm/unistd.h index 0ff3f6889842..5cc7d1991e48 100644 --- a/arch/cris/include/asm/unistd.h +++ b/arch/cris/include/asm/unistd.h | |||
@@ -4,7 +4,7 @@ | |||
4 | #include <uapi/asm/unistd.h> | 4 | #include <uapi/asm/unistd.h> |
5 | 5 | ||
6 | 6 | ||
7 | #define NR_syscalls 336 | 7 | #define NR_syscalls 360 |
8 | 8 | ||
9 | #include <arch/unistd.h> | 9 | #include <arch/unistd.h> |
10 | 10 | ||
diff --git a/arch/cris/include/uapi/asm/unistd.h b/arch/cris/include/uapi/asm/unistd.h index 48842896f6c2..f3287face443 100644 --- a/arch/cris/include/uapi/asm/unistd.h +++ b/arch/cris/include/uapi/asm/unistd.h | |||
@@ -340,5 +340,21 @@ | |||
340 | #define __NR_preadv 333 | 340 | #define __NR_preadv 333 |
341 | #define __NR_pwritev 334 | 341 | #define __NR_pwritev 334 |
342 | #define __NR_setns 335 | 342 | #define __NR_setns 335 |
343 | #define __NR_name_to_handle_at 336 | ||
344 | #define __NR_open_by_handle_at 337 | ||
345 | #define __NR_rt_tgsigqueueinfo 338 | ||
346 | #define __NR_perf_event_open 339 | ||
347 | #define __NR_recvmmsg 340 | ||
348 | #define __NR_accept4 341 | ||
349 | #define __NR_fanotify_init 342 | ||
350 | #define __NR_fanotify_mark 343 | ||
351 | #define __NR_prlimit64 344 | ||
352 | #define __NR_clock_adjtime 345 | ||
353 | #define __NR_syncfs 346 | ||
354 | #define __NR_sendmmsg 347 | ||
355 | #define __NR_process_vm_readv 348 | ||
356 | #define __NR_process_vm_writev 349 | ||
357 | #define __NR_kcmp 350 | ||
358 | #define __NR_finit_module 351 | ||
343 | 359 | ||
344 | #endif /* _UAPI_ASM_CRIS_UNISTD_H_ */ | 360 | #endif /* _UAPI_ASM_CRIS_UNISTD_H_ */ |
diff --git a/arch/cris/kernel/irq.c b/arch/cris/kernel/irq.c index d36836dbbc07..dd0be5de55d5 100644 --- a/arch/cris/kernel/irq.c +++ b/arch/cris/kernel/irq.c | |||
@@ -40,9 +40,6 @@ | |||
40 | 40 | ||
41 | /* called by the assembler IRQ entry functions defined in irq.h | 41 | /* called by the assembler IRQ entry functions defined in irq.h |
42 | * to dispatch the interrupts to registered handlers | 42 | * to dispatch the interrupts to registered handlers |
43 | * interrupts are disabled upon entry - depending on if the | ||
44 | * interrupt was registered with IRQF_DISABLED or not, interrupts | ||
45 | * are re-enabled or not. | ||
46 | */ | 43 | */ |
47 | 44 | ||
48 | asmlinkage void do_IRQ(int irq, struct pt_regs * regs) | 45 | asmlinkage void do_IRQ(int irq, struct pt_regs * regs) |