Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | /* |
| 2 | * linux/arch/m68k/mac/debug.c |
| 3 | * |
| 4 | * Shamelessly stolen (SCC code and general framework) from: |
| 5 | * |
| 6 | * linux/arch/m68k/atari/debug.c |
| 7 | * |
| 8 | * Atari debugging and serial console stuff |
| 9 | * |
| 10 | * Assembled of parts of former atari/config.c 97-12-18 by Roman Hodek |
| 11 | * |
| 12 | * This file is subject to the terms and conditions of the GNU General Public |
| 13 | * License. See the file COPYING in the main directory of this archive |
| 14 | * for more details. |
| 15 | */ |
| 16 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 17 | #include <linux/types.h> |
| 18 | #include <linux/sched.h> |
| 19 | #include <linux/tty.h> |
| 20 | #include <linux/console.h> |
| 21 | #include <linux/init.h> |
| 22 | #include <linux/delay.h> |
| 23 | |
| 24 | #define BOOTINFO_COMPAT_1_0 |
| 25 | #include <asm/setup.h> |
| 26 | #include <asm/bootinfo.h> |
| 27 | #include <asm/machw.h> |
| 28 | #include <asm/macints.h> |
| 29 | |
| 30 | extern char m68k_debug_device[]; |
| 31 | |
| 32 | extern struct compat_bootinfo compat_boot_info; |
| 33 | |
| 34 | extern unsigned long mac_videobase; |
| 35 | extern unsigned long mac_videodepth; |
| 36 | extern unsigned long mac_rowbytes; |
| 37 | |
| 38 | extern void mac_serial_print(const char *); |
| 39 | |
| 40 | #define DEBUG_HEADS |
| 41 | #undef DEBUG_SCREEN |
| 42 | #define DEBUG_SERIAL |
| 43 | |
| 44 | /* |
| 45 | * These two auxiliary debug functions should go away ASAP. Only usage: |
| 46 | * before the console output is up (after head.S come some other crucial |
| 47 | * setup routines :-) it permits writing 'data' to the screen as bit patterns |
| 48 | * (good luck reading those). Helped to figure that the bootinfo contained |
| 49 | * garbage data on the amount and size of memory chunks ... |
| 50 | * |
| 51 | * The 'pos' argument now simply means 'linefeed after print' ... |
| 52 | */ |
| 53 | |
| 54 | #ifdef DEBUG_SCREEN |
Roman Zippel | 6ff5801 | 2007-05-01 22:32:43 +0200 | [diff] [blame^] | 55 | static int peng, line; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 56 | #endif |
| 57 | |
| 58 | void mac_debugging_short(int pos, short num) |
| 59 | { |
| 60 | #ifdef DEBUG_SCREEN |
| 61 | unsigned char *pengoffset; |
| 62 | unsigned char *pptr; |
| 63 | int i; |
| 64 | #endif |
| 65 | |
| 66 | #ifdef DEBUG_SERIAL |
| 67 | printk("debug: %d !\n", num); |
| 68 | #endif |
| 69 | |
| 70 | #ifdef DEBUG_SCREEN |
| 71 | if (!MACH_IS_MAC) { |
| 72 | /* printk("debug: %d !\n", num); */ |
| 73 | return; |
| 74 | } |
| 75 | |
| 76 | /* calculate current offset */ |
Roman Zippel | 6ff5801 | 2007-05-01 22:32:43 +0200 | [diff] [blame^] | 77 | pengoffset = (unsigned char *)mac_videobase + |
| 78 | (150+line*2) * mac_rowbytes) + 80 * peng; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 79 | |
Roman Zippel | 6ff5801 | 2007-05-01 22:32:43 +0200 | [diff] [blame^] | 80 | pptr = pengoffset; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 81 | |
Roman Zippel | 6ff5801 | 2007-05-01 22:32:43 +0200 | [diff] [blame^] | 82 | for (i = 0; i < 8 * sizeof(short); i++) { /* # of bits */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 83 | /* value mask for bit i, reverse order */ |
Roman Zippel | 6ff5801 | 2007-05-01 22:32:43 +0200 | [diff] [blame^] | 84 | *pptr++ = (num & (1 << (8*sizeof(short)-i-1)) ? 0xFF : 0x00); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 85 | } |
| 86 | |
| 87 | peng++; |
| 88 | |
| 89 | if (pos) { |
| 90 | line++; |
| 91 | peng = 0; |
| 92 | } |
| 93 | #endif |
| 94 | } |
| 95 | |
| 96 | void mac_debugging_long(int pos, long addr) |
| 97 | { |
| 98 | #ifdef DEBUG_SCREEN |
| 99 | unsigned char *pengoffset; |
| 100 | unsigned char *pptr; |
| 101 | int i; |
| 102 | #endif |
| 103 | |
| 104 | #ifdef DEBUG_SERIAL |
| 105 | printk("debug: #%ld !\n", addr); |
| 106 | #endif |
| 107 | |
| 108 | #ifdef DEBUG_SCREEN |
| 109 | if (!MACH_IS_MAC) { |
| 110 | /* printk("debug: #%ld !\n", addr); */ |
| 111 | return; |
| 112 | } |
| 113 | |
| 114 | pengoffset=(unsigned char *)(mac_videobase+(150+line*2)*mac_rowbytes) |
| 115 | +80*peng; |
| 116 | |
Roman Zippel | 6ff5801 | 2007-05-01 22:32:43 +0200 | [diff] [blame^] | 117 | pptr = pengoffset; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 118 | |
Roman Zippel | 6ff5801 | 2007-05-01 22:32:43 +0200 | [diff] [blame^] | 119 | for (i = 0; i < 8 * sizeof(long); i++) { /* # of bits */ |
| 120 | *pptr++ = (addr & (1 << (8*sizeof(long)-i-1)) ? 0xFF : 0x00); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 121 | } |
| 122 | |
| 123 | peng++; |
| 124 | |
| 125 | if (pos) { |
| 126 | line++; |
| 127 | peng = 0; |
| 128 | } |
| 129 | #endif |
| 130 | } |
| 131 | |
| 132 | #ifdef DEBUG_SERIAL |
| 133 | /* |
| 134 | * TODO: serial debug code |
| 135 | */ |
| 136 | |
Roman Zippel | 6ff5801 | 2007-05-01 22:32:43 +0200 | [diff] [blame^] | 137 | struct mac_SCC { |
| 138 | u_char cha_b_ctrl; |
| 139 | u_char char_dummy1; |
| 140 | u_char cha_a_ctrl; |
| 141 | u_char char_dummy2; |
| 142 | u_char cha_b_data; |
| 143 | u_char char_dummy3; |
| 144 | u_char cha_a_data; |
| 145 | }; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 146 | |
| 147 | # define scc (*((volatile struct mac_SCC*)mac_bi_data.sccbase)) |
| 148 | |
| 149 | /* Flag that serial port is already initialized and used */ |
| 150 | int mac_SCC_init_done; |
| 151 | /* Can be set somewhere, if a SCC master reset has already be done and should |
| 152 | * not be repeated; used by kgdb */ |
| 153 | int mac_SCC_reset_done; |
| 154 | |
| 155 | static int scc_port = -1; |
| 156 | |
| 157 | static struct console mac_console_driver = { |
Roman Zippel | 6ff5801 | 2007-05-01 22:32:43 +0200 | [diff] [blame^] | 158 | .name = "debug", |
| 159 | .flags = CON_PRINTBUFFER, |
| 160 | .index = -1, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 161 | }; |
| 162 | |
| 163 | /* |
| 164 | * Crude hack to get console output to the screen before the framebuffer |
| 165 | * is initialized (happens a lot later in 2.1!). |
| 166 | * We just use the console routines declared in head.S, this will interfere |
| 167 | * with regular framebuffer console output and should be used exclusively |
| 168 | * to debug kernel problems manifesting before framebuffer init (aka WSOD) |
| 169 | * |
| 170 | * To keep this hack from interfering with the regular console driver, either |
| 171 | * deregister this driver before/on framebuffer console init, or silence this |
| 172 | * function after the fbcon driver is running (will lose console messages!?). |
| 173 | * To debug real early bugs, need to write a 'mac_register_console_hack()' |
| 174 | * that is called from start_kernel() before setup_arch() and just registers |
| 175 | * this driver if Mac. |
| 176 | */ |
| 177 | |
Roman Zippel | 6ff5801 | 2007-05-01 22:32:43 +0200 | [diff] [blame^] | 178 | void mac_debug_console_write(struct console *co, const char *str, |
| 179 | unsigned int count) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 180 | { |
| 181 | mac_serial_print(str); |
| 182 | } |
| 183 | |
| 184 | |
| 185 | |
| 186 | /* Mac: loops_per_jiffy min. 19000 ^= .5 us; MFPDELAY was 0.6 us*/ |
| 187 | |
| 188 | #define uSEC 1 |
| 189 | |
Roman Zippel | 6ff5801 | 2007-05-01 22:32:43 +0200 | [diff] [blame^] | 190 | static inline void mac_sccb_out(char c) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 191 | { |
Roman Zippel | 6ff5801 | 2007-05-01 22:32:43 +0200 | [diff] [blame^] | 192 | int i; |
| 193 | |
| 194 | do { |
| 195 | for (i = uSEC; i > 0; --i) |
| 196 | barrier(); |
| 197 | } while (!(scc.cha_b_ctrl & 0x04)); /* wait for tx buf empty */ |
| 198 | for (i = uSEC; i > 0; --i) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 199 | barrier(); |
Roman Zippel | 6ff5801 | 2007-05-01 22:32:43 +0200 | [diff] [blame^] | 200 | scc.cha_b_data = c; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 201 | } |
| 202 | |
Roman Zippel | 6ff5801 | 2007-05-01 22:32:43 +0200 | [diff] [blame^] | 203 | static inline void mac_scca_out(char c) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 204 | { |
Roman Zippel | 6ff5801 | 2007-05-01 22:32:43 +0200 | [diff] [blame^] | 205 | int i; |
| 206 | |
| 207 | do { |
| 208 | for (i = uSEC; i > 0; --i) |
| 209 | barrier(); |
| 210 | } while (!(scc.cha_a_ctrl & 0x04)); /* wait for tx buf empty */ |
| 211 | for (i = uSEC; i > 0; --i) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 212 | barrier(); |
Roman Zippel | 6ff5801 | 2007-05-01 22:32:43 +0200 | [diff] [blame^] | 213 | scc.cha_a_data = c; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 214 | } |
| 215 | |
Roman Zippel | 6ff5801 | 2007-05-01 22:32:43 +0200 | [diff] [blame^] | 216 | void mac_sccb_console_write(struct console *co, const char *str, |
| 217 | unsigned int count) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 218 | { |
Roman Zippel | 6ff5801 | 2007-05-01 22:32:43 +0200 | [diff] [blame^] | 219 | while (count--) { |
| 220 | if (*str == '\n') |
| 221 | mac_sccb_out('\r'); |
| 222 | mac_sccb_out(*str++); |
| 223 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 224 | } |
| 225 | |
Roman Zippel | 6ff5801 | 2007-05-01 22:32:43 +0200 | [diff] [blame^] | 226 | void mac_scca_console_write(struct console *co, const char *str, |
| 227 | unsigned int count) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 228 | { |
Roman Zippel | 6ff5801 | 2007-05-01 22:32:43 +0200 | [diff] [blame^] | 229 | while (count--) { |
| 230 | if (*str == '\n') |
| 231 | mac_scca_out('\r'); |
| 232 | mac_scca_out(*str++); |
| 233 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 234 | } |
| 235 | |
| 236 | |
| 237 | /* The following two functions do a quick'n'dirty initialization of the MFP or |
| 238 | * SCC serial ports. They're used by the debugging interface, kgdb, and the |
| 239 | * serial console code. */ |
| 240 | #define SCCB_WRITE(reg,val) \ |
Roman Zippel | 6ff5801 | 2007-05-01 22:32:43 +0200 | [diff] [blame^] | 241 | do { \ |
| 242 | int i; \ |
| 243 | scc.cha_b_ctrl = (reg); \ |
| 244 | for (i = uSEC; i > 0; --i) \ |
| 245 | barrier(); \ |
| 246 | scc.cha_b_ctrl = (val); \ |
| 247 | for (i = uSEC; i > 0; --i) \ |
| 248 | barrier(); \ |
| 249 | } while(0) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 250 | |
| 251 | #define SCCA_WRITE(reg,val) \ |
Roman Zippel | 6ff5801 | 2007-05-01 22:32:43 +0200 | [diff] [blame^] | 252 | do { \ |
| 253 | int i; \ |
| 254 | scc.cha_a_ctrl = (reg); \ |
| 255 | for (i = uSEC; i > 0; --i) \ |
| 256 | barrier(); \ |
| 257 | scc.cha_a_ctrl = (val); \ |
| 258 | for (i = uSEC; i > 0; --i) \ |
| 259 | barrier(); \ |
| 260 | } while(0) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 261 | |
| 262 | /* loops_per_jiffy isn't initialized yet, so we can't use udelay(). This does a |
| 263 | * delay of ~ 60us. */ |
| 264 | /* Mac: loops_per_jiffy min. 19000 ^= .5 us; MFPDELAY was 0.6 us*/ |
Roman Zippel | 6ff5801 | 2007-05-01 22:32:43 +0200 | [diff] [blame^] | 265 | #define LONG_DELAY() \ |
| 266 | do { \ |
| 267 | int i; \ |
| 268 | for (i = 60*uSEC; i > 0; --i) \ |
| 269 | barrier(); \ |
| 270 | } while(0) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 271 | |
| 272 | #ifndef CONFIG_SERIAL_CONSOLE |
Roman Zippel | 6ff5801 | 2007-05-01 22:32:43 +0200 | [diff] [blame^] | 273 | static void __init mac_init_scc_port(int cflag, int port) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 274 | #else |
Roman Zippel | 6ff5801 | 2007-05-01 22:32:43 +0200 | [diff] [blame^] | 275 | void mac_init_scc_port(int cflag, int port) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 276 | #endif |
| 277 | { |
| 278 | extern int mac_SCC_reset_done; |
| 279 | |
| 280 | /* |
| 281 | * baud rates: 1200, 1800, 2400, 4800, 9600, 19.2k, 38.4k, 57.6k, 115.2k |
| 282 | */ |
| 283 | |
| 284 | static int clksrc_table[9] = |
| 285 | /* reg 11: 0x50 = BRG, 0x00 = RTxC, 0x28 = TRxC */ |
| 286 | { 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x00, 0x00 }; |
| 287 | static int clkmode_table[9] = |
| 288 | /* reg 4: 0x40 = x16, 0x80 = x32, 0xc0 = x64 */ |
| 289 | { 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0xc0, 0x80 }; |
| 290 | static int div_table[9] = |
| 291 | /* reg12 (BRG low) */ |
| 292 | { 94, 62, 46, 22, 10, 4, 1, 0, 0 }; |
| 293 | |
Roman Zippel | 6ff5801 | 2007-05-01 22:32:43 +0200 | [diff] [blame^] | 294 | int baud = cflag & CBAUD; |
| 295 | int clksrc, clkmode, div, reg3, reg5; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 296 | |
Roman Zippel | 6ff5801 | 2007-05-01 22:32:43 +0200 | [diff] [blame^] | 297 | if (cflag & CBAUDEX) |
| 298 | baud += B38400; |
| 299 | if (baud < B1200 || baud > B38400+2) |
| 300 | baud = B9600; /* use default 9600bps for non-implemented rates */ |
| 301 | baud -= B1200; /* tables starts at 1200bps */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 302 | |
Roman Zippel | 6ff5801 | 2007-05-01 22:32:43 +0200 | [diff] [blame^] | 303 | clksrc = clksrc_table[baud]; |
| 304 | clkmode = clkmode_table[baud]; |
| 305 | div = div_table[baud]; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 306 | |
Roman Zippel | 6ff5801 | 2007-05-01 22:32:43 +0200 | [diff] [blame^] | 307 | reg3 = (((cflag & CSIZE) == CS8) ? 0xc0 : 0x40); |
| 308 | reg5 = (((cflag & CSIZE) == CS8) ? 0x60 : 0x20) | 0x82 /* assert DTR/RTS */; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 309 | |
Roman Zippel | 6ff5801 | 2007-05-01 22:32:43 +0200 | [diff] [blame^] | 310 | if (port == 1) { |
| 311 | (void)scc.cha_b_ctrl; /* reset reg pointer */ |
| 312 | SCCB_WRITE(9, 0xc0); /* reset */ |
| 313 | LONG_DELAY(); /* extra delay after WR9 access */ |
| 314 | SCCB_WRITE(4, (cflag & PARENB) ? ((cflag & PARODD) ? 0x01 : 0x03) : 0 | |
| 315 | 0x04 /* 1 stopbit */ | |
| 316 | clkmode); |
| 317 | SCCB_WRITE(3, reg3); |
| 318 | SCCB_WRITE(5, reg5); |
| 319 | SCCB_WRITE(9, 0); /* no interrupts */ |
| 320 | LONG_DELAY(); /* extra delay after WR9 access */ |
| 321 | SCCB_WRITE(10, 0); /* NRZ mode */ |
| 322 | SCCB_WRITE(11, clksrc); /* main clock source */ |
| 323 | SCCB_WRITE(12, div); /* BRG value */ |
| 324 | SCCB_WRITE(13, 0); /* BRG high byte */ |
| 325 | SCCB_WRITE(14, 1); |
| 326 | SCCB_WRITE(3, reg3 | 1); |
| 327 | SCCB_WRITE(5, reg5 | 8); |
| 328 | } else if (port == 0) { |
| 329 | (void)scc.cha_a_ctrl; /* reset reg pointer */ |
| 330 | SCCA_WRITE(9, 0xc0); /* reset */ |
| 331 | LONG_DELAY(); /* extra delay after WR9 access */ |
| 332 | SCCA_WRITE(4, (cflag & PARENB) ? ((cflag & PARODD) ? 0x01 : 0x03) : 0 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 333 | 0x04 /* 1 stopbit */ | |
Roman Zippel | 6ff5801 | 2007-05-01 22:32:43 +0200 | [diff] [blame^] | 334 | clkmode); |
| 335 | SCCA_WRITE(3, reg3); |
| 336 | SCCA_WRITE(5, reg5); |
| 337 | SCCA_WRITE(9, 0); /* no interrupts */ |
| 338 | LONG_DELAY(); /* extra delay after WR9 access */ |
| 339 | SCCA_WRITE(10, 0); /* NRZ mode */ |
| 340 | SCCA_WRITE(11, clksrc); /* main clock source */ |
| 341 | SCCA_WRITE(12, div); /* BRG value */ |
| 342 | SCCA_WRITE(13, 0); /* BRG high byte */ |
| 343 | SCCA_WRITE(14, 1); |
| 344 | SCCA_WRITE(3, reg3 | 1); |
| 345 | SCCA_WRITE(5, reg5 | 8); |
| 346 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 347 | |
Roman Zippel | 6ff5801 | 2007-05-01 22:32:43 +0200 | [diff] [blame^] | 348 | mac_SCC_reset_done = 1; |
| 349 | mac_SCC_init_done = 1; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 350 | } |
| 351 | #endif /* DEBUG_SERIAL */ |
| 352 | |
Roman Zippel | 6ff5801 | 2007-05-01 22:32:43 +0200 | [diff] [blame^] | 353 | void mac_init_scca_port(int cflag) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 354 | { |
| 355 | mac_init_scc_port(cflag, 0); |
| 356 | } |
| 357 | |
Roman Zippel | 6ff5801 | 2007-05-01 22:32:43 +0200 | [diff] [blame^] | 358 | void mac_init_sccb_port(int cflag) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 359 | { |
| 360 | mac_init_scc_port(cflag, 1); |
| 361 | } |
| 362 | |
| 363 | void __init mac_debug_init(void) |
| 364 | { |
| 365 | #ifdef DEBUG_SERIAL |
Roman Zippel | 6ff5801 | 2007-05-01 22:32:43 +0200 | [diff] [blame^] | 366 | if (!strcmp(m68k_debug_device, "ser") || |
| 367 | !strcmp(m68k_debug_device, "ser1")) { |
| 368 | /* Mac modem port */ |
| 369 | mac_init_scc_port(B9600|CS8, 0); |
| 370 | mac_console_driver.write = mac_scca_console_write; |
| 371 | scc_port = 0; |
| 372 | } else if (!strcmp(m68k_debug_device, "ser2")) { |
| 373 | /* Mac printer port */ |
| 374 | mac_init_scc_port(B9600|CS8, 1); |
| 375 | mac_console_driver.write = mac_sccb_console_write; |
| 376 | scc_port = 1; |
| 377 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 378 | #endif |
| 379 | #ifdef DEBUG_HEADS |
Roman Zippel | 6ff5801 | 2007-05-01 22:32:43 +0200 | [diff] [blame^] | 380 | if (!strcmp(m68k_debug_device, "scn") || |
| 381 | !strcmp(m68k_debug_device, "con")) { |
| 382 | /* display, using head.S console routines */ |
| 383 | mac_console_driver.write = mac_debug_console_write; |
| 384 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 385 | #endif |
Roman Zippel | 6ff5801 | 2007-05-01 22:32:43 +0200 | [diff] [blame^] | 386 | if (mac_console_driver.write) |
| 387 | register_console(&mac_console_driver); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 388 | } |