serial_bcm63xx.h 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. #ifndef _LINUX_SERIAL_BCM63XX_H
  2. #define _LINUX_SERIAL_BCM63XX_H
  3. /* UART Control Register */
  4. #define UART_CTL_REG 0x0
  5. #define UART_CTL_RXTMOUTCNT_SHIFT 0
  6. #define UART_CTL_RXTMOUTCNT_MASK (0x1f << UART_CTL_RXTMOUTCNT_SHIFT)
  7. #define UART_CTL_RSTTXDN_SHIFT 5
  8. #define UART_CTL_RSTTXDN_MASK (1 << UART_CTL_RSTTXDN_SHIFT)
  9. #define UART_CTL_RSTRXFIFO_SHIFT 6
  10. #define UART_CTL_RSTRXFIFO_MASK (1 << UART_CTL_RSTRXFIFO_SHIFT)
  11. #define UART_CTL_RSTTXFIFO_SHIFT 7
  12. #define UART_CTL_RSTTXFIFO_MASK (1 << UART_CTL_RSTTXFIFO_SHIFT)
  13. #define UART_CTL_STOPBITS_SHIFT 8
  14. #define UART_CTL_STOPBITS_MASK (0xf << UART_CTL_STOPBITS_SHIFT)
  15. #define UART_CTL_STOPBITS_1 (0x7 << UART_CTL_STOPBITS_SHIFT)
  16. #define UART_CTL_STOPBITS_2 (0xf << UART_CTL_STOPBITS_SHIFT)
  17. #define UART_CTL_BITSPERSYM_SHIFT 12
  18. #define UART_CTL_BITSPERSYM_MASK (0x3 << UART_CTL_BITSPERSYM_SHIFT)
  19. #define UART_CTL_XMITBRK_SHIFT 14
  20. #define UART_CTL_XMITBRK_MASK (1 << UART_CTL_XMITBRK_SHIFT)
  21. #define UART_CTL_RSVD_SHIFT 15
  22. #define UART_CTL_RSVD_MASK (1 << UART_CTL_RSVD_SHIFT)
  23. #define UART_CTL_RXPAREVEN_SHIFT 16
  24. #define UART_CTL_RXPAREVEN_MASK (1 << UART_CTL_RXPAREVEN_SHIFT)
  25. #define UART_CTL_RXPAREN_SHIFT 17
  26. #define UART_CTL_RXPAREN_MASK (1 << UART_CTL_RXPAREN_SHIFT)
  27. #define UART_CTL_TXPAREVEN_SHIFT 18
  28. #define UART_CTL_TXPAREVEN_MASK (1 << UART_CTL_TXPAREVEN_SHIFT)
  29. #define UART_CTL_TXPAREN_SHIFT 18
  30. #define UART_CTL_TXPAREN_MASK (1 << UART_CTL_TXPAREN_SHIFT)
  31. #define UART_CTL_LOOPBACK_SHIFT 20
  32. #define UART_CTL_LOOPBACK_MASK (1 << UART_CTL_LOOPBACK_SHIFT)
  33. #define UART_CTL_RXEN_SHIFT 21
  34. #define UART_CTL_RXEN_MASK (1 << UART_CTL_RXEN_SHIFT)
  35. #define UART_CTL_TXEN_SHIFT 22
  36. #define UART_CTL_TXEN_MASK (1 << UART_CTL_TXEN_SHIFT)
  37. #define UART_CTL_BRGEN_SHIFT 23
  38. #define UART_CTL_BRGEN_MASK (1 << UART_CTL_BRGEN_SHIFT)
  39. /* UART Baudword register */
  40. #define UART_BAUD_REG 0x4
  41. /* UART Misc Control register */
  42. #define UART_MCTL_REG 0x8
  43. #define UART_MCTL_DTR_SHIFT 0
  44. #define UART_MCTL_DTR_MASK (1 << UART_MCTL_DTR_SHIFT)
  45. #define UART_MCTL_RTS_SHIFT 1
  46. #define UART_MCTL_RTS_MASK (1 << UART_MCTL_RTS_SHIFT)
  47. #define UART_MCTL_RXFIFOTHRESH_SHIFT 8
  48. #define UART_MCTL_RXFIFOTHRESH_MASK (0xf << UART_MCTL_RXFIFOTHRESH_SHIFT)
  49. #define UART_MCTL_TXFIFOTHRESH_SHIFT 12
  50. #define UART_MCTL_TXFIFOTHRESH_MASK (0xf << UART_MCTL_TXFIFOTHRESH_SHIFT)
  51. #define UART_MCTL_RXFIFOFILL_SHIFT 16
  52. #define UART_MCTL_RXFIFOFILL_MASK (0x1f << UART_MCTL_RXFIFOFILL_SHIFT)
  53. #define UART_MCTL_TXFIFOFILL_SHIFT 24
  54. #define UART_MCTL_TXFIFOFILL_MASK (0x1f << UART_MCTL_TXFIFOFILL_SHIFT)
  55. /* UART External Input Configuration register */
  56. #define UART_EXTINP_REG 0xc
  57. #define UART_EXTINP_RI_SHIFT 0
  58. #define UART_EXTINP_RI_MASK (1 << UART_EXTINP_RI_SHIFT)
  59. #define UART_EXTINP_CTS_SHIFT 1
  60. #define UART_EXTINP_CTS_MASK (1 << UART_EXTINP_CTS_SHIFT)
  61. #define UART_EXTINP_DCD_SHIFT 2
  62. #define UART_EXTINP_DCD_MASK (1 << UART_EXTINP_DCD_SHIFT)
  63. #define UART_EXTINP_DSR_SHIFT 3
  64. #define UART_EXTINP_DSR_MASK (1 << UART_EXTINP_DSR_SHIFT)
  65. #define UART_EXTINP_IRSTAT(x) (1 << (x + 4))
  66. #define UART_EXTINP_IRMASK(x) (1 << (x + 8))
  67. #define UART_EXTINP_IR_RI 0
  68. #define UART_EXTINP_IR_CTS 1
  69. #define UART_EXTINP_IR_DCD 2
  70. #define UART_EXTINP_IR_DSR 3
  71. #define UART_EXTINP_RI_NOSENSE_SHIFT 16
  72. #define UART_EXTINP_RI_NOSENSE_MASK (1 << UART_EXTINP_RI_NOSENSE_SHIFT)
  73. #define UART_EXTINP_CTS_NOSENSE_SHIFT 17
  74. #define UART_EXTINP_CTS_NOSENSE_MASK (1 << UART_EXTINP_CTS_NOSENSE_SHIFT)
  75. #define UART_EXTINP_DCD_NOSENSE_SHIFT 18
  76. #define UART_EXTINP_DCD_NOSENSE_MASK (1 << UART_EXTINP_DCD_NOSENSE_SHIFT)
  77. #define UART_EXTINP_DSR_NOSENSE_SHIFT 19
  78. #define UART_EXTINP_DSR_NOSENSE_MASK (1 << UART_EXTINP_DSR_NOSENSE_SHIFT)
  79. /* UART Interrupt register */
  80. #define UART_IR_REG 0x10
  81. #define UART_IR_MASK(x) (1 << (x + 16))
  82. #define UART_IR_STAT(x) (1 << (x))
  83. #define UART_IR_EXTIP 0
  84. #define UART_IR_TXUNDER 1
  85. #define UART_IR_TXOVER 2
  86. #define UART_IR_TXTRESH 3
  87. #define UART_IR_TXRDLATCH 4
  88. #define UART_IR_TXEMPTY 5
  89. #define UART_IR_RXUNDER 6
  90. #define UART_IR_RXOVER 7
  91. #define UART_IR_RXTIMEOUT 8
  92. #define UART_IR_RXFULL 9
  93. #define UART_IR_RXTHRESH 10
  94. #define UART_IR_RXNOTEMPTY 11
  95. #define UART_IR_RXFRAMEERR 12
  96. #define UART_IR_RXPARERR 13
  97. #define UART_IR_RXBRK 14
  98. #define UART_IR_TXDONE 15
  99. /* UART Fifo register */
  100. #define UART_FIFO_REG 0x14
  101. #define UART_FIFO_VALID_SHIFT 0
  102. #define UART_FIFO_VALID_MASK 0xff
  103. #define UART_FIFO_FRAMEERR_SHIFT 8
  104. #define UART_FIFO_FRAMEERR_MASK (1 << UART_FIFO_FRAMEERR_SHIFT)
  105. #define UART_FIFO_PARERR_SHIFT 9
  106. #define UART_FIFO_PARERR_MASK (1 << UART_FIFO_PARERR_SHIFT)
  107. #define UART_FIFO_BRKDET_SHIFT 10
  108. #define UART_FIFO_BRKDET_MASK (1 << UART_FIFO_BRKDET_SHIFT)
  109. #define UART_FIFO_ANYERR_MASK (UART_FIFO_FRAMEERR_MASK | \
  110. UART_FIFO_PARERR_MASK | \
  111. UART_FIFO_BRKDET_MASK)
  112. #endif /* _LINUX_SERIAL_BCM63XX_H */