serial.h 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. /*
  2. * arch/arm/plat-omap/include/mach/serial.h
  3. *
  4. * Copyright (C) 2009 Texas Instruments
  5. * Addded OMAP4 support- Santosh Shilimkar <santosh.shilimkar@ti.com>
  6. *
  7. * This program is distributed in the hope that it will be useful,
  8. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. * GNU General Public License for more details.
  11. */
  12. #ifndef __ASM_ARCH_SERIAL_H
  13. #define __ASM_ARCH_SERIAL_H
  14. #include <linux/init.h>
  15. /*
  16. * Memory entry used for the DEBUG_LL UART configuration. See also
  17. * uncompress.h and debug-macro.S.
  18. *
  19. * Note that using a memory location for storing the UART configuration
  20. * has at least two limitations:
  21. *
  22. * 1. Kernel uncompress code cannot overlap OMAP_UART_INFO as the
  23. * uncompress code could then partially overwrite itself
  24. * 2. We assume printascii is called at least once before paging_init,
  25. * and addruart has a chance to read OMAP_UART_INFO
  26. */
  27. #define OMAP_UART_INFO (PLAT_PHYS_OFFSET + 0x3ffc)
  28. /* OMAP1 serial ports */
  29. #define OMAP1_UART1_BASE 0xfffb0000
  30. #define OMAP1_UART2_BASE 0xfffb0800
  31. #define OMAP1_UART3_BASE 0xfffb9800
  32. /* OMAP2 serial ports */
  33. #define OMAP2_UART1_BASE 0x4806a000
  34. #define OMAP2_UART2_BASE 0x4806c000
  35. #define OMAP2_UART3_BASE 0x4806e000
  36. /* OMAP3 serial ports */
  37. #define OMAP3_UART1_BASE OMAP2_UART1_BASE
  38. #define OMAP3_UART2_BASE OMAP2_UART2_BASE
  39. #define OMAP3_UART3_BASE 0x49020000
  40. #define OMAP3_UART4_BASE 0x49042000 /* Only on 36xx */
  41. /* OMAP4 serial ports */
  42. #define OMAP4_UART1_BASE OMAP2_UART1_BASE
  43. #define OMAP4_UART2_BASE OMAP2_UART2_BASE
  44. #define OMAP4_UART3_BASE 0x48020000
  45. #define OMAP4_UART4_BASE 0x4806e000
  46. /* TI816X serial ports */
  47. #define TI816X_UART1_BASE 0x48020000
  48. #define TI816X_UART2_BASE 0x48022000
  49. #define TI816X_UART3_BASE 0x48024000
  50. /* External port on Zoom2/3 */
  51. #define ZOOM_UART_BASE 0x10000000
  52. #define ZOOM_UART_VIRT 0xfa400000
  53. #define OMAP_PORT_SHIFT 2
  54. #define OMAP7XX_PORT_SHIFT 0
  55. #define ZOOM_PORT_SHIFT 1
  56. #define OMAP1510_BASE_BAUD (12000000/16)
  57. #define OMAP16XX_BASE_BAUD (48000000/16)
  58. #define OMAP24XX_BASE_BAUD (48000000/16)
  59. /*
  60. * DEBUG_LL port encoding stored into the UART1 scratchpad register by
  61. * decomp_setup in uncompress.h
  62. */
  63. #define OMAP1UART1 11
  64. #define OMAP1UART2 12
  65. #define OMAP1UART3 13
  66. #define OMAP2UART1 21
  67. #define OMAP2UART2 22
  68. #define OMAP2UART3 23
  69. #define OMAP3UART1 OMAP2UART1
  70. #define OMAP3UART2 OMAP2UART2
  71. #define OMAP3UART3 33
  72. #define OMAP3UART4 34 /* Only on 36xx */
  73. #define OMAP4UART1 OMAP2UART1
  74. #define OMAP4UART2 OMAP2UART2
  75. #define OMAP4UART3 43
  76. #define OMAP4UART4 44
  77. #define TI816XUART1 81
  78. #define TI816XUART2 82
  79. #define TI816XUART3 83
  80. #define ZOOM_UART 95 /* Only on zoom2/3 */
  81. /* This is only used by 8250.c for omap1510 */
  82. #define is_omap_port(pt) ({int __ret = 0; \
  83. if ((pt)->port.mapbase == OMAP1_UART1_BASE || \
  84. (pt)->port.mapbase == OMAP1_UART2_BASE || \
  85. (pt)->port.mapbase == OMAP1_UART3_BASE) \
  86. __ret = 1; \
  87. __ret; \
  88. })
  89. #ifndef __ASSEMBLER__
  90. struct omap_board_data;
  91. extern void omap_serial_init(void);
  92. extern void omap_serial_init_port(struct omap_board_data *bdata);
  93. extern int omap_uart_can_sleep(void);
  94. extern void omap_uart_check_wakeup(void);
  95. extern void omap_uart_prepare_suspend(void);
  96. extern void omap_uart_prepare_idle(int num);
  97. extern void omap_uart_resume_idle(int num);
  98. extern void omap_uart_enable_irqs(int enable);
  99. #endif
  100. #endif