s3c4510b_uart.h 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. #ifndef __UART_H
  2. #define __UART_H
  3. /*
  4. * Copyright (c) 2004 Cucy Systems (http://www.cucy.com)
  5. * Curt Brune <curt@cucy.com>
  6. *
  7. * See file CREDITS for list of people who contributed to this
  8. * project.
  9. *
  10. * This program is free software; you can redistribute it and/or
  11. * modify it under the terms of the GNU General Public License as
  12. * published by the Free Software Foundation; either version 2 of
  13. * the License, or (at your option) any later version.
  14. *
  15. * This program is distributed in the hope that it will be useful,
  16. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  17. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  18. * GNU General Public License for more details.
  19. *
  20. * You should have received a copy of the GNU General Public License
  21. * along with this program; if not, write to the Free Software
  22. * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  23. * MA 02111-1307 USA
  24. *
  25. * Description: S3C4510B UART register layout
  26. */
  27. /* UART LINE CONTROL register */
  28. typedef struct __BF_UART_LINE_CTRL {
  29. u32 wordLen: 2;
  30. u32 nStop: 1;
  31. u32 parity: 3;
  32. u32 clk: 1;
  33. u32 infra_red: 1;
  34. u32 unused:24;
  35. } BF_UART_LINE_CTRL;
  36. typedef union _UART_LINE_CTRL {
  37. u32 ui;
  38. BF_UART_LINE_CTRL bf;
  39. } UART_LINE_CTRL;
  40. /* UART CONTROL register */
  41. typedef struct __BF_UART_CTRL {
  42. u32 rxMode: 2;
  43. u32 rxIrq: 1;
  44. u32 txMode: 2;
  45. u32 DSR: 1;
  46. u32 sendBreak: 1;
  47. u32 loopBack: 1;
  48. u32 unused:24;
  49. } BF_UART_CTRL;
  50. typedef union _UART_CTRL {
  51. u32 ui;
  52. BF_UART_CTRL bf;
  53. } UART_CTRL;
  54. /* UART STATUS register */
  55. typedef struct __BF_UART_STAT {
  56. u32 overrun: 1;
  57. u32 parity: 1;
  58. u32 frame: 1;
  59. u32 breakIrq: 1;
  60. u32 DTR: 1;
  61. u32 rxReady: 1;
  62. u32 txBufEmpty: 1;
  63. u32 txComplete: 1;
  64. u32 unused:24;
  65. } BF_UART_STAT;
  66. typedef union _UART_STAT {
  67. u32 ui;
  68. BF_UART_STAT bf;
  69. } UART_STAT;
  70. /* UART BAUD_DIV register */
  71. typedef struct __BF_UART_BAUD_DIV {
  72. u32 cnt1: 4;
  73. u32 cnt0:12;
  74. u32 unused:16;
  75. } BF_UART_BAUD_DIV;
  76. typedef union _UART_BAUD_DIV {
  77. u32 ui;
  78. BF_UART_BAUD_DIV bf;
  79. } UART_BAUD_DIV;
  80. /* UART register block */
  81. typedef struct __UART {
  82. volatile UART_LINE_CTRL m_lineCtrl;
  83. volatile UART_CTRL m_ctrl;
  84. volatile UART_STAT m_stat;
  85. volatile u32 m_tx;
  86. volatile u32 m_rx;
  87. volatile UART_BAUD_DIV m_baudDiv;
  88. volatile u32 m_baudCnt;
  89. volatile u32 m_baudClk;
  90. } UART;
  91. #define NL 0x0A
  92. #define CR 0x0D
  93. #define BSP 0x08
  94. #define ESC 0x1B
  95. #define CTRLZ 0x1A
  96. #define RUBOUT 0x7F
  97. #endif