serial.h
上传用户:jlfgdled
上传日期:2013-04-10
资源大小:33168k
文件大小:5k
源码类别:

Linux/Unix编程

开发平台:

Unix_Linux

  1. /*
  2.  * BK Id: %F% %I% %G% %U% %#%
  3.  */
  4. /*
  5.  * include/asm-ppc/serial.h
  6.  */
  7. #ifdef __KERNEL__
  8. #ifndef __ASM_SERIAL_H__
  9. #define __ASM_SERIAL_H__
  10. #include <linux/config.h>
  11. #if defined(CONFIG_GEMINI)
  12. #include <platforms/gemini_serial.h>
  13. #elif defined(CONFIG_SPRUCE)
  14. #include <platforms/spruce.h>
  15. #elif defined(CONFIG_4xx)
  16. #include <asm/ppc4xx_serial.h>
  17. #else
  18. /*
  19.  * This assumes you have a 1.8432 MHz clock for your UART.
  20.  *
  21.  * It'd be nice if someone built a serial card with a 24.576 MHz
  22.  * clock, since the 16550A is capable of handling a top speed of 1.5
  23.  * megabits/second; but this requires the faster clock.
  24.  */
  25. #define BASE_BAUD ( 1843200 / 16 )
  26. #ifdef CONFIG_SERIAL_MANY_PORTS
  27. #define RS_TABLE_SIZE  64
  28. #else
  29. #define RS_TABLE_SIZE  4
  30. #endif
  31. /* Standard COM flags (except for COM4, because of the 8514 problem) */
  32. #ifdef CONFIG_SERIAL_DETECT_IRQ
  33. #define STD_COM_FLAGS (ASYNC_BOOT_AUTOCONF | ASYNC_SKIP_TEST | ASYNC_AUTO_IRQ)
  34. #define STD_COM4_FLAGS (ASYNC_BOOT_AUTOCONF | ASYNC_AUTO_IRQ)
  35. #else
  36. #define STD_COM_FLAGS (ASYNC_BOOT_AUTOCONF | ASYNC_SKIP_TEST)
  37. #define STD_COM4_FLAGS ASYNC_BOOT_AUTOCONF
  38. #endif
  39. #ifdef CONFIG_SERIAL_MANY_PORTS
  40. #define FOURPORT_FLAGS ASYNC_FOURPORT
  41. #define ACCENT_FLAGS 0
  42. #define BOCA_FLAGS 0
  43. #define HUB6_FLAGS 0
  44. #endif
  45. /*
  46.  * The following define the access methods for the HUB6 card. All
  47.  * access is through two ports for all 24 possible chips. The card is
  48.  * selected through the high 2 bits, the port on that card with the
  49.  * "middle" 3 bits, and the register on that port with the bottom
  50.  * 3 bits.
  51.  *
  52.  * While the access port and interrupt is configurable, the default
  53.  * port locations are 0x302 for the port control register, and 0x303
  54.  * for the data read/write register. Normally, the interrupt is at irq3
  55.  * but can be anything from 3 to 7 inclusive. Note that using 3 will
  56.  * require disabling com2.
  57.  */
  58. #define C_P(card,port) (((card)<<6|(port)<<3) + 1)
  59. #define STD_SERIAL_PORT_DEFNS
  60. /* UART CLK   PORT IRQ     FLAGS        */
  61. { 0, BASE_BAUD, 0x3F8, 4, STD_COM_FLAGS }, /* ttyS0 */
  62. { 0, BASE_BAUD, 0x2F8, 3, STD_COM_FLAGS }, /* ttyS1 */
  63. { 0, BASE_BAUD, 0x3E8, 4, STD_COM_FLAGS }, /* ttyS2 */
  64. { 0, BASE_BAUD, 0x2E8, 3, STD_COM4_FLAGS }, /* ttyS3 */
  65. #ifdef CONFIG_SERIAL_MANY_PORTS
  66. #define EXTRA_SERIAL_PORT_DEFNS
  67. { 0, BASE_BAUD, 0x1A0, 9, FOURPORT_FLAGS },  /* ttyS4 */
  68. { 0, BASE_BAUD, 0x1A8, 9, FOURPORT_FLAGS }, /* ttyS5 */
  69. { 0, BASE_BAUD, 0x1B0, 9, FOURPORT_FLAGS }, /* ttyS6 */
  70. { 0, BASE_BAUD, 0x1B8, 9, FOURPORT_FLAGS }, /* ttyS7 */
  71. { 0, BASE_BAUD, 0x2A0, 5, FOURPORT_FLAGS }, /* ttyS8 */
  72. { 0, BASE_BAUD, 0x2A8, 5, FOURPORT_FLAGS }, /* ttyS9 */
  73. { 0, BASE_BAUD, 0x2B0, 5, FOURPORT_FLAGS }, /* ttyS10 */
  74. { 0, BASE_BAUD, 0x2B8, 5, FOURPORT_FLAGS }, /* ttyS11 */
  75. { 0, BASE_BAUD, 0x330, 4, ACCENT_FLAGS }, /* ttyS12 */
  76. { 0, BASE_BAUD, 0x338, 4, ACCENT_FLAGS }, /* ttyS13 */
  77. { 0, BASE_BAUD, 0x000, 0, 0 }, /* ttyS14 (spare) */
  78. { 0, BASE_BAUD, 0x000, 0, 0 }, /* ttyS15 (spare) */
  79. { 0, BASE_BAUD, 0x100, 12, BOCA_FLAGS }, /* ttyS16 */
  80. { 0, BASE_BAUD, 0x108, 12, BOCA_FLAGS }, /* ttyS17 */
  81. { 0, BASE_BAUD, 0x110, 12, BOCA_FLAGS }, /* ttyS18 */
  82. { 0, BASE_BAUD, 0x118, 12, BOCA_FLAGS }, /* ttyS19 */
  83. { 0, BASE_BAUD, 0x120, 12, BOCA_FLAGS }, /* ttyS20 */
  84. { 0, BASE_BAUD, 0x128, 12, BOCA_FLAGS }, /* ttyS21 */
  85. { 0, BASE_BAUD, 0x130, 12, BOCA_FLAGS }, /* ttyS22 */
  86. { 0, BASE_BAUD, 0x138, 12, BOCA_FLAGS }, /* ttyS23 */
  87. { 0, BASE_BAUD, 0x140, 12, BOCA_FLAGS }, /* ttyS24 */
  88. { 0, BASE_BAUD, 0x148, 12, BOCA_FLAGS }, /* ttyS25 */
  89. { 0, BASE_BAUD, 0x150, 12, BOCA_FLAGS }, /* ttyS26 */
  90. { 0, BASE_BAUD, 0x158, 12, BOCA_FLAGS }, /* ttyS27 */
  91. { 0, BASE_BAUD, 0x160, 12, BOCA_FLAGS }, /* ttyS28 */
  92. { 0, BASE_BAUD, 0x168, 12, BOCA_FLAGS }, /* ttyS29 */
  93. { 0, BASE_BAUD, 0x170, 12, BOCA_FLAGS }, /* ttyS30 */
  94. { 0, BASE_BAUD, 0x178, 12, BOCA_FLAGS }, /* ttyS31 */
  95. #else
  96. #define EXTRA_SERIAL_PORT_DEFNS
  97. #endif
  98. /* You can have up to four HUB6's in the system, but I've only
  99.  * included two cards here for a total of twelve ports.
  100.  */
  101. #if (defined(CONFIG_HUB6) && defined(CONFIG_SERIAL_MANY_PORTS))
  102. #define HUB6_SERIAL_PORT_DFNS
  103. { 0, BASE_BAUD, 0x302, 3, HUB6_FLAGS, C_P(0,0) },  /* ttyS32 */
  104. { 0, BASE_BAUD, 0x302, 3, HUB6_FLAGS, C_P(0,1) },  /* ttyS33 */
  105. { 0, BASE_BAUD, 0x302, 3, HUB6_FLAGS, C_P(0,2) },  /* ttyS34 */
  106. { 0, BASE_BAUD, 0x302, 3, HUB6_FLAGS, C_P(0,3) },  /* ttyS35 */
  107. { 0, BASE_BAUD, 0x302, 3, HUB6_FLAGS, C_P(0,4) },  /* ttyS36 */
  108. { 0, BASE_BAUD, 0x302, 3, HUB6_FLAGS, C_P(0,5) },  /* ttyS37 */
  109. { 0, BASE_BAUD, 0x302, 3, HUB6_FLAGS, C_P(1,0) },  /* ttyS38 */
  110. { 0, BASE_BAUD, 0x302, 3, HUB6_FLAGS, C_P(1,1) },  /* ttyS39 */
  111. { 0, BASE_BAUD, 0x302, 3, HUB6_FLAGS, C_P(1,2) },  /* ttyS40 */
  112. { 0, BASE_BAUD, 0x302, 3, HUB6_FLAGS, C_P(1,3) },  /* ttyS41 */
  113. { 0, BASE_BAUD, 0x302, 3, HUB6_FLAGS, C_P(1,4) },  /* ttyS42 */
  114. { 0, BASE_BAUD, 0x302, 3, HUB6_FLAGS, C_P(1,5) },  /* ttyS43 */
  115. #else
  116. #define HUB6_SERIAL_PORT_DFNS
  117. #endif
  118. #define MCA_SERIAL_PORT_DFNS
  119. #define SERIAL_PORT_DFNS
  120. STD_SERIAL_PORT_DEFNS
  121. EXTRA_SERIAL_PORT_DEFNS
  122. HUB6_SERIAL_PORT_DFNS
  123. MCA_SERIAL_PORT_DFNS
  124. #endif /* !CONFIG_GEMINI and others */
  125. #endif /* __ASM_SERIAL_H__ */
  126. #endif /* __KERNEL__ */