diff options
author | Roman Zippel <zippel@linux-m68k.org> | 2007-05-01 16:32:43 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-05-04 20:59:06 -0400 |
commit | 6ff5801acbb643e81d3420ac0f37c96089309063 (patch) | |
tree | 2406744e75f7cd06e96d8cd62ba82970a0f79922 /arch/m68k/atari/debug.c | |
parent | b3e2fd9cebcf4e82d0306fe7e796eeca5aac0614 (diff) |
m68k: reformat various m68k files
Reformat various m68k files, so they actually look like Linux sources.
Signed-off-by: Roman Zippel <zippel@linux-m68k.org>
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/m68k/atari/debug.c')
-rw-r--r-- | arch/m68k/atari/debug.c | 474 |
1 files changed, 234 insertions, 240 deletions
diff --git a/arch/m68k/atari/debug.c b/arch/m68k/atari/debug.c index 4ae01004d8dd..66983fe87509 100644 --- a/arch/m68k/atari/debug.c +++ b/arch/m68k/atari/debug.c | |||
@@ -30,317 +30,311 @@ int atari_SCC_init_done; | |||
30 | int atari_SCC_reset_done; | 30 | int atari_SCC_reset_done; |
31 | 31 | ||
32 | static struct console atari_console_driver = { | 32 | static struct console atari_console_driver = { |
33 | .name = "debug", | 33 | .name = "debug", |
34 | .flags = CON_PRINTBUFFER, | 34 | .flags = CON_PRINTBUFFER, |
35 | .index = -1, | 35 | .index = -1, |
36 | }; | 36 | }; |
37 | 37 | ||
38 | 38 | ||
39 | static inline void ata_mfp_out (char c) | 39 | static inline void ata_mfp_out(char c) |
40 | { | 40 | { |
41 | while (!(mfp.trn_stat & 0x80)) /* wait for tx buf empty */ | 41 | while (!(mfp.trn_stat & 0x80)) /* wait for tx buf empty */ |
42 | barrier (); | 42 | barrier(); |
43 | mfp.usart_dta = c; | 43 | mfp.usart_dta = c; |
44 | } | 44 | } |
45 | 45 | ||
46 | void atari_mfp_console_write (struct console *co, const char *str, | 46 | void atari_mfp_console_write(struct console *co, const char *str, |
47 | unsigned int count) | 47 | unsigned int count) |
48 | { | 48 | { |
49 | while (count--) { | 49 | while (count--) { |
50 | if (*str == '\n') | 50 | if (*str == '\n') |
51 | ata_mfp_out( '\r' ); | 51 | ata_mfp_out('\r'); |
52 | ata_mfp_out( *str++ ); | 52 | ata_mfp_out(*str++); |
53 | } | 53 | } |
54 | } | 54 | } |
55 | 55 | ||
56 | static inline void ata_scc_out (char c) | 56 | static inline void ata_scc_out(char c) |
57 | { | 57 | { |
58 | do { | 58 | do { |
59 | MFPDELAY(); | ||
60 | } while (!(scc.cha_b_ctrl & 0x04)); /* wait for tx buf empty */ | ||
59 | MFPDELAY(); | 61 | MFPDELAY(); |
60 | } while (!(scc.cha_b_ctrl & 0x04)); /* wait for tx buf empty */ | 62 | scc.cha_b_data = c; |
61 | MFPDELAY(); | ||
62 | scc.cha_b_data = c; | ||
63 | } | 63 | } |
64 | 64 | ||
65 | void atari_scc_console_write (struct console *co, const char *str, | 65 | void atari_scc_console_write(struct console *co, const char *str, |
66 | unsigned int count) | 66 | unsigned int count) |
67 | { | 67 | { |
68 | while (count--) { | 68 | while (count--) { |
69 | if (*str == '\n') | 69 | if (*str == '\n') |
70 | ata_scc_out( '\r' ); | 70 | ata_scc_out('\r'); |
71 | ata_scc_out( *str++ ); | 71 | ata_scc_out(*str++); |
72 | } | 72 | } |
73 | } | 73 | } |
74 | 74 | ||
75 | static inline void ata_midi_out (char c) | 75 | static inline void ata_midi_out(char c) |
76 | { | 76 | { |
77 | while (!(acia.mid_ctrl & ACIA_TDRE)) /* wait for tx buf empty */ | 77 | while (!(acia.mid_ctrl & ACIA_TDRE)) /* wait for tx buf empty */ |
78 | barrier (); | 78 | barrier(); |
79 | acia.mid_data = c; | 79 | acia.mid_data = c; |
80 | } | 80 | } |
81 | 81 | ||
82 | void atari_midi_console_write (struct console *co, const char *str, | 82 | void atari_midi_console_write(struct console *co, const char *str, |
83 | unsigned int count) | 83 | unsigned int count) |
84 | { | 84 | { |
85 | while (count--) { | 85 | while (count--) { |
86 | if (*str == '\n') | 86 | if (*str == '\n') |
87 | ata_midi_out( '\r' ); | 87 | ata_midi_out('\r'); |
88 | ata_midi_out( *str++ ); | 88 | ata_midi_out(*str++); |
89 | } | 89 | } |
90 | } | 90 | } |
91 | 91 | ||
92 | static int ata_par_out (char c) | 92 | static int ata_par_out(char c) |
93 | { | 93 | { |
94 | unsigned char tmp; | 94 | unsigned char tmp; |
95 | /* This a some-seconds timeout in case no printer is connected */ | 95 | /* This a some-seconds timeout in case no printer is connected */ |
96 | unsigned long i = loops_per_jiffy > 1 ? loops_per_jiffy : 10000000/HZ; | 96 | unsigned long i = loops_per_jiffy > 1 ? loops_per_jiffy : 10000000/HZ; |
97 | 97 | ||
98 | while( (mfp.par_dt_reg & 1) && --i ) /* wait for BUSY == L */ | 98 | while ((mfp.par_dt_reg & 1) && --i) /* wait for BUSY == L */ |
99 | ; | 99 | ; |
100 | if (!i) return( 0 ); | 100 | if (!i) |
101 | 101 | return 0; | |
102 | sound_ym.rd_data_reg_sel = 15; /* select port B */ | 102 | |
103 | sound_ym.wd_data = c; /* put char onto port */ | 103 | sound_ym.rd_data_reg_sel = 15; /* select port B */ |
104 | sound_ym.rd_data_reg_sel = 14; /* select port A */ | 104 | sound_ym.wd_data = c; /* put char onto port */ |
105 | tmp = sound_ym.rd_data_reg_sel; | 105 | sound_ym.rd_data_reg_sel = 14; /* select port A */ |
106 | sound_ym.wd_data = tmp & ~0x20; /* set strobe L */ | 106 | tmp = sound_ym.rd_data_reg_sel; |
107 | MFPDELAY(); /* wait a bit */ | 107 | sound_ym.wd_data = tmp & ~0x20; /* set strobe L */ |
108 | sound_ym.wd_data = tmp | 0x20; /* set strobe H */ | 108 | MFPDELAY(); /* wait a bit */ |
109 | return( 1 ); | 109 | sound_ym.wd_data = tmp | 0x20; /* set strobe H */ |
110 | return 1; | ||
110 | } | 111 | } |
111 | 112 | ||
112 | static void atari_par_console_write (struct console *co, const char *str, | 113 | static void atari_par_console_write(struct console *co, const char *str, |
113 | unsigned int count) | 114 | unsigned int count) |
114 | { | 115 | { |
115 | static int printer_present = 1; | 116 | static int printer_present = 1; |
116 | |||
117 | if (!printer_present) | ||
118 | return; | ||
119 | 117 | ||
120 | while (count--) { | 118 | if (!printer_present) |
121 | if (*str == '\n') | ||
122 | if (!ata_par_out( '\r' )) { | ||
123 | printer_present = 0; | ||
124 | return; | 119 | return; |
125 | } | 120 | |
126 | if (!ata_par_out( *str++ )) { | 121 | while (count--) { |
127 | printer_present = 0; | 122 | if (*str == '\n') { |
128 | return; | 123 | if (!ata_par_out('\r')) { |
124 | printer_present = 0; | ||
125 | return; | ||
126 | } | ||
127 | } | ||
128 | if (!ata_par_out(*str++)) { | ||
129 | printer_present = 0; | ||
130 | return; | ||
131 | } | ||
129 | } | 132 | } |
130 | } | ||
131 | } | 133 | } |
132 | 134 | ||
133 | #ifdef CONFIG_SERIAL_CONSOLE | 135 | #ifdef CONFIG_SERIAL_CONSOLE |
134 | int atari_mfp_console_wait_key(struct console *co) | 136 | int atari_mfp_console_wait_key(struct console *co) |
135 | { | 137 | { |
136 | while( !(mfp.rcv_stat & 0x80) ) /* wait for rx buf filled */ | 138 | while (!(mfp.rcv_stat & 0x80)) /* wait for rx buf filled */ |
137 | barrier(); | 139 | barrier(); |
138 | return( mfp.usart_dta ); | 140 | return mfp.usart_dta; |
139 | } | 141 | } |
140 | 142 | ||
141 | int atari_scc_console_wait_key(struct console *co) | 143 | int atari_scc_console_wait_key(struct console *co) |
142 | { | 144 | { |
143 | do { | 145 | do { |
146 | MFPDELAY(); | ||
147 | } while (!(scc.cha_b_ctrl & 0x01)); /* wait for rx buf filled */ | ||
144 | MFPDELAY(); | 148 | MFPDELAY(); |
145 | } while( !(scc.cha_b_ctrl & 0x01) ); /* wait for rx buf filled */ | 149 | return scc.cha_b_data; |
146 | MFPDELAY(); | ||
147 | return( scc.cha_b_data ); | ||
148 | } | 150 | } |
149 | 151 | ||
150 | int atari_midi_console_wait_key(struct console *co) | 152 | int atari_midi_console_wait_key(struct console *co) |
151 | { | 153 | { |
152 | while( !(acia.mid_ctrl & ACIA_RDRF) ) /* wait for rx buf filled */ | 154 | while (!(acia.mid_ctrl & ACIA_RDRF)) /* wait for rx buf filled */ |
153 | barrier(); | 155 | barrier(); |
154 | return( acia.mid_data ); | 156 | return acia.mid_data; |
155 | } | 157 | } |
156 | #endif | 158 | #endif |
157 | 159 | ||
158 | /* The following two functions do a quick'n'dirty initialization of the MFP or | 160 | /* |
161 | * The following two functions do a quick'n'dirty initialization of the MFP or | ||
159 | * SCC serial ports. They're used by the debugging interface, kgdb, and the | 162 | * SCC serial ports. They're used by the debugging interface, kgdb, and the |
160 | * serial console code. */ | 163 | * serial console code. |
164 | */ | ||
161 | #ifndef CONFIG_SERIAL_CONSOLE | 165 | #ifndef CONFIG_SERIAL_CONSOLE |
162 | static void __init atari_init_mfp_port( int cflag ) | 166 | static void __init atari_init_mfp_port(int cflag) |
163 | #else | 167 | #else |
164 | void atari_init_mfp_port( int cflag ) | 168 | void atari_init_mfp_port(int cflag) |
165 | #endif | 169 | #endif |
166 | { | 170 | { |
167 | /* timer values for 1200...115200 bps; > 38400 select 110, 134, or 150 | 171 | /* |
168 | * bps, resp., and work only correct if there's a RSVE or RSSPEED */ | 172 | * timer values for 1200...115200 bps; > 38400 select 110, 134, or 150 |
169 | static int baud_table[9] = { 16, 11, 8, 4, 2, 1, 175, 143, 128 }; | 173 | * bps, resp., and work only correct if there's a RSVE or RSSPEED |
170 | int baud = cflag & CBAUD; | 174 | */ |
171 | int parity = (cflag & PARENB) ? ((cflag & PARODD) ? 0x04 : 0x06) : 0; | 175 | static int baud_table[9] = { 16, 11, 8, 4, 2, 1, 175, 143, 128 }; |
172 | int csize = ((cflag & CSIZE) == CS7) ? 0x20 : 0x00; | 176 | int baud = cflag & CBAUD; |
173 | 177 | int parity = (cflag & PARENB) ? ((cflag & PARODD) ? 0x04 : 0x06) : 0; | |
174 | if (cflag & CBAUDEX) | 178 | int csize = ((cflag & CSIZE) == CS7) ? 0x20 : 0x00; |
175 | baud += B38400; | 179 | |
176 | if (baud < B1200 || baud > B38400+2) | 180 | if (cflag & CBAUDEX) |
177 | baud = B9600; /* use default 9600bps for non-implemented rates */ | 181 | baud += B38400; |
178 | baud -= B1200; /* baud_table[] starts at 1200bps */ | 182 | if (baud < B1200 || baud > B38400+2) |
179 | 183 | baud = B9600; /* use default 9600bps for non-implemented rates */ | |
180 | mfp.trn_stat &= ~0x01; /* disable TX */ | 184 | baud -= B1200; /* baud_table[] starts at 1200bps */ |
181 | mfp.usart_ctr = parity | csize | 0x88; /* 1:16 clk mode, 1 stop bit */ | 185 | |
182 | mfp.tim_ct_cd &= 0x70; /* stop timer D */ | 186 | mfp.trn_stat &= ~0x01; /* disable TX */ |
183 | mfp.tim_dt_d = baud_table[baud]; | 187 | mfp.usart_ctr = parity | csize | 0x88; /* 1:16 clk mode, 1 stop bit */ |
184 | mfp.tim_ct_cd |= 0x01; /* start timer D, 1:4 */ | 188 | mfp.tim_ct_cd &= 0x70; /* stop timer D */ |
185 | mfp.trn_stat |= 0x01; /* enable TX */ | 189 | mfp.tim_dt_d = baud_table[baud]; |
186 | 190 | mfp.tim_ct_cd |= 0x01; /* start timer D, 1:4 */ | |
187 | atari_MFP_init_done = 1; | 191 | mfp.trn_stat |= 0x01; /* enable TX */ |
192 | |||
193 | atari_MFP_init_done = 1; | ||
188 | } | 194 | } |
189 | 195 | ||
190 | #define SCC_WRITE(reg,val) \ | 196 | #define SCC_WRITE(reg, val) \ |
191 | do { \ | 197 | do { \ |
192 | scc.cha_b_ctrl = (reg); \ | 198 | scc.cha_b_ctrl = (reg); \ |
193 | MFPDELAY(); \ | 199 | MFPDELAY(); \ |
194 | scc.cha_b_ctrl = (val); \ | 200 | scc.cha_b_ctrl = (val); \ |
195 | MFPDELAY(); \ | 201 | MFPDELAY(); \ |
196 | } while(0) | 202 | } while (0) |
197 | 203 | ||
198 | /* loops_per_jiffy isn't initialized yet, so we can't use udelay(). This does a | 204 | /* loops_per_jiffy isn't initialized yet, so we can't use udelay(). This does a |
199 | * delay of ~ 60us. */ | 205 | * delay of ~ 60us. */ |
200 | #define LONG_DELAY() \ | 206 | #define LONG_DELAY() \ |
201 | do { \ | 207 | do { \ |
202 | int i; \ | 208 | int i; \ |
203 | for( i = 100; i > 0; --i ) \ | 209 | for (i = 100; i > 0; --i) \ |
204 | MFPDELAY(); \ | 210 | MFPDELAY(); \ |
205 | } while(0) | 211 | } while (0) |
206 | 212 | ||
207 | #ifndef CONFIG_SERIAL_CONSOLE | 213 | #ifndef CONFIG_SERIAL_CONSOLE |
208 | static void __init atari_init_scc_port( int cflag ) | 214 | static void __init atari_init_scc_port(int cflag) |
209 | #else | 215 | #else |
210 | void atari_init_scc_port( int cflag ) | 216 | void atari_init_scc_port(int cflag) |
211 | #endif | 217 | #endif |
212 | { | 218 | { |
213 | extern int atari_SCC_reset_done; | 219 | extern int atari_SCC_reset_done; |
214 | static int clksrc_table[9] = | 220 | static int clksrc_table[9] = |
215 | /* reg 11: 0x50 = BRG, 0x00 = RTxC, 0x28 = TRxC */ | 221 | /* reg 11: 0x50 = BRG, 0x00 = RTxC, 0x28 = TRxC */ |
216 | { 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x00, 0x00 }; | 222 | { 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x00, 0x00 }; |
217 | static int brgsrc_table[9] = | 223 | static int brgsrc_table[9] = |
218 | /* reg 14: 0 = RTxC, 2 = PCLK */ | 224 | /* reg 14: 0 = RTxC, 2 = PCLK */ |
219 | { 2, 2, 2, 2, 2, 2, 0, 2, 2 }; | 225 | { 2, 2, 2, 2, 2, 2, 0, 2, 2 }; |
220 | static int clkmode_table[9] = | 226 | static int clkmode_table[9] = |
221 | /* reg 4: 0x40 = x16, 0x80 = x32, 0xc0 = x64 */ | 227 | /* reg 4: 0x40 = x16, 0x80 = x32, 0xc0 = x64 */ |
222 | { 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0xc0, 0x80 }; | 228 | { 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0xc0, 0x80 }; |
223 | static int div_table[9] = | 229 | static int div_table[9] = |
224 | /* reg12 (BRG low) */ | 230 | /* reg12 (BRG low) */ |
225 | { 208, 138, 103, 50, 24, 11, 1, 0, 0 }; | 231 | { 208, 138, 103, 50, 24, 11, 1, 0, 0 }; |
226 | 232 | ||
227 | int baud = cflag & CBAUD; | 233 | int baud = cflag & CBAUD; |
228 | int clksrc, clkmode, div, reg3, reg5; | 234 | int clksrc, clkmode, div, reg3, reg5; |
229 | 235 | ||
230 | if (cflag & CBAUDEX) | 236 | if (cflag & CBAUDEX) |
231 | baud += B38400; | 237 | baud += B38400; |
232 | if (baud < B1200 || baud > B38400+2) | 238 | if (baud < B1200 || baud > B38400+2) |
233 | baud = B9600; /* use default 9600bps for non-implemented rates */ | 239 | baud = B9600; /* use default 9600bps for non-implemented rates */ |
234 | baud -= B1200; /* tables starts at 1200bps */ | 240 | baud -= B1200; /* tables starts at 1200bps */ |
235 | 241 | ||
236 | clksrc = clksrc_table[baud]; | 242 | clksrc = clksrc_table[baud]; |
237 | clkmode = clkmode_table[baud]; | 243 | clkmode = clkmode_table[baud]; |
238 | div = div_table[baud]; | 244 | div = div_table[baud]; |
239 | if (ATARIHW_PRESENT(TT_MFP) && baud >= 6) { | 245 | if (ATARIHW_PRESENT(TT_MFP) && baud >= 6) { |
240 | /* special treatment for TT, where rates >= 38400 are done via TRxC */ | 246 | /* special treatment for TT, where rates >= 38400 are done via TRxC */ |
241 | clksrc = 0x28; /* TRxC */ | 247 | clksrc = 0x28; /* TRxC */ |
242 | clkmode = baud == 6 ? 0xc0 : | 248 | clkmode = baud == 6 ? 0xc0 : |
243 | baud == 7 ? 0x80 : /* really 76800bps */ | 249 | baud == 7 ? 0x80 : /* really 76800bps */ |
244 | 0x40; /* really 153600bps */ | 250 | 0x40; /* really 153600bps */ |
245 | div = 0; | 251 | div = 0; |
246 | } | 252 | } |
247 | 253 | ||
248 | reg3 = (cflag & CSIZE) == CS8 ? 0xc0 : 0x40; | 254 | reg3 = (cflag & CSIZE) == CS8 ? 0xc0 : 0x40; |
249 | reg5 = (cflag & CSIZE) == CS8 ? 0x60 : 0x20 | 0x82 /* assert DTR/RTS */; | 255 | reg5 = (cflag & CSIZE) == CS8 ? 0x60 : 0x20 | 0x82 /* assert DTR/RTS */; |
250 | 256 | ||
251 | (void)scc.cha_b_ctrl; /* reset reg pointer */ | 257 | (void)scc.cha_b_ctrl; /* reset reg pointer */ |
252 | SCC_WRITE( 9, 0xc0 ); /* reset */ | 258 | SCC_WRITE(9, 0xc0); /* reset */ |
253 | LONG_DELAY(); /* extra delay after WR9 access */ | 259 | LONG_DELAY(); /* extra delay after WR9 access */ |
254 | SCC_WRITE( 4, (cflag & PARENB) ? ((cflag & PARODD) ? 0x01 : 0x03) : 0 | | 260 | SCC_WRITE(4, (cflag & PARENB) ? ((cflag & PARODD) ? 0x01 : 0x03) |
255 | 0x04 /* 1 stopbit */ | | 261 | : 0 | 0x04 /* 1 stopbit */ | clkmode); |
256 | clkmode ); | 262 | SCC_WRITE(3, reg3); |
257 | SCC_WRITE( 3, reg3 ); | 263 | SCC_WRITE(5, reg5); |
258 | SCC_WRITE( 5, reg5 ); | 264 | SCC_WRITE(9, 0); /* no interrupts */ |
259 | SCC_WRITE( 9, 0 ); /* no interrupts */ | 265 | LONG_DELAY(); /* extra delay after WR9 access */ |
260 | LONG_DELAY(); /* extra delay after WR9 access */ | 266 | SCC_WRITE(10, 0); /* NRZ mode */ |
261 | SCC_WRITE( 10, 0 ); /* NRZ mode */ | 267 | SCC_WRITE(11, clksrc); /* main clock source */ |
262 | SCC_WRITE( 11, clksrc ); /* main clock source */ | 268 | SCC_WRITE(12, div); /* BRG value */ |
263 | SCC_WRITE( 12, div ); /* BRG value */ | 269 | SCC_WRITE(13, 0); /* BRG high byte */ |
264 | SCC_WRITE( 13, 0 ); /* BRG high byte */ | 270 | SCC_WRITE(14, brgsrc_table[baud]); |
265 | SCC_WRITE( 14, brgsrc_table[baud] ); | 271 | SCC_WRITE(14, brgsrc_table[baud] | (div ? 1 : 0)); |
266 | SCC_WRITE( 14, brgsrc_table[baud] | (div ? 1 : 0) ); | 272 | SCC_WRITE(3, reg3 | 1); |
267 | SCC_WRITE( 3, reg3 | 1 ); | 273 | SCC_WRITE(5, reg5 | 8); |
268 | SCC_WRITE( 5, reg5 | 8 ); | 274 | |
269 | 275 | atari_SCC_reset_done = 1; | |
270 | atari_SCC_reset_done = 1; | 276 | atari_SCC_init_done = 1; |
271 | atari_SCC_init_done = 1; | ||
272 | } | 277 | } |
273 | 278 | ||
274 | #ifndef CONFIG_SERIAL_CONSOLE | 279 | #ifndef CONFIG_SERIAL_CONSOLE |
275 | static void __init atari_init_midi_port( int cflag ) | 280 | static void __init atari_init_midi_port(int cflag) |
276 | #else | 281 | #else |
277 | void atari_init_midi_port( int cflag ) | 282 | void atari_init_midi_port(int cflag) |
278 | #endif | 283 | #endif |
279 | { | 284 | { |
280 | int baud = cflag & CBAUD; | 285 | int baud = cflag & CBAUD; |
281 | int csize = ((cflag & CSIZE) == CS8) ? 0x10 : 0x00; | 286 | int csize = ((cflag & CSIZE) == CS8) ? 0x10 : 0x00; |
282 | /* warning 7N1 isn't possible! (instead 7O2 is used...) */ | 287 | /* warning 7N1 isn't possible! (instead 7O2 is used...) */ |
283 | int parity = (cflag & PARENB) ? ((cflag & PARODD) ? 0x0c : 0x08) : 0x04; | 288 | int parity = (cflag & PARENB) ? ((cflag & PARODD) ? 0x0c : 0x08) : 0x04; |
284 | int div; | 289 | int div; |
285 | 290 | ||
286 | /* 4800 selects 7812.5, 115200 selects 500000, all other (incl. 9600 as | 291 | /* 4800 selects 7812.5, 115200 selects 500000, all other (incl. 9600 as |
287 | * default) the standard MIDI speed 31250. */ | 292 | * default) the standard MIDI speed 31250. */ |
288 | if (cflag & CBAUDEX) | 293 | if (cflag & CBAUDEX) |
289 | baud += B38400; | 294 | baud += B38400; |
290 | if (baud == B4800) | 295 | if (baud == B4800) |
291 | div = ACIA_DIV64; /* really 7812.5 bps */ | 296 | div = ACIA_DIV64; /* really 7812.5 bps */ |
292 | else if (baud == B38400+2 /* 115200 */) | 297 | else if (baud == B38400+2 /* 115200 */) |
293 | div = ACIA_DIV1; /* really 500 kbps (does that work??) */ | 298 | div = ACIA_DIV1; /* really 500 kbps (does that work??) */ |
294 | else | 299 | else |
295 | div = ACIA_DIV16; /* 31250 bps, standard for MIDI */ | 300 | div = ACIA_DIV16; /* 31250 bps, standard for MIDI */ |
296 | 301 | ||
297 | /* RTS low, ints disabled */ | 302 | /* RTS low, ints disabled */ |
298 | acia.mid_ctrl = div | csize | parity | | 303 | acia.mid_ctrl = div | csize | parity | |
299 | ((atari_switches & ATARI_SWITCH_MIDI) ? | 304 | ((atari_switches & ATARI_SWITCH_MIDI) ? |
300 | ACIA_RHTID : ACIA_RLTID); | 305 | ACIA_RHTID : ACIA_RLTID); |
301 | } | 306 | } |
302 | 307 | ||
303 | void __init atari_debug_init(void) | 308 | void __init atari_debug_init(void) |
304 | { | 309 | { |
305 | if (!strcmp( m68k_debug_device, "ser" )) { | 310 | if (!strcmp(m68k_debug_device, "ser")) { |
306 | /* defaults to ser2 for a Falcon and ser1 otherwise */ | 311 | /* defaults to ser2 for a Falcon and ser1 otherwise */ |
307 | strcpy( m68k_debug_device, MACH_IS_FALCON ? "ser2" : "ser1" ); | 312 | strcpy(m68k_debug_device, MACH_IS_FALCON ? "ser2" : "ser1"); |
308 | 313 | } | |
309 | } | ||
310 | |||
311 | if (!strcmp( m68k_debug_device, "ser1" )) { | ||
312 | /* ST-MFP Modem1 serial port */ | ||
313 | atari_init_mfp_port( B9600|CS8 ); | ||
314 | atari_console_driver.write = atari_mfp_console_write; | ||
315 | } | ||
316 | else if (!strcmp( m68k_debug_device, "ser2" )) { | ||
317 | /* SCC Modem2 serial port */ | ||
318 | atari_init_scc_port( B9600|CS8 ); | ||
319 | atari_console_driver.write = atari_scc_console_write; | ||
320 | } | ||
321 | else if (!strcmp( m68k_debug_device, "midi" )) { | ||
322 | /* MIDI port */ | ||
323 | atari_init_midi_port( B9600|CS8 ); | ||
324 | atari_console_driver.write = atari_midi_console_write; | ||
325 | } | ||
326 | else if (!strcmp( m68k_debug_device, "par" )) { | ||
327 | /* parallel printer */ | ||
328 | atari_turnoff_irq( IRQ_MFP_BUSY ); /* avoid ints */ | ||
329 | sound_ym.rd_data_reg_sel = 7; /* select mixer control */ | ||
330 | sound_ym.wd_data = 0xff; /* sound off, ports are output */ | ||
331 | sound_ym.rd_data_reg_sel = 15; /* select port B */ | ||
332 | sound_ym.wd_data = 0; /* no char */ | ||
333 | sound_ym.rd_data_reg_sel = 14; /* select port A */ | ||
334 | sound_ym.wd_data = sound_ym.rd_data_reg_sel | 0x20; /* strobe H */ | ||
335 | atari_console_driver.write = atari_par_console_write; | ||
336 | } | ||
337 | if (atari_console_driver.write) | ||
338 | register_console(&atari_console_driver); | ||
339 | } | ||
340 | 314 | ||
341 | /* | 315 | if (!strcmp(m68k_debug_device, "ser1")) { |
342 | * Local variables: | 316 | /* ST-MFP Modem1 serial port */ |
343 | * c-indent-level: 4 | 317 | atari_init_mfp_port(B9600|CS8); |
344 | * tab-width: 8 | 318 | atari_console_driver.write = atari_mfp_console_write; |
345 | * End: | 319 | } else if (!strcmp(m68k_debug_device, "ser2")) { |
346 | */ | 320 | /* SCC Modem2 serial port */ |
321 | atari_init_scc_port(B9600|CS8); | ||
322 | atari_console_driver.write = atari_scc_console_write; | ||
323 | } else if (!strcmp(m68k_debug_device, "midi")) { | ||
324 | /* MIDI port */ | ||
325 | atari_init_midi_port(B9600|CS8); | ||
326 | atari_console_driver.write = atari_midi_console_write; | ||
327 | } else if (!strcmp(m68k_debug_device, "par")) { | ||
328 | /* parallel printer */ | ||
329 | atari_turnoff_irq(IRQ_MFP_BUSY); /* avoid ints */ | ||
330 | sound_ym.rd_data_reg_sel = 7; /* select mixer control */ | ||
331 | sound_ym.wd_data = 0xff; /* sound off, ports are output */ | ||
332 | sound_ym.rd_data_reg_sel = 15; /* select port B */ | ||
333 | sound_ym.wd_data = 0; /* no char */ | ||
334 | sound_ym.rd_data_reg_sel = 14; /* select port A */ | ||
335 | sound_ym.wd_data = sound_ym.rd_data_reg_sel | 0x20; /* strobe H */ | ||
336 | atari_console_driver.write = atari_par_console_write; | ||
337 | } | ||
338 | if (atari_console_driver.write) | ||
339 | register_console(&atari_console_driver); | ||
340 | } | ||