spi-topcliff-pch: supports a spi mode setup and bit order setup by IO control
[zen-stable.git] / arch / arm / plat-omap / include / plat / serial.h
blob198d1e6a4a6c946268a4a4feef21fc0d39312647
1 /*
2 * arch/arm/plat-omap/include/mach/serial.h
4 * Copyright (C) 2009 Texas Instruments
5 * Added OMAP4 support- Santosh Shilimkar <santosh.shilimkar@ti.com>
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.
13 #ifndef __ASM_ARCH_SERIAL_H
14 #define __ASM_ARCH_SERIAL_H
16 #include <linux/init.h>
19 * Memory entry used for the DEBUG_LL UART configuration, relative to
20 * start of RAM. See also uncompress.h and debug-macro.S.
22 * Note that using a memory location for storing the UART configuration
23 * has at least two limitations:
25 * 1. Kernel uncompress code cannot overlap OMAP_UART_INFO as the
26 * uncompress code could then partially overwrite itself
27 * 2. We assume printascii is called at least once before paging_init,
28 * and addruart has a chance to read OMAP_UART_INFO
30 #define OMAP_UART_INFO_OFS 0x3ffc
32 /* OMAP1 serial ports */
33 #define OMAP1_UART1_BASE 0xfffb0000
34 #define OMAP1_UART2_BASE 0xfffb0800
35 #define OMAP1_UART3_BASE 0xfffb9800
37 /* OMAP2 serial ports */
38 #define OMAP2_UART1_BASE 0x4806a000
39 #define OMAP2_UART2_BASE 0x4806c000
40 #define OMAP2_UART3_BASE 0x4806e000
42 /* OMAP3 serial ports */
43 #define OMAP3_UART1_BASE OMAP2_UART1_BASE
44 #define OMAP3_UART2_BASE OMAP2_UART2_BASE
45 #define OMAP3_UART3_BASE 0x49020000
46 #define OMAP3_UART4_BASE 0x49042000 /* Only on 36xx */
47 #define OMAP3_UART4_AM35XX_BASE 0x4809E000 /* Only on AM35xx */
49 /* OMAP4 serial ports */
50 #define OMAP4_UART1_BASE OMAP2_UART1_BASE
51 #define OMAP4_UART2_BASE OMAP2_UART2_BASE
52 #define OMAP4_UART3_BASE 0x48020000
53 #define OMAP4_UART4_BASE 0x4806e000
55 /* TI81XX serial ports */
56 #define TI81XX_UART1_BASE 0x48020000
57 #define TI81XX_UART2_BASE 0x48022000
58 #define TI81XX_UART3_BASE 0x48024000
60 /* AM3505/3517 UART4 */
61 #define AM35XX_UART4_BASE 0x4809E000 /* Only on AM3505/3517 */
63 /* External port on Zoom2/3 */
64 #define ZOOM_UART_BASE 0x10000000
65 #define ZOOM_UART_VIRT 0xfa400000
67 #define OMAP_PORT_SHIFT 2
68 #define OMAP7XX_PORT_SHIFT 0
69 #define ZOOM_PORT_SHIFT 1
71 #define OMAP1510_BASE_BAUD (12000000/16)
72 #define OMAP16XX_BASE_BAUD (48000000/16)
73 #define OMAP24XX_BASE_BAUD (48000000/16)
76 * DEBUG_LL port encoding stored into the UART1 scratchpad register by
77 * decomp_setup in uncompress.h
79 #define OMAP1UART1 11
80 #define OMAP1UART2 12
81 #define OMAP1UART3 13
82 #define OMAP2UART1 21
83 #define OMAP2UART2 22
84 #define OMAP2UART3 23
85 #define OMAP3UART1 OMAP2UART1
86 #define OMAP3UART2 OMAP2UART2
87 #define OMAP3UART3 33
88 #define OMAP3UART4 34 /* Only on 36xx */
89 #define OMAP4UART1 OMAP2UART1
90 #define OMAP4UART2 OMAP2UART2
91 #define OMAP4UART3 43
92 #define OMAP4UART4 44
93 #define TI81XXUART1 81
94 #define TI81XXUART2 82
95 #define TI81XXUART3 83
96 #define ZOOM_UART 95 /* Only on zoom2/3 */
98 /* This is only used by 8250.c for omap1510 */
99 #define is_omap_port(pt) ({int __ret = 0; \
100 if ((pt)->port.mapbase == OMAP1_UART1_BASE || \
101 (pt)->port.mapbase == OMAP1_UART2_BASE || \
102 (pt)->port.mapbase == OMAP1_UART3_BASE) \
103 __ret = 1; \
104 __ret; \
107 #ifndef __ASSEMBLER__
109 struct omap_board_data;
110 struct omap_uart_port_info;
112 extern void omap_serial_init(void);
113 extern int omap_uart_can_sleep(void);
114 extern void omap_serial_board_init(struct omap_uart_port_info *platform_data);
115 extern void omap_serial_init_port(struct omap_board_data *bdata,
116 struct omap_uart_port_info *platform_data);
117 #endif
119 #endif