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