Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | /* |
| 2 | * sercons.c |
| 3 | * choose the right serial device at boot time |
| 4 | * |
| 5 | * triemer 6-SEP-1998 |
| 6 | * sercons.c is designed to allow the three different kinds |
| 7 | * of serial devices under the decstation world to co-exist |
| 8 | * in the same kernel. The idea here is to abstract |
| 9 | * the pieces of the drivers that are common to this file |
| 10 | * so that they do not clash at compile time and runtime. |
| 11 | * |
| 12 | * HK 16-SEP-1998 v0.002 |
| 13 | * removed the PROM console as this is not a real serial |
| 14 | * device. Added support for PROM console in drivers/char/tty_io.c |
| 15 | * instead. Although it may work to enable more than one |
| 16 | * console device I strongly recommend to use only one. |
| 17 | */ |
| 18 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 19 | #include <linux/init.h> |
| 20 | #include <asm/dec/machtype.h> |
| 21 | |
| 22 | #ifdef CONFIG_ZS |
| 23 | extern int zs_init(void); |
| 24 | #endif |
| 25 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 26 | #ifdef CONFIG_SERIAL_CONSOLE |
| 27 | |
| 28 | #ifdef CONFIG_ZS |
| 29 | extern void zs_serial_console_init(void); |
| 30 | #endif |
| 31 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 32 | #endif |
| 33 | |
| 34 | /* rs_init - starts up the serial interface - |
| 35 | handle normal case of starting up the serial interface */ |
| 36 | |
| 37 | #ifdef CONFIG_SERIAL |
| 38 | |
| 39 | int __init rs_init(void) |
| 40 | { |
Maciej W. Rozycki | 9399575 | 2006-12-06 20:38:59 -0800 | [diff] [blame] | 41 | #ifdef CONFIG_ZS |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 42 | if (IOASIC) |
| 43 | return zs_init(); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 44 | #endif |
Maciej W. Rozycki | 9399575 | 2006-12-06 20:38:59 -0800 | [diff] [blame] | 45 | return -ENXIO; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 46 | } |
| 47 | |
| 48 | __initcall(rs_init); |
| 49 | |
| 50 | #endif |
| 51 | |
| 52 | #ifdef CONFIG_SERIAL_CONSOLE |
| 53 | |
| 54 | /* serial_console_init handles the special case of starting |
| 55 | * up the console on the serial port |
| 56 | */ |
| 57 | static int __init decserial_console_init(void) |
| 58 | { |
Maciej W. Rozycki | 9399575 | 2006-12-06 20:38:59 -0800 | [diff] [blame] | 59 | #ifdef CONFIG_ZS |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 60 | if (IOASIC) |
| 61 | zs_serial_console_init(); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 62 | #endif |
| 63 | return 0; |
| 64 | } |
| 65 | console_initcall(decserial_console_init); |
| 66 | |
| 67 | #endif |