decserial.c 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  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. #include <linux/init.h>
  19. #include <asm/dec/machtype.h>
  20. #ifdef CONFIG_ZS
  21. extern int zs_init(void);
  22. #endif
  23. #ifdef CONFIG_DZ
  24. extern int dz_init(void);
  25. #endif
  26. #ifdef CONFIG_SERIAL_CONSOLE
  27. #ifdef CONFIG_ZS
  28. extern void zs_serial_console_init(void);
  29. #endif
  30. #ifdef CONFIG_DZ
  31. extern void dz_serial_console_init(void);
  32. #endif
  33. #endif
  34. /* rs_init - starts up the serial interface -
  35. handle normal case of starting up the serial interface */
  36. #ifdef CONFIG_SERIAL
  37. int __init rs_init(void)
  38. {
  39. #if defined(CONFIG_ZS) && defined(CONFIG_DZ)
  40. if (IOASIC)
  41. return zs_init();
  42. else
  43. return dz_init();
  44. #else
  45. #ifdef CONFIG_ZS
  46. return zs_init();
  47. #endif
  48. #ifdef CONFIG_DZ
  49. return dz_init();
  50. #endif
  51. #endif
  52. }
  53. __initcall(rs_init);
  54. #endif
  55. #ifdef CONFIG_SERIAL_CONSOLE
  56. /* serial_console_init handles the special case of starting
  57. * up the console on the serial port
  58. */
  59. static int __init decserial_console_init(void)
  60. {
  61. #if defined(CONFIG_ZS) && defined(CONFIG_DZ)
  62. if (IOASIC)
  63. zs_serial_console_init();
  64. else
  65. dz_serial_console_init();
  66. #else
  67. #ifdef CONFIG_ZS
  68. zs_serial_console_init();
  69. #endif
  70. #ifdef CONFIG_DZ
  71. dz_serial_console_init();
  72. #endif
  73. #endif
  74. return 0;
  75. }
  76. console_initcall(decserial_console_init);
  77. #endif