serial_l7200.h 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. /*
  2. * arch/arm/mach-l7200/include/mach/serial_l7200.h
  3. *
  4. * Copyright (c) 2000 Steven Hill (sjhill@cotw.com)
  5. *
  6. * Changelog:
  7. * 05-09-2000 SJH Created
  8. */
  9. #ifndef __ASM_ARCH_SERIAL_L7200_H
  10. #define __ASM_ARCH_SERIAL_L7200_H
  11. #include <mach/memory.h>
  12. /*
  13. * This assumes you have a 3.6864 MHz clock for your UART.
  14. */
  15. #define BASE_BAUD 3686400
  16. /*
  17. * UART base register addresses
  18. */
  19. #define UART1_BASE (IO_BASE + 0x00044000)
  20. #define UART2_BASE (IO_BASE + 0x00045000)
  21. /*
  22. * UART register offsets
  23. */
  24. #define UARTDR 0x00 /* Tx/Rx data */
  25. #define RXSTAT 0x04 /* Rx status */
  26. #define H_UBRLCR 0x08 /* mode register high */
  27. #define M_UBRLCR 0x0C /* mode reg mid (MSB of baud)*/
  28. #define L_UBRLCR 0x10 /* mode reg low (LSB of baud)*/
  29. #define UARTCON 0x14 /* control register */
  30. #define UARTFLG 0x18 /* flag register */
  31. #define UARTINTSTAT 0x1C /* FIFO IRQ status register */
  32. #define UARTINTMASK 0x20 /* FIFO IRQ mask register */
  33. /*
  34. * UART baud rate register values
  35. */
  36. #define BR_110 0x827
  37. #define BR_1200 0x06e
  38. #define BR_2400 0x05f
  39. #define BR_4800 0x02f
  40. #define BR_9600 0x017
  41. #define BR_14400 0x00f
  42. #define BR_19200 0x00b
  43. #define BR_38400 0x005
  44. #define BR_57600 0x003
  45. #define BR_76800 0x002
  46. #define BR_115200 0x001
  47. /*
  48. * Receiver status register (RXSTAT) mask values
  49. */
  50. #define RXSTAT_NO_ERR 0x00 /* No error */
  51. #define RXSTAT_FRM_ERR 0x01 /* Framing error */
  52. #define RXSTAT_PAR_ERR 0x02 /* Parity error */
  53. #define RXSTAT_OVR_ERR 0x04 /* Overrun error */
  54. /*
  55. * High byte of UART bit rate and line control register (H_UBRLCR) values
  56. */
  57. #define UBRLCR_BRK 0x01 /* generate break on tx */
  58. #define UBRLCR_PEN 0x02 /* enable parity */
  59. #define UBRLCR_PDIS 0x00 /* disable parity */
  60. #define UBRLCR_EVEN 0x04 /* 1= even parity,0 = odd parity */
  61. #define UBRLCR_STP2 0x08 /* transmit 2 stop bits */
  62. #define UBRLCR_FIFO 0x10 /* enable FIFO */
  63. #define UBRLCR_LEN5 0x60 /* word length5 */
  64. #define UBRLCR_LEN6 0x40 /* word length6 */
  65. #define UBRLCR_LEN7 0x20 /* word length7 */
  66. #define UBRLCR_LEN8 0x00 /* word length8 */
  67. /*
  68. * UART control register (UARTCON) values
  69. */
  70. #define UARTCON_UARTEN 0x01 /* Enable UART */
  71. #define UARTCON_DMAONERR 0x08 /* Mask RxDmaRq when errors occur */
  72. /*
  73. * UART flag register (UARTFLG) mask values
  74. */
  75. #define UARTFLG_UTXFF 0x20 /* Transmit FIFO full */
  76. #define UARTFLG_URXFE 0x10 /* Receiver FIFO empty */
  77. #define UARTFLG_UBUSY 0x08 /* Transmitter busy */
  78. #define UARTFLG_DCD 0x04 /* Data carrier detect */
  79. #define UARTFLG_DSR 0x02 /* Data set ready */
  80. #define UARTFLG_CTS 0x01 /* Clear to send */
  81. /*
  82. * UART interrupt status/clear registers (UARTINTSTAT/CLR) values
  83. */
  84. #define UART_TXINT 0x01 /* TX interrupt */
  85. #define UART_RXINT 0x02 /* RX interrupt */
  86. #define UART_RXERRINT 0x04 /* RX error interrupt */
  87. #define UART_MSINT 0x08 /* Modem Status interrupt */
  88. #define UART_UDINT 0x10 /* UART Disabled interrupt */
  89. #define UART_ALLIRQS 0x1f /* All interrupts */
  90. #endif