~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/arch/m68k/atari/debug.c

Version: ~ [ linux-6.11-rc3 ] ~ [ linux-6.10.4 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.45 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.104 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.164 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.223 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.281 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.319 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

Diff markup

Differences between /arch/m68k/atari/debug.c (Version linux-6.11-rc3) and /arch/m68k/atari/debug.c (Version linux-2.6.0)


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

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php