serial.h 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  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. /* OMAP1 serial ports */
  16. #define OMAP1_UART1_BASE 0xfffb0000
  17. #define OMAP1_UART2_BASE 0xfffb0800
  18. #define OMAP1_UART3_BASE 0xfffb9800
  19. /* OMAP2 serial ports */
  20. #define OMAP2_UART1_BASE 0x4806a000
  21. #define OMAP2_UART2_BASE 0x4806c000
  22. #define OMAP2_UART3_BASE 0x4806e000
  23. /* OMAP3 serial ports */
  24. #define OMAP3_UART1_BASE OMAP2_UART1_BASE
  25. #define OMAP3_UART2_BASE OMAP2_UART2_BASE
  26. #define OMAP3_UART3_BASE 0x49020000
  27. #define OMAP3_UART4_BASE 0x49042000 /* Only on 36xx */
  28. /* OMAP4 serial ports */
  29. #define OMAP4_UART1_BASE OMAP2_UART1_BASE
  30. #define OMAP4_UART2_BASE OMAP2_UART2_BASE
  31. #define OMAP4_UART3_BASE 0x48020000
  32. #define OMAP4_UART4_BASE 0x4806e000
  33. /* External port on Zoom2/3 */
  34. #define ZOOM_UART_BASE 0x10000000
  35. #define ZOOM_UART_VIRT 0xfb000000
  36. #define OMAP_PORT_SHIFT 2
  37. #define OMAP7XX_PORT_SHIFT 0
  38. #define ZOOM_PORT_SHIFT 1
  39. #define OMAP1510_BASE_BAUD (12000000/16)
  40. #define OMAP16XX_BASE_BAUD (48000000/16)
  41. #define OMAP24XX_BASE_BAUD (48000000/16)
  42. /*
  43. * DEBUG_LL port encoding stored into the UART1 scratchpad register by
  44. * decomp_setup in uncompress.h
  45. */
  46. #define OMAP1UART1 11
  47. #define OMAP1UART2 12
  48. #define OMAP1UART3 13
  49. #define OMAP2UART1 21
  50. #define OMAP2UART2 22
  51. #define OMAP2UART3 23
  52. #define OMAP3UART1 OMAP2UART1
  53. #define OMAP3UART2 OMAP2UART2
  54. #define OMAP3UART3 33
  55. #define OMAP3UART4 34 /* Only on 36xx */
  56. #define OMAP4UART1 OMAP2UART1
  57. #define OMAP4UART2 OMAP2UART2
  58. #define OMAP4UART3 43
  59. #define OMAP4UART4 44
  60. #define ZOOM_UART 95 /* Only on zoom2/3 */
  61. /* This is only used by 8250.c for omap1510 */
  62. #define is_omap_port(pt) ({int __ret = 0; \
  63. if ((pt)->port.mapbase == OMAP1_UART1_BASE || \
  64. (pt)->port.mapbase == OMAP1_UART2_BASE || \
  65. (pt)->port.mapbase == OMAP1_UART3_BASE) \
  66. __ret = 1; \
  67. __ret; \
  68. })
  69. #ifndef __ASSEMBLER__
  70. extern void __init omap_serial_early_init(void);
  71. extern void omap_serial_init(void);
  72. extern void omap_serial_init_port(int port);
  73. extern int omap_uart_can_sleep(void);
  74. extern void omap_uart_check_wakeup(void);
  75. extern void omap_uart_prepare_suspend(void);
  76. extern void omap_uart_prepare_idle(int num);
  77. extern void omap_uart_resume_idle(int num);
  78. extern void omap_uart_enable_irqs(int enable);
  79. #endif
  80. #endif