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