regs-serial.h 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209
  1. /* linux/include/asm-arm/arch-s3c2410/regs-serial.h
  2. *
  3. * From linux/include/asm-arm/hardware/serial_s3c2410.h
  4. *
  5. * Internal header file for Samsung S3C2410 serial ports (UART0-2)
  6. *
  7. * Copyright (C) 2002 Shane Nay (shane@minirl.com)
  8. *
  9. * Additional defines, (c) 2003 Simtec Electronics (linux@simtec.co.uk)
  10. *
  11. * Adapted from:
  12. *
  13. * Internal header file for MX1ADS serial ports (UART1 & 2)
  14. *
  15. * Copyright (C) 2002 Shane Nay (shane@minirl.com)
  16. *
  17. * This program is free software; you can redistribute it and/or modify
  18. * it under the terms of the GNU General Public License as published by
  19. * the Free Software Foundation; either version 2 of the License, or
  20. * (at your option) any later version.
  21. *
  22. * This program is distributed in the hope that it will be useful,
  23. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  24. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  25. * GNU General Public License for more details.
  26. *
  27. * You should have received a copy of the GNU General Public License
  28. * along with this program; if not, write to the Free Software
  29. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  30. *
  31. * Modifications:
  32. * 10-Mar-2005 LCVR Changed S3C2410_VA to S3C24XX_VA (s3c2400 support)
  33. */
  34. #ifndef __ASM_ARM_REGS_SERIAL_H
  35. #define __ASM_ARM_REGS_SERIAL_H
  36. #define S3C24XX_VA_UART0 (S3C24XX_VA_UART)
  37. #define S3C24XX_VA_UART1 (S3C24XX_VA_UART + 0x4000 )
  38. #define S3C24XX_VA_UART2 (S3C24XX_VA_UART + 0x8000 )
  39. #define S3C2410_PA_UART0 (S3C2410_PA_UART)
  40. #define S3C2410_PA_UART1 (S3C2410_PA_UART + 0x4000 )
  41. #define S3C2410_PA_UART2 (S3C2410_PA_UART + 0x8000 )
  42. #define S3C2410_URXH (0x24)
  43. #define S3C2410_UTXH (0x20)
  44. #define S3C2410_ULCON (0x00)
  45. #define S3C2410_UCON (0x04)
  46. #define S3C2410_UFCON (0x08)
  47. #define S3C2410_UMCON (0x0C)
  48. #define S3C2410_UBRDIV (0x28)
  49. #define S3C2410_UTRSTAT (0x10)
  50. #define S3C2410_UERSTAT (0x14)
  51. #define S3C2410_UFSTAT (0x18)
  52. #define S3C2410_UMSTAT (0x1C)
  53. #define S3C2410_LCON_CFGMASK ((0xF<<3)|(0x3))
  54. #define S3C2410_LCON_CS5 (0x0)
  55. #define S3C2410_LCON_CS6 (0x1)
  56. #define S3C2410_LCON_CS7 (0x2)
  57. #define S3C2410_LCON_CS8 (0x3)
  58. #define S3C2410_LCON_CSMASK (0x3)
  59. #define S3C2410_LCON_PNONE (0x0)
  60. #define S3C2410_LCON_PEVEN (0x5 << 3)
  61. #define S3C2410_LCON_PODD (0x4 << 3)
  62. #define S3C2410_LCON_PMASK (0x7 << 3)
  63. #define S3C2410_LCON_STOPB (1<<2)
  64. #define S3C2410_LCON_IRM (1<<6)
  65. #define S3C2440_UCON_CLKMASK (3<<10)
  66. #define S3C2440_UCON_PCLK (0<<10)
  67. #define S3C2440_UCON_UCLK (1<<10)
  68. #define S3C2440_UCON_PCLK2 (2<<10)
  69. #define S3C2440_UCON_FCLK (3<<10)
  70. #define S3C2440_UCON2_FCLK_EN (1<<15)
  71. #define S3C2440_UCON0_DIVMASK (15 << 12)
  72. #define S3C2440_UCON1_DIVMASK (15 << 12)
  73. #define S3C2440_UCON2_DIVMASK (7 << 12)
  74. #define S3C2440_UCON_DIVSHIFT (12)
  75. #define S3C2410_UCON_UCLK (1<<10)
  76. #define S3C2410_UCON_SBREAK (1<<4)
  77. #define S3C2410_UCON_TXILEVEL (1<<9)
  78. #define S3C2410_UCON_RXILEVEL (1<<8)
  79. #define S3C2410_UCON_TXIRQMODE (1<<2)
  80. #define S3C2410_UCON_RXIRQMODE (1<<0)
  81. #define S3C2410_UCON_RXFIFO_TOI (1<<7)
  82. #define S3C2410_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \
  83. S3C2410_UCON_RXILEVEL | \
  84. S3C2410_UCON_TXIRQMODE | \
  85. S3C2410_UCON_RXIRQMODE | \
  86. S3C2410_UCON_RXFIFO_TOI)
  87. #define S3C2410_UFCON_FIFOMODE (1<<0)
  88. #define S3C2410_UFCON_TXTRIG0 (0<<6)
  89. #define S3C2410_UFCON_RXTRIG8 (1<<4)
  90. #define S3C2410_UFCON_RXTRIG12 (2<<4)
  91. /* S3C2440 FIFO trigger levels */
  92. #define S3C2440_UFCON_RXTRIG1 (0<<4)
  93. #define S3C2440_UFCON_RXTRIG8 (1<<4)
  94. #define S3C2440_UFCON_RXTRIG16 (2<<4)
  95. #define S3C2440_UFCON_RXTRIG32 (3<<4)
  96. #define S3C2440_UFCON_TXTRIG0 (0<<6)
  97. #define S3C2440_UFCON_TXTRIG16 (1<<6)
  98. #define S3C2440_UFCON_TXTRIG32 (2<<6)
  99. #define S3C2440_UFCON_TXTRIG48 (3<<6)
  100. #define S3C2410_UFCON_RESETBOTH (3<<1)
  101. #define S3C2410_UFCON_RESETTX (1<<2)
  102. #define S3C2410_UFCON_RESETRX (1<<1)
  103. #define S3C2410_UFCON_DEFAULT (S3C2410_UFCON_FIFOMODE | \
  104. S3C2410_UFCON_TXTRIG0 | \
  105. S3C2410_UFCON_RXTRIG8 )
  106. #define S3C2410_UMCOM_AFC (1<<4)
  107. #define S3C2410_UMCOM_RTS_LOW (1<<0)
  108. #define S3C2410_UFSTAT_TXFULL (1<<9)
  109. #define S3C2410_UFSTAT_RXFULL (1<<8)
  110. #define S3C2410_UFSTAT_TXMASK (15<<4)
  111. #define S3C2410_UFSTAT_TXSHIFT (4)
  112. #define S3C2410_UFSTAT_RXMASK (15<<0)
  113. #define S3C2410_UFSTAT_RXSHIFT (0)
  114. #define S3C2440_UFSTAT_TXFULL (1<<14)
  115. #define S3C2440_UFSTAT_RXFULL (1<<6)
  116. #define S3C2440_UFSTAT_TXSHIFT (8)
  117. #define S3C2440_UFSTAT_RXSHIFT (0)
  118. #define S3C2440_UFSTAT_TXMASK (63<<8)
  119. #define S3C2440_UFSTAT_RXMASK (63)
  120. #define S3C2410_UTRSTAT_TXE (1<<2)
  121. #define S3C2410_UTRSTAT_TXFE (1<<1)
  122. #define S3C2410_UTRSTAT_RXDR (1<<0)
  123. #define S3C2410_UERSTAT_OVERRUN (1<<0)
  124. #define S3C2410_UERSTAT_FRAME (1<<2)
  125. #define S3C2410_UERSTAT_BREAK (1<<3)
  126. #define S3C2410_UERSTAT_ANY (S3C2410_UERSTAT_OVERRUN | \
  127. S3C2410_UERSTAT_FRAME | \
  128. S3C2410_UERSTAT_BREAK)
  129. #define S3C2410_UMSTAT_CTS (1<<0)
  130. #define S3C2410_UMSTAT_DeltaCTS (1<<2)
  131. #ifndef __ASSEMBLY__
  132. /* struct s3c24xx_uart_clksrc
  133. *
  134. * this structure defines a named clock source that can be used for the
  135. * uart, so that the best clock can be selected for the requested baud
  136. * rate.
  137. *
  138. * min_baud and max_baud define the range of baud-rates this clock is
  139. * acceptable for, if they are both zero, it is assumed any baud rate that
  140. * can be generated from this clock will be used.
  141. *
  142. * divisor gives the divisor from the clock to the one seen by the uart
  143. */
  144. struct s3c24xx_uart_clksrc {
  145. const char *name;
  146. unsigned int divisor;
  147. unsigned int min_baud;
  148. unsigned int max_baud;
  149. };
  150. /* configuration structure for per-machine configurations for the
  151. * serial port
  152. *
  153. * the pointer is setup by the machine specific initialisation from the
  154. * arch/arm/mach-s3c2410/ directory.
  155. */
  156. struct s3c2410_uartcfg {
  157. unsigned char hwport; /* hardware port number */
  158. unsigned char unused;
  159. unsigned short flags;
  160. unsigned long uart_flags; /* default uart flags */
  161. unsigned long ucon; /* value of ucon for port */
  162. unsigned long ulcon; /* value of ulcon for port */
  163. unsigned long ufcon; /* value of ufcon for port */
  164. struct s3c24xx_uart_clksrc *clocks;
  165. unsigned int clocks_size;
  166. };
  167. /* s3c24xx_uart_devs
  168. *
  169. * this is exported from the core as we cannot use driver_register(),
  170. * or platform_add_device() before the console_initcall()
  171. */
  172. extern struct platform_device *s3c24xx_uart_devs[3];
  173. #endif /* __ASSEMBLY__ */
  174. #endif /* __ASM_ARM_REGS_SERIAL_H */