| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | /* | 
 | 2 |  * Wrap-around code for a console using the | 
 | 3 |  * SGI PROM io-routines. | 
 | 4 |  * | 
 | 5 |  * Copyright (c) 1999 Ulf Carlsson | 
 | 6 |  * | 
 | 7 |  * Derived from DECstation promcon.c | 
 | 8 |  * Copyright (c) 1998 Harald Koerfgen | 
 | 9 |  */ | 
 | 10 | #include <linux/tty.h> | 
 | 11 | #include <linux/init.h> | 
 | 12 | #include <linux/console.h> | 
 | 13 |  | 
 | 14 | static void prom_console_write(struct console *co, const char *s, | 
 | 15 | 			       unsigned count) | 
 | 16 | { | 
 | 17 | 	extern int CONSOLE_CHANNEL;	// The default serial port | 
 | 18 | 	unsigned i; | 
 | 19 |  | 
 | 20 | 	for (i = 0; i < count; i++) { | 
 | 21 | 		if (*s == 10) | 
 | 22 | 			serial_putc(CONSOLE_CHANNEL, 13); | 
 | 23 | 		serial_putc(CONSOLE_CHANNEL, *s++); | 
 | 24 | 	} | 
 | 25 | } | 
 | 26 |  | 
 | 27 | int prom_getchar(void) | 
 | 28 | { | 
 | 29 | 	return 0; | 
 | 30 | } | 
 | 31 |  | 
 | 32 | static struct console sercons = { | 
 | 33 |     .name	= "ttyS", | 
 | 34 |     .write	= prom_console_write, | 
 | 35 |     .flags	= CON_PRINTBUFFER, | 
 | 36 |     .index	= -1, | 
 | 37 | }; | 
 | 38 |  | 
 | 39 | /* | 
 | 40 |  *    Register console. | 
 | 41 |  */ | 
 | 42 |  | 
 | 43 | static int gal_serial_console_init(void) | 
 | 44 | { | 
 | 45 | 	//  serial_init(); | 
 | 46 | 	//serial_set(115200); | 
 | 47 |  | 
 | 48 | 	register_console(&sercons); | 
 | 49 |  | 
 | 50 | 	return 0; | 
 | 51 | } | 
 | 52 |  | 
 | 53 | console_initcall(gal_serial_console_init); |