m32r_sio_reg.h 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  1. /*
  2. * m32r_sio_reg.h
  3. *
  4. * Copyright (C) 1992, 1994 by Theodore Ts'o.
  5. * Copyright (C) 2004 Hirokazu Takata <takata at linux-m32r.org>
  6. *
  7. * Redistribution of this file is permitted under the terms of the GNU
  8. * Public License (GPL)
  9. *
  10. * These are the UART port assignments, expressed as offsets from the base
  11. * register. These assignments should hold for any serial port based on
  12. * a 8250, 16450, or 16550(A).
  13. */
  14. #ifndef _M32R_SIO_REG_H
  15. #define _M32R_SIO_REG_H
  16. #include <linux/config.h>
  17. #ifdef CONFIG_SERIAL_M32R_PLDSIO
  18. #define SIOCR 0x000
  19. #define SIOMOD0 0x002
  20. #define SIOMOD1 0x004
  21. #define SIOSTS 0x006
  22. #define SIOTRCR 0x008
  23. #define SIOBAUR 0x00a
  24. // #define SIORBAUR 0x018
  25. #define SIOTXB 0x00c
  26. #define SIORXB 0x00e
  27. #define UART_RX ((unsigned long) PLD_ESIO0RXB)
  28. /* In: Receive buffer (DLAB=0) */
  29. #define UART_TX ((unsigned long) PLD_ESIO0TXB)
  30. /* Out: Transmit buffer (DLAB=0) */
  31. #define UART_DLL 0 /* Out: Divisor Latch Low (DLAB=1) */
  32. #define UART_TRG 0 /* (LCR=BF) FCTR bit 7 selects Rx or Tx
  33. * In: Fifo count
  34. * Out: Fifo custom trigger levels
  35. * XR16C85x only */
  36. #define UART_DLM 0 /* Out: Divisor Latch High (DLAB=1) */
  37. #define UART_IER ((unsigned long) PLD_ESIO0INTCR)
  38. /* Out: Interrupt Enable Register */
  39. #define UART_FCTR 0 /* (LCR=BF) Feature Control Register
  40. * XR16C85x only */
  41. #define UART_IIR 0 /* In: Interrupt ID Register */
  42. #define UART_FCR 0 /* Out: FIFO Control Register */
  43. #define UART_EFR 0 /* I/O: Extended Features Register */
  44. /* (DLAB=1, 16C660 only) */
  45. #define UART_LCR 0 /* Out: Line Control Register */
  46. #define UART_MCR 0 /* Out: Modem Control Register */
  47. #define UART_LSR ((unsigned long) PLD_ESIO0STS)
  48. /* In: Line Status Register */
  49. #define UART_MSR 0 /* In: Modem Status Register */
  50. #define UART_SCR 0 /* I/O: Scratch Register */
  51. #define UART_EMSR 0 /* (LCR=BF) Extended Mode Select Register
  52. * FCTR bit 6 selects SCR or EMSR
  53. * XR16c85x only */
  54. #else /* not CONFIG_SERIAL_M32R_PLDSIO */
  55. #define SIOCR 0x000
  56. #define SIOMOD0 0x004
  57. #define SIOMOD1 0x008
  58. #define SIOSTS 0x00c
  59. #define SIOTRCR 0x010
  60. #define SIOBAUR 0x014
  61. #define SIORBAUR 0x018
  62. #define SIOTXB 0x01c
  63. #define SIORXB 0x020
  64. #define UART_RX M32R_SIO0_RXB_PORTL /* In: Receive buffer (DLAB=0) */
  65. #define UART_TX M32R_SIO0_TXB_PORTL /* Out: Transmit buffer (DLAB=0) */
  66. #define UART_DLL 0 /* Out: Divisor Latch Low (DLAB=1) */
  67. #define UART_TRG 0 /* (LCR=BF) FCTR bit 7 selects Rx or Tx
  68. * In: Fifo count
  69. * Out: Fifo custom trigger levels
  70. * XR16C85x only */
  71. #define UART_DLM 0 /* Out: Divisor Latch High (DLAB=1) */
  72. #define UART_IER M32R_SIO0_TRCR_PORTL /* Out: Interrupt Enable Register */
  73. #define UART_FCTR 0 /* (LCR=BF) Feature Control Register
  74. * XR16C85x only */
  75. #define UART_IIR 0 /* In: Interrupt ID Register */
  76. #define UART_FCR 0 /* Out: FIFO Control Register */
  77. #define UART_EFR 0 /* I/O: Extended Features Register */
  78. /* (DLAB=1, 16C660 only) */
  79. #define UART_LCR 0 /* Out: Line Control Register */
  80. #define UART_MCR 0 /* Out: Modem Control Register */
  81. #define UART_LSR M32R_SIO0_STS_PORTL /* In: Line Status Register */
  82. #define UART_MSR 0 /* In: Modem Status Register */
  83. #define UART_SCR 0 /* I/O: Scratch Register */
  84. #define UART_EMSR 0 /* (LCR=BF) Extended Mode Select Register
  85. * FCTR bit 6 selects SCR or EMSR
  86. * XR16c85x only */
  87. #endif /* CONFIG_SERIAL_M32R_PLDSIO */
  88. #define UART_EMPTY (UART_LSR_TEMT | UART_LSR_THRE)
  89. /*
  90. * These are the definitions for the Line Control Register
  91. *
  92. * Note: if the word length is 5 bits (UART_LCR_WLEN5), then setting
  93. * UART_LCR_STOP will select 1.5 stop bits, not 2 stop bits.
  94. */
  95. #define UART_LCR_DLAB 0x80 /* Divisor latch access bit */
  96. #define UART_LCR_SBC 0x40 /* Set break control */
  97. #define UART_LCR_SPAR 0x20 /* Stick parity (?) */
  98. #define UART_LCR_EPAR 0x10 /* Even parity select */
  99. #define UART_LCR_PARITY 0x08 /* Parity Enable */
  100. #define UART_LCR_STOP 0x04 /* Stop bits: 0=1 stop bit, 1= 2 stop bits */
  101. #define UART_LCR_WLEN5 0x00 /* Wordlength: 5 bits */
  102. #define UART_LCR_WLEN6 0x01 /* Wordlength: 6 bits */
  103. #define UART_LCR_WLEN7 0x02 /* Wordlength: 7 bits */
  104. #define UART_LCR_WLEN8 0x03 /* Wordlength: 8 bits */
  105. /*
  106. * These are the definitions for the Line Status Register
  107. */
  108. #define UART_LSR_TEMT 0x02 /* Transmitter empty */
  109. #define UART_LSR_THRE 0x01 /* Transmit-hold-register empty */
  110. #define UART_LSR_BI 0x00 /* Break interrupt indicator */
  111. #define UART_LSR_FE 0x80 /* Frame error indicator */
  112. #define UART_LSR_PE 0x40 /* Parity error indicator */
  113. #define UART_LSR_OE 0x20 /* Overrun error indicator */
  114. #define UART_LSR_DR 0x04 /* Receiver data ready */
  115. /*
  116. * These are the definitions for the Interrupt Identification Register
  117. */
  118. #define UART_IIR_NO_INT 0x01 /* No interrupts pending */
  119. #define UART_IIR_ID 0x06 /* Mask for the interrupt ID */
  120. #define UART_IIR_MSI 0x00 /* Modem status interrupt */
  121. #define UART_IIR_THRI 0x02 /* Transmitter holding register empty */
  122. #define UART_IIR_RDI 0x04 /* Receiver data interrupt */
  123. #define UART_IIR_RLSI 0x06 /* Receiver line status interrupt */
  124. /*
  125. * These are the definitions for the Interrupt Enable Register
  126. */
  127. #define UART_IER_MSI 0x00 /* Enable Modem status interrupt */
  128. #define UART_IER_RLSI 0x08 /* Enable receiver line status interrupt */
  129. #define UART_IER_THRI 0x03 /* Enable Transmitter holding register int. */
  130. #define UART_IER_RDI 0x04 /* Enable receiver data interrupt */
  131. #endif /* _M32R_SIO_REG_H */