aboutsummaryrefslogtreecommitdiffstats
path: root/arch/cris
diff options
context:
space:
mode:
authorJesper Nilsson <jespern@axis.com>2014-01-15 08:42:37 -0500
committerJesper Nilsson <jespern@axis.com>2014-01-15 08:44:02 -0500
commite269a869417cd4053b37da1b19186902d3cbf63b (patch)
tree6d97e80f40859b62cfa8a1a634a1c3ad944681b1 /arch/cris
parente7672be573afa078e8d85d5ad0202b78bd6bd1fd (diff)
Drop code for CRISv10 CPU simulator
That simulator is dead and redundant. Signed-off-by: Jesper Nilsson <jesper.nilsson@axis.com>
Diffstat (limited to 'arch/cris')
-rw-r--r--arch/cris/Kconfig6
-rw-r--r--arch/cris/arch-v10/kernel/Makefile1
-rw-r--r--arch/cris/arch-v10/kernel/debugport.c7
-rw-r--r--arch/cris/arch-v10/kernel/entry.S4
-rw-r--r--arch/cris/arch-v10/kernel/head.S5
-rw-r--r--arch/cris/arch-v10/kernel/irq.c18
-rw-r--r--arch/cris/arch-v10/kernel/process.c5
-rw-r--r--arch/cris/arch-v10/kernel/time.c92
-rw-r--r--arch/cris/arch-v10/lib/dram_init.S40
-rw-r--r--arch/cris/boot/rescue/kimagerescue.S2
-rw-r--r--arch/cris/include/arch-v10/arch/io.h29
11 files changed, 66 insertions, 143 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
125config SVINTO_SIM
126 bool "ETRAX-100LX-for-xsim-simulator"
127 select ARCH_USES_GETTIMEOFFSET
128 help
129 Support the xsim ETRAX Simulator.
130
131config ETRAXFS 125config ETRAXFS
132 bool "ETRAX-FS-V32" 126 bool "ETRAX-FS-V32"
133 help 127 help
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
24extern void reset_watchdog(void); 23extern 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 def0a530e9d4..81570fcd0412 100644
--- a/arch/cris/arch-v10/kernel/entry.S
+++ b/arch/cris/arch-v10/kernel/entry.S
@@ -457,7 +457,7 @@ IRQ1_interrupt:
457 ba _Rexit ; Return the standard way 457 ba _Rexit ; Return the standard way
458 nop 458 nop
459wdog: 459wdog:
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.
@@ -523,7 +523,7 @@ _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
528spurious_interrupt: 528spurious_interrupt:
529 di 529 di
diff --git a/arch/cris/arch-v10/kernel/head.S b/arch/cris/arch-v10/kernel/head.S
index 137bf52a5596..4a146e1749c9 100644
--- a/arch/cris/arch-v10/kernel/head.S
+++ b/arch/cris/arch-v10/kernel/head.S
@@ -168,13 +168,11 @@ _inflash:
168#endif 168#endif
169 169
170 ;; Set up waitstates etc according to kernel configuration. 170 ;; Set up waitstates etc according to kernel configuration.
171#ifndef CONFIG_SVINTO_SIM
172 move.d CONFIG_ETRAX_DEF_R_WAITSTATES, $r0 171 move.d CONFIG_ETRAX_DEF_R_WAITSTATES, $r0
173 move.d $r0, [R_WAITSTATES] 172 move.d $r0, [R_WAITSTATES]
174 173
175 move.d CONFIG_ETRAX_DEF_R_BUS_CONFIG, $r0 174 move.d CONFIG_ETRAX_DEF_R_BUS_CONFIG, $r0
176 move.d $r0, [R_BUS_CONFIG] 175 move.d $r0, [R_BUS_CONFIG]
177#endif
178 176
179 ;; 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
180 178
@@ -466,7 +464,6 @@ no_command_line:
466 464
467 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
468 466
469#ifndef CONFIG_SVINTO_SIM
470 move.d $r0,[R_GEN_CONFIG] 467 move.d $r0,[R_GEN_CONFIG]
471 468
472#if 0 469#if 0
@@ -701,8 +698,6 @@ no_command_line:
701 move.b $r0,[R_SERIAL3_TR_CTRL] 698 move.b $r0,[R_SERIAL3_TR_CTRL]
702#endif 699#endif
703 700
704#endif /* CONFIG_SVINTO_SIM */
705
706 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
707 702
708 .data 703 .data
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
185void __init 185void __init init_IRQ(void)
186init_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 e6a722715a8d..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
101static int watchdog_key = 0; /* arbitrary number */ 100static 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
110void 109void reset_watchdog(void)
111reset_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
126void 124void stop_watchdog(void)
127stop_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
134extern 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 140static inline irqreturn_t timer_interrupt(int irq, void *dev_id)
142//static unsigned short myjiff; /* used by our debug routine print_timestamp */
143
144extern void cris_do_profile(struct pt_regs *regs);
145
146static inline irqreturn_t
147timer_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,20 +153,18 @@ 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}
@@ -186,16 +177,15 @@ static struct irqaction irq2 = {
186 .name = "timer", 177 .name = "timer",
187}; 178};
188 179
189void __init 180void __init time_init(void)
190time_init(void) 181{
191{
192 arch_gettimeoffset = cris_v10_gettimeoffset; 182 arch_gettimeoffset = cris_v10_gettimeoffset;
193 183
194 /* probe for the RTC and read it if it exists 184 /* probe for the RTC and read it if it exists
195 * 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
196 * to be initialized to make usleep work. A better value for 186 * to be initialized to make usleep work. A better value for
197 * loops_per_usec is calculated by the kernel later once the 187 * loops_per_usec is calculated by the kernel later once the
198 * clock has started. 188 * clock has started.
199 */ 189 */
200 loops_per_usec = 50; 190 loops_per_usec = 50;
201 191
@@ -206,7 +196,7 @@ time_init(void)
206 * Remember that linux/timex.h contains #defines that rely on the 196 * Remember that linux/timex.h contains #defines that rely on the
207 * timer settings below (hz and divide factor) !!! 197 * timer settings below (hz and divide factor) !!!
208 */ 198 */
209 199
210#ifdef USE_CASCADE_TIMERS 200#ifdef USE_CASCADE_TIMERS
211 *R_TIMER_CTRL = 201 *R_TIMER_CTRL =
212 IO_FIELD( R_TIMER_CTRL, timerdiv1, 0) | 202 IO_FIELD( R_TIMER_CTRL, timerdiv1, 0) |
@@ -217,8 +207,8 @@ time_init(void)
217 IO_STATE( R_TIMER_CTRL, i0, nop) | 207 IO_STATE( R_TIMER_CTRL, i0, nop) |
218 IO_STATE( R_TIMER_CTRL, tm0, stop_ld) | 208 IO_STATE( R_TIMER_CTRL, tm0, stop_ld) |
219 IO_STATE( R_TIMER_CTRL, clksel0, c6250kHz); 209 IO_STATE( R_TIMER_CTRL, clksel0, c6250kHz);
220 210
221 *R_TIMER_CTRL = r_timer_ctrl_shadow = 211 *R_TIMER_CTRL = r_timer_ctrl_shadow =
222 IO_FIELD( R_TIMER_CTRL, timerdiv1, 0) | 212 IO_FIELD( R_TIMER_CTRL, timerdiv1, 0) |
223 IO_FIELD( R_TIMER_CTRL, timerdiv0, 0) | 213 IO_FIELD( R_TIMER_CTRL, timerdiv0, 0) |
224 IO_STATE( R_TIMER_CTRL, i1, nop) | 214 IO_STATE( R_TIMER_CTRL, i1, nop) |
@@ -228,18 +218,18 @@ time_init(void)
228 IO_STATE( R_TIMER_CTRL, tm0, run) | 218 IO_STATE( R_TIMER_CTRL, tm0, run) |
229 IO_STATE( R_TIMER_CTRL, clksel0, c6250kHz); 219 IO_STATE( R_TIMER_CTRL, clksel0, c6250kHz);
230#else 220#else
231 *R_TIMER_CTRL = 221 *R_TIMER_CTRL =
232 IO_FIELD(R_TIMER_CTRL, timerdiv1, 192) | 222 IO_FIELD(R_TIMER_CTRL, timerdiv1, 192) |
233 IO_FIELD(R_TIMER_CTRL, timerdiv0, TIMER0_DIV) | 223 IO_FIELD(R_TIMER_CTRL, timerdiv0, TIMER0_DIV) |
234 IO_STATE(R_TIMER_CTRL, i1, nop) | 224 IO_STATE(R_TIMER_CTRL, i1, nop) |
235 IO_STATE(R_TIMER_CTRL, tm1, stop_ld) | 225 IO_STATE(R_TIMER_CTRL, tm1, stop_ld) |
236 IO_STATE(R_TIMER_CTRL, clksel1, c19k2Hz) | 226 IO_STATE(R_TIMER_CTRL, clksel1, c19k2Hz) |
237 IO_STATE(R_TIMER_CTRL, i0, nop) | 227 IO_STATE(R_TIMER_CTRL, i0, nop) |
238 IO_STATE(R_TIMER_CTRL, tm0, stop_ld) | 228 IO_STATE(R_TIMER_CTRL, tm0, stop_ld) |
239 IO_STATE(R_TIMER_CTRL, clksel0, flexible); 229 IO_STATE(R_TIMER_CTRL, clksel0, flexible);
240 230
241 *R_TIMER_CTRL = r_timer_ctrl_shadow = 231 *R_TIMER_CTRL = r_timer_ctrl_shadow =
242 IO_FIELD(R_TIMER_CTRL, timerdiv1, 192) | 232 IO_FIELD(R_TIMER_CTRL, timerdiv1, 192) |
243 IO_FIELD(R_TIMER_CTRL, timerdiv0, TIMER0_DIV) | 233 IO_FIELD(R_TIMER_CTRL, timerdiv0, TIMER0_DIV) |
244 IO_STATE(R_TIMER_CTRL, i1, nop) | 234 IO_STATE(R_TIMER_CTRL, i1, nop) |
245 IO_STATE(R_TIMER_CTRL, tm1, run) | 235 IO_STATE(R_TIMER_CTRL, tm1, run) |
@@ -251,16 +241,14 @@ time_init(void)
251 *R_TIMER_PRESCALE = PRESCALE_VALUE; 241 *R_TIMER_PRESCALE = PRESCALE_VALUE;
252#endif 242#endif
253 243
254 *R_IRQ_MASK0_SET = 244 /* unmask the timer irq */
255 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);
256 246
257 /* now actually register the timer irq handler that calls timer_interrupt() */ 247 /* now actually register the irq handler that calls timer_interrupt() */
258
259 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 */
260 249
261 /* enable watchdog if we should use one */ 250 /* enable watchdog if we should use one */
262 251#if defined(CONFIG_ETRAX_WATCHDOG)
263#if defined(CONFIG_ETRAX_WATCHDOG) && !defined(CONFIG_SVINTO_SIM)
264 printk("Enabling watchdog...\n"); 252 printk("Enabling watchdog...\n");
265 start_watchdog(); 253 start_watchdog();
266 254
@@ -273,9 +261,7 @@ time_init(void)
273 driver or infrastructure support yet. */ 261 driver or infrastructure support yet. */
274 asm ("setf m"); 262 asm ("setf m");
275 263
276 *R_IRQ_MASK0_SET = 264 *R_IRQ_MASK0_SET = IO_STATE(R_IRQ_MASK0_SET, watchdog_nmi, set);
277 IO_STATE(R_IRQ_MASK0_SET, watchdog_nmi, set); 265 *R_VECT_MASK_SET = IO_STATE(R_VECT_MASK_SET, nmi, set);
278 *R_VECT_MASK_SET =
279 IO_STATE(R_VECT_MASK_SET, nmi, set);
280#endif 266#endif
281} 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
991: bne 1b 961: 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/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
8extern unsigned long gen_config_ii_shadow; 6extern 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