aboutsummaryrefslogtreecommitdiffstats
path: root/arch/cris/arch-v10/kernel/head.S
diff options
context:
space:
mode:
authorJesper Nilsson <jesper.nilsson@axis.com>2008-01-21 05:52:52 -0500
committerJesper Nilsson <jesper.nilsson@axis.com>2008-02-08 05:06:31 -0500
commit5f526d1467383fbd7d64b4f7de85b2889838e454 (patch)
treee127a990604a7269bc0fb84af0ed9db5f0e65015 /arch/cris/arch-v10/kernel/head.S
parentc974a9e5a3c52f1c61501b22a0b0a278250a6bd1 (diff)
CRIS v10: Setup serial port 2 to avoid accidental TXD pulse on startup.
If serial port 2 is used, select it in R_GEN_CONFIG. If serial port 2 is used, setup the control registers for the port. This is done to avoid a pulse on the TXD line during start up, which could disturb some units. Also, remove useless CVS id and log.
Diffstat (limited to 'arch/cris/arch-v10/kernel/head.S')
-rw-r--r--arch/cris/arch-v10/kernel/head.S221
1 files changed, 43 insertions, 178 deletions
diff --git a/arch/cris/arch-v10/kernel/head.S b/arch/cris/arch-v10/kernel/head.S
index d946d8b8d277..96344afc4ebc 100644
--- a/arch/cris/arch-v10/kernel/head.S
+++ b/arch/cris/arch-v10/kernel/head.S
@@ -1,186 +1,10 @@
1/* $Id: head.S,v 1.10 2005/06/20 05:12:54 starvik Exp $ 1/*
2 *
3 * Head of the kernel - alter with care 2 * Head of the kernel - alter with care
4 * 3 *
5 * Copyright (C) 2000, 2001 Axis Communications AB 4 * Copyright (C) 2000, 2001 Axis Communications AB
6 * 5 *
7 * Authors: Bjorn Wesen (bjornw@axis.com) 6 * Authors: Bjorn Wesen (bjornw@axis.com)
8 * 7 *
9 * $Log: head.S,v $
10 * Revision 1.10 2005/06/20 05:12:54 starvik
11 * Remove unnecessary diff to kernel.org tree
12 *
13 * Revision 1.9 2004/12/13 12:21:51 starvik
14 * Added I/O and DMA allocators from Linux 2.4
15 *
16 * Revision 1.8 2004/11/22 11:41:14 starvik
17 * Kernel command line may be supplied to kernel. Not used by Axis but may
18 * be used by customers.
19 *
20 * Revision 1.7 2004/05/14 07:58:01 starvik
21 * Merge of changes from 2.4
22 *
23 * Revision 1.6 2003/04/28 05:31:46 starvik
24 * Added section attributes
25 *
26 * Revision 1.5 2002/12/11 15:42:02 starvik
27 * Extracted v10 (ETRAX 100LX) specific stuff from arch/cris/kernel/*.c
28 *
29 * Revision 1.4 2002/11/07 09:00:44 starvik
30 * Names changed for init sections
31 * init_task_union -> init_thread_union
32 *
33 * Revision 1.3 2002/02/05 15:38:23 bjornw
34 * Oops.. non-CRAMFS_MAGIC should jump over the copying, not into it...
35 *
36 * Revision 1.2 2001/12/18 13:35:19 bjornw
37 * Applied the 2.4.13->2.4.16 CRIS patch to 2.5.1 (is a copy of 2.4.15).
38 *
39 * Revision 1.43 2001/11/08 15:09:43 starvik
40 * Only start MII clock if Ethernet is configured
41 *
42 * Revision 1.42 2001/11/08 14:37:34 starvik
43 * Start MII clock early to make sure that it is running at tranceiver reset
44 *
45 * Revision 1.41 2001/10/29 14:55:58 pkj
46 * Corrected pa$r0 to par0.
47 *
48 * Revision 1.40 2001/10/03 14:59:57 pkj
49 * Added support for resetting the Bluetooth hardware.
50 *
51 * Revision 1.39 2001/10/01 14:45:03 bjornw
52 * Removed underscores and added register prefixes
53 *
54 * Revision 1.38 2001/09/21 07:14:11 jonashg
55 * Made root filesystem (cramfs) use mtdblock driver when booting from flash.
56 *
57 * Revision 1.37 2001/09/11 13:44:29 orjanf
58 * Decouple usage of serial ports for debug and kgdb.
59 *
60 * Revision 1.36 2001/06/29 12:39:31 pkj
61 * Added support for mirroring the first flash to just below the
62 * second one, to make them look consecutive to cramfs.
63 *
64 * Revision 1.35 2001/06/25 14:07:00 hp
65 * Fix review comment.
66 * * head.S: Use IO_STATE, IO_FIELD and IO_MASK constructs instead of
67 * magic numbers. Add comment that -traditional must not be used.
68 * * entry.S (SYMBOL_NAME): Change redefinition to use ## concatenation.
69 * Correct and update comment.
70 * * Makefile (.S.o): Don't use -traditional. Add comment why the
71 * toplevel rule can't be used (now that there's a reason).
72 *
73 * Revision 1.34 2001/05/15 07:08:14 hp
74 * Tweak "notice" to reflect that both r8 r9 are used
75 *
76 * Revision 1.33 2001/05/15 06:40:05 hp
77 * Put bulk of code in .text.init, data in .data.init
78 *
79 * Revision 1.32 2001/05/15 06:18:56 hp
80 * Execute review comment: s/bcc/bhs/g; s/bcs/blo/g
81 *
82 * Revision 1.31 2001/05/15 06:08:40 hp
83 * Add sentence about autodetecting the bit31-MMU-bug
84 *
85 * Revision 1.30 2001/05/15 06:00:05 hp
86 * Update comment: LOW_MAP is not forced on xsim anymore.
87 *
88 * Revision 1.29 2001/04/18 12:51:59 orjanf
89 * * Reverted review change regarding the use of bcs/bcc.
90 * * Removed non-working LED-clearing code.
91 *
92 * Revision 1.28 2001/04/17 13:58:39 orjanf
93 * * Renamed CONFIG_KGDB to CONFIG_ETRAX_KGDB.
94 *
95 * Revision 1.27 2001/04/17 11:42:35 orjanf
96 * Changed according to review:
97 * * Added comment explaining memory map bug.
98 * * Changed bcs and bcc to blo and bhs, respectively.
99 * * Removed mentioning of Stallone and Olga boards.
100 *
101 * Revision 1.26 2001/04/06 12:31:07 jonashg
102 * Check for cramfs in flash before RAM instead of RAM before flash.
103 *
104 * Revision 1.25 2001/04/04 06:23:53 starvik
105 * Initialize DRAM if not already initialized
106 *
107 * Revision 1.24 2001/04/03 11:12:00 starvik
108 * Removed dram init (done by rescue or etrax100boot
109 * Corrected include
110 *
111 * Revision 1.23 2001/04/03 09:53:03 starvik
112 * Include hw_settings.S
113 *
114 * Revision 1.22 2001/03/26 14:23:26 bjornw
115 * Namechange of some config options
116 *
117 * Revision 1.21 2001/03/08 12:14:41 bjornw
118 * * Config name for ETRAX IDE was renamed
119 * * Removed G27 auto-setting when JULIETTE is chosen (need to make this
120 * a new config option later)
121 *
122 * Revision 1.20 2001/02/23 12:47:56 bjornw
123 * MMU regs during LOW_MAP updated to reflect a newer reality
124 *
125 * Revision 1.19 2001/02/19 11:12:07 bjornw
126 * Changed comment header format
127 *
128 * Revision 1.18 2001/02/15 07:25:38 starvik
129 * Added support for synchronous serial ports
130 *
131 * Revision 1.17 2001/02/08 15:53:13 starvik
132 * Last commit removed some important ifdefs
133 *
134 * Revision 1.16 2001/02/08 15:20:38 starvik
135 * Include dram_init.S as inline
136 *
137 * Revision 1.15 2001/01/29 18:12:01 bjornw
138 * Corrected some comments
139 *
140 * Revision 1.14 2001/01/29 13:11:29 starvik
141 * Include dram_init.S (with DRAM/SDRAM initialization)
142 *
143 * Revision 1.13 2001/01/23 14:54:57 markusl
144 * Updated for USB
145 * i.e. added r_gen_config settings
146 *
147 * Revision 1.12 2001/01/19 16:16:29 perf
148 * Added temporary mapping of 0x0c->0x0c to avoid flash loading confusion.
149 * Renamed serial options from ETRAX100 to ETRAX.
150 *
151 * Revision 1.11 2001/01/16 16:31:38 bjornw
152 * * Changed name and semantics of running_from_flash to romfs_in_flash,
153 * set by head.S to indicate to setup.c whether there is a cramfs image
154 * after the kernels BSS or not. Should work for all three boot-cases
155 * (DRAM with cramfs in DRAM, DRAM with cramfs in flash (compressed boot),
156 * and flash with cramfs in flash)
157 *
158 * Revision 1.10 2001/01/16 14:12:21 bjornw
159 * * Check for cramfs start passed in r9 from the decompressor, if all other
160 * cramfs options fail (if we boot from DRAM but don't find a cramfs image
161 * after the kernel in DRAM, it is probably still in the flash)
162 * * Check magic in cramfs detection when booting from flash directly
163 *
164 * Revision 1.9 2001/01/15 17:17:02 bjornw
165 * * Corrected the code that detects the cramfs lengths
166 * * Added a comment saying that the above does not work due to other
167 * reasons..
168 *
169 * Revision 1.8 2001/01/15 16:27:51 jonashg
170 * Made boot after flashing work.
171 * * end destination is __vmlinux_end in RAM.
172 * * _romfs_start moved because of virtual memory.
173 *
174 * Revision 1.7 2000/11/21 13:55:29 bjornw
175 * Use CONFIG_CRIS_LOW_MAP for the low VM map instead of explicit CPU type
176 *
177 * Revision 1.6 2000/10/06 12:36:55 bjornw
178 * Forgot swapper_pg_dir when changing memory map..
179 *
180 * Revision 1.5 2000/10/04 16:49:30 bjornw
181 * * Fixed memory mapping in LX
182 * * Check for cramfs instead of romfs
183 *
184 */ 8 */
185 9
186#define ASSEMBLER_MACROS_ONLY 10#define ASSEMBLER_MACROS_ONLY
@@ -595,11 +419,17 @@ no_command_line:
595 419
596 moveq 0,$r0 420 moveq 0,$r0
597 421
422 ;; Select or disable serial port 2
423#ifdef CONFIG_ETRAX_SERIAL_PORT2
424 or.d IO_STATE (R_GEN_CONFIG, ser2, select),$r0
425#else
426 or.d IO_STATE (R_GEN_CONFIG, ser2, disable),$r0
427#endif
428
598 ;; Init interfaces (disable them). 429 ;; Init interfaces (disable them).
599 or.d IO_STATE (R_GEN_CONFIG, scsi0, disable) \ 430 or.d IO_STATE (R_GEN_CONFIG, scsi0, disable) \
600 | IO_STATE (R_GEN_CONFIG, ata, disable) \ 431 | IO_STATE (R_GEN_CONFIG, ata, disable) \
601 | IO_STATE (R_GEN_CONFIG, par0, disable) \ 432 | IO_STATE (R_GEN_CONFIG, par0, disable) \
602 | IO_STATE (R_GEN_CONFIG, ser2, disable) \
603 | IO_STATE (R_GEN_CONFIG, mio, disable) \ 433 | IO_STATE (R_GEN_CONFIG, mio, disable) \
604 | IO_STATE (R_GEN_CONFIG, scsi1, disable) \ 434 | IO_STATE (R_GEN_CONFIG, scsi1, disable) \
605 | IO_STATE (R_GEN_CONFIG, scsi0w, disable) \ 435 | IO_STATE (R_GEN_CONFIG, scsi0w, disable) \
@@ -801,6 +631,41 @@ no_command_line:
801 | IO_STATE (R_SERIAL1_TR_CTRL, tr_bitnr, tr_8bit),$r0 631 | IO_STATE (R_SERIAL1_TR_CTRL, tr_bitnr, tr_8bit),$r0
802 move.b $r0,[R_SERIAL1_TR_CTRL] 632 move.b $r0,[R_SERIAL1_TR_CTRL]
803 633
634#ifdef CONFIG_ETRAX_SERIAL_PORT2
635 ;; setup the serial port 2 at 115200 baud for debug purposes
636
637 moveq IO_STATE (R_SERIAL2_XOFF, tx_stop, enable) \
638 | IO_STATE (R_SERIAL2_XOFF, auto_xoff, disable) \
639 | IO_FIELD (R_SERIAL2_XOFF, xoff_char, 0),$r0
640 move.d $r0,[R_SERIAL2_XOFF]
641
642 ; 115.2kbaud for both transmit and receive
643 move.b IO_STATE (R_SERIAL2_BAUD, tr_baud, c115k2Hz) \
644 | IO_STATE (R_SERIAL2_BAUD, rec_baud, c115k2Hz),$r0
645 move.b $r0,[R_SERIAL2_BAUD]
646
647 ; Set up and enable the serial2 receiver.
648 move.b IO_STATE (R_SERIAL2_REC_CTRL, dma_err, stop) \
649 | IO_STATE (R_SERIAL2_REC_CTRL, rec_enable, enable) \
650 | IO_STATE (R_SERIAL2_REC_CTRL, rts_, active) \
651 | IO_STATE (R_SERIAL2_REC_CTRL, sampling, middle) \
652 | IO_STATE (R_SERIAL2_REC_CTRL, rec_stick_par, normal) \
653 | IO_STATE (R_SERIAL2_REC_CTRL, rec_par, even) \
654 | IO_STATE (R_SERIAL2_REC_CTRL, rec_par_en, disable) \
655 | IO_STATE (R_SERIAL2_REC_CTRL, rec_bitnr, rec_8bit),$r0
656 move.b $r0,[R_SERIAL2_REC_CTRL]
657
658 ; Set up and enable the serial2 transmitter.
659 move.b IO_FIELD (R_SERIAL2_TR_CTRL, txd, 0) \
660 | IO_STATE (R_SERIAL2_TR_CTRL, tr_enable, enable) \
661 | IO_STATE (R_SERIAL2_TR_CTRL, auto_cts, disabled) \
662 | IO_STATE (R_SERIAL2_TR_CTRL, stop_bits, one_bit) \
663 | IO_STATE (R_SERIAL2_TR_CTRL, tr_stick_par, normal) \
664 | IO_STATE (R_SERIAL2_TR_CTRL, tr_par, even) \
665 | IO_STATE (R_SERIAL2_TR_CTRL, tr_par_en, disable) \
666 | IO_STATE (R_SERIAL2_TR_CTRL, tr_bitnr, tr_8bit),$r0
667 move.b $r0,[R_SERIAL2_TR_CTRL]
668#endif
804 669
805#ifdef CONFIG_ETRAX_SERIAL_PORT3 670#ifdef CONFIG_ETRAX_SERIAL_PORT3
806 ;; setup the serial port 3 at 115200 baud for debug purposes 671 ;; setup the serial port 3 at 115200 baud for debug purposes