regs-uart.h 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  1. #ifndef __ASM_ARCH_REGS_UART_H
  2. #define __ASM_ARCH_REGS_UART_H
  3. /*
  4. * UARTs
  5. */
  6. /* Full Function UART (FFUART) */
  7. #define FFUART FFRBR
  8. #define FFRBR __REG(0x40100000) /* Receive Buffer Register (read only) */
  9. #define FFTHR __REG(0x40100000) /* Transmit Holding Register (write only) */
  10. #define FFIER __REG(0x40100004) /* Interrupt Enable Register (read/write) */
  11. #define FFIIR __REG(0x40100008) /* Interrupt ID Register (read only) */
  12. #define FFFCR __REG(0x40100008) /* FIFO Control Register (write only) */
  13. #define FFLCR __REG(0x4010000C) /* Line Control Register (read/write) */
  14. #define FFMCR __REG(0x40100010) /* Modem Control Register (read/write) */
  15. #define FFLSR __REG(0x40100014) /* Line Status Register (read only) */
  16. #define FFMSR __REG(0x40100018) /* Modem Status Register (read only) */
  17. #define FFSPR __REG(0x4010001C) /* Scratch Pad Register (read/write) */
  18. #define FFISR __REG(0x40100020) /* Infrared Selection Register (read/write) */
  19. #define FFDLL __REG(0x40100000) /* Divisor Latch Low Register (DLAB = 1) (read/write) */
  20. #define FFDLH __REG(0x40100004) /* Divisor Latch High Register (DLAB = 1) (read/write) */
  21. /* Bluetooth UART (BTUART) */
  22. #define BTUART BTRBR
  23. #define BTRBR __REG(0x40200000) /* Receive Buffer Register (read only) */
  24. #define BTTHR __REG(0x40200000) /* Transmit Holding Register (write only) */
  25. #define BTIER __REG(0x40200004) /* Interrupt Enable Register (read/write) */
  26. #define BTIIR __REG(0x40200008) /* Interrupt ID Register (read only) */
  27. #define BTFCR __REG(0x40200008) /* FIFO Control Register (write only) */
  28. #define BTLCR __REG(0x4020000C) /* Line Control Register (read/write) */
  29. #define BTMCR __REG(0x40200010) /* Modem Control Register (read/write) */
  30. #define BTLSR __REG(0x40200014) /* Line Status Register (read only) */
  31. #define BTMSR __REG(0x40200018) /* Modem Status Register (read only) */
  32. #define BTSPR __REG(0x4020001C) /* Scratch Pad Register (read/write) */
  33. #define BTISR __REG(0x40200020) /* Infrared Selection Register (read/write) */
  34. #define BTDLL __REG(0x40200000) /* Divisor Latch Low Register (DLAB = 1) (read/write) */
  35. #define BTDLH __REG(0x40200004) /* Divisor Latch High Register (DLAB = 1) (read/write) */
  36. /* Standard UART (STUART) */
  37. #define STUART STRBR
  38. #define STRBR __REG(0x40700000) /* Receive Buffer Register (read only) */
  39. #define STTHR __REG(0x40700000) /* Transmit Holding Register (write only) */
  40. #define STIER __REG(0x40700004) /* Interrupt Enable Register (read/write) */
  41. #define STIIR __REG(0x40700008) /* Interrupt ID Register (read only) */
  42. #define STFCR __REG(0x40700008) /* FIFO Control Register (write only) */
  43. #define STLCR __REG(0x4070000C) /* Line Control Register (read/write) */
  44. #define STMCR __REG(0x40700010) /* Modem Control Register (read/write) */
  45. #define STLSR __REG(0x40700014) /* Line Status Register (read only) */
  46. #define STMSR __REG(0x40700018) /* Reserved */
  47. #define STSPR __REG(0x4070001C) /* Scratch Pad Register (read/write) */
  48. #define STISR __REG(0x40700020) /* Infrared Selection Register (read/write) */
  49. #define STDLL __REG(0x40700000) /* Divisor Latch Low Register (DLAB = 1) (read/write) */
  50. #define STDLH __REG(0x40700004) /* Divisor Latch High Register (DLAB = 1) (read/write) */
  51. /* Hardware UART (HWUART) */
  52. #define HWUART HWRBR
  53. #define HWRBR __REG(0x41600000) /* Receive Buffer Register (read only) */
  54. #define HWTHR __REG(0x41600000) /* Transmit Holding Register (write only) */
  55. #define HWIER __REG(0x41600004) /* Interrupt Enable Register (read/write) */
  56. #define HWIIR __REG(0x41600008) /* Interrupt ID Register (read only) */
  57. #define HWFCR __REG(0x41600008) /* FIFO Control Register (write only) */
  58. #define HWLCR __REG(0x4160000C) /* Line Control Register (read/write) */
  59. #define HWMCR __REG(0x41600010) /* Modem Control Register (read/write) */
  60. #define HWLSR __REG(0x41600014) /* Line Status Register (read only) */
  61. #define HWMSR __REG(0x41600018) /* Modem Status Register (read only) */
  62. #define HWSPR __REG(0x4160001C) /* Scratch Pad Register (read/write) */
  63. #define HWISR __REG(0x41600020) /* Infrared Selection Register (read/write) */
  64. #define HWFOR __REG(0x41600024) /* Receive FIFO Occupancy Register (read only) */
  65. #define HWABR __REG(0x41600028) /* Auto-Baud Control Register (read/write) */
  66. #define HWACR __REG(0x4160002C) /* Auto-Baud Count Register (read only) */
  67. #define HWDLL __REG(0x41600000) /* Divisor Latch Low Register (DLAB = 1) (read/write) */
  68. #define HWDLH __REG(0x41600004) /* Divisor Latch High Register (DLAB = 1) (read/write) */
  69. #define IER_DMAE (1 << 7) /* DMA Requests Enable */
  70. #define IER_UUE (1 << 6) /* UART Unit Enable */
  71. #define IER_NRZE (1 << 5) /* NRZ coding Enable */
  72. #define IER_RTIOE (1 << 4) /* Receiver Time Out Interrupt Enable */
  73. #define IER_MIE (1 << 3) /* Modem Interrupt Enable */
  74. #define IER_RLSE (1 << 2) /* Receiver Line Status Interrupt Enable */
  75. #define IER_TIE (1 << 1) /* Transmit Data request Interrupt Enable */
  76. #define IER_RAVIE (1 << 0) /* Receiver Data Available Interrupt Enable */
  77. #define IIR_FIFOES1 (1 << 7) /* FIFO Mode Enable Status */
  78. #define IIR_FIFOES0 (1 << 6) /* FIFO Mode Enable Status */
  79. #define IIR_TOD (1 << 3) /* Time Out Detected */
  80. #define IIR_IID2 (1 << 2) /* Interrupt Source Encoded */
  81. #define IIR_IID1 (1 << 1) /* Interrupt Source Encoded */
  82. #define IIR_IP (1 << 0) /* Interrupt Pending (active low) */
  83. #define FCR_ITL2 (1 << 7) /* Interrupt Trigger Level */
  84. #define FCR_ITL1 (1 << 6) /* Interrupt Trigger Level */
  85. #define FCR_RESETTF (1 << 2) /* Reset Transmitter FIFO */
  86. #define FCR_RESETRF (1 << 1) /* Reset Receiver FIFO */
  87. #define FCR_TRFIFOE (1 << 0) /* Transmit and Receive FIFO Enable */
  88. #define FCR_ITL_1 (0)
  89. #define FCR_ITL_8 (FCR_ITL1)
  90. #define FCR_ITL_16 (FCR_ITL2)
  91. #define FCR_ITL_32 (FCR_ITL2|FCR_ITL1)
  92. #define LCR_DLAB (1 << 7) /* Divisor Latch Access Bit */
  93. #define LCR_SB (1 << 6) /* Set Break */
  94. #define LCR_STKYP (1 << 5) /* Sticky Parity */
  95. #define LCR_EPS (1 << 4) /* Even Parity Select */
  96. #define LCR_PEN (1 << 3) /* Parity Enable */
  97. #define LCR_STB (1 << 2) /* Stop Bit */
  98. #define LCR_WLS1 (1 << 1) /* Word Length Select */
  99. #define LCR_WLS0 (1 << 0) /* Word Length Select */
  100. #define LSR_FIFOE (1 << 7) /* FIFO Error Status */
  101. #define LSR_TEMT (1 << 6) /* Transmitter Empty */
  102. #define LSR_TDRQ (1 << 5) /* Transmit Data Request */
  103. #define LSR_BI (1 << 4) /* Break Interrupt */
  104. #define LSR_FE (1 << 3) /* Framing Error */
  105. #define LSR_PE (1 << 2) /* Parity Error */
  106. #define LSR_OE (1 << 1) /* Overrun Error */
  107. #define LSR_DR (1 << 0) /* Data Ready */
  108. #define MCR_LOOP (1 << 4)
  109. #define MCR_OUT2 (1 << 3) /* force MSR_DCD in loopback mode */
  110. #define MCR_OUT1 (1 << 2) /* force MSR_RI in loopback mode */
  111. #define MCR_RTS (1 << 1) /* Request to Send */
  112. #define MCR_DTR (1 << 0) /* Data Terminal Ready */
  113. #define MSR_DCD (1 << 7) /* Data Carrier Detect */
  114. #define MSR_RI (1 << 6) /* Ring Indicator */
  115. #define MSR_DSR (1 << 5) /* Data Set Ready */
  116. #define MSR_CTS (1 << 4) /* Clear To Send */
  117. #define MSR_DDCD (1 << 3) /* Delta Data Carrier Detect */
  118. #define MSR_TERI (1 << 2) /* Trailing Edge Ring Indicator */
  119. #define MSR_DDSR (1 << 1) /* Delta Data Set Ready */
  120. #define MSR_DCTS (1 << 0) /* Delta Clear To Send */
  121. /*
  122. * IrSR (Infrared Selection Register)
  123. */
  124. #define STISR_RXPL (1 << 4) /* Receive Data Polarity */
  125. #define STISR_TXPL (1 << 3) /* Transmit Data Polarity */
  126. #define STISR_XMODE (1 << 2) /* Transmit Pulse Width Select */
  127. #define STISR_RCVEIR (1 << 1) /* Receiver SIR Enable */
  128. #define STISR_XMITIR (1 << 0) /* Transmitter SIR Enable */
  129. #endif /* __ASM_ARCH_REGS_UART_H */