Russell King | a09e64f | 2008-08-05 16:14:15 +0100 | [diff] [blame] | 1 | /* |
Santosh Shilimkar | 4416907 | 2009-05-28 14:16:04 -0700 | [diff] [blame] | 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> |
Russell King | a09e64f | 2008-08-05 16:14:15 +0100 | [diff] [blame] | 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 | |
Paul Walmsley | b3c6df3 | 2009-09-03 20:14:02 +0300 | [diff] [blame^] | 16 | #include <linux/init.h> |
| 17 | |
Russell King | a09e64f | 2008-08-05 16:14:15 +0100 | [diff] [blame] | 18 | #if defined(CONFIG_ARCH_OMAP1) |
| 19 | /* OMAP1 serial ports */ |
| 20 | #define OMAP_UART1_BASE 0xfffb0000 |
| 21 | #define OMAP_UART2_BASE 0xfffb0800 |
| 22 | #define OMAP_UART3_BASE 0xfffb9800 |
Santosh Shilimkar | 4416907 | 2009-05-28 14:16:04 -0700 | [diff] [blame] | 23 | #define OMAP_MAX_NR_PORTS 3 |
Russell King | a09e64f | 2008-08-05 16:14:15 +0100 | [diff] [blame] | 24 | #elif defined(CONFIG_ARCH_OMAP2) |
| 25 | /* OMAP2 serial ports */ |
| 26 | #define OMAP_UART1_BASE 0x4806a000 |
| 27 | #define OMAP_UART2_BASE 0x4806c000 |
| 28 | #define OMAP_UART3_BASE 0x4806e000 |
Santosh Shilimkar | 4416907 | 2009-05-28 14:16:04 -0700 | [diff] [blame] | 29 | #define OMAP_MAX_NR_PORTS 3 |
Jouni Hogander | 6e81176 | 2008-10-06 15:49:15 +0300 | [diff] [blame] | 30 | #elif defined(CONFIG_ARCH_OMAP3) |
| 31 | /* OMAP3 serial ports */ |
| 32 | #define OMAP_UART1_BASE 0x4806a000 |
| 33 | #define OMAP_UART2_BASE 0x4806c000 |
| 34 | #define OMAP_UART3_BASE 0x49020000 |
Santosh Shilimkar | 4416907 | 2009-05-28 14:16:04 -0700 | [diff] [blame] | 35 | #define OMAP_MAX_NR_PORTS 3 |
| 36 | #elif defined(CONFIG_ARCH_OMAP4) |
| 37 | /* OMAP4 serial ports */ |
| 38 | #define OMAP_UART1_BASE 0x4806a000 |
| 39 | #define OMAP_UART2_BASE 0x4806c000 |
| 40 | #define OMAP_UART3_BASE 0x48020000 |
| 41 | #define OMAP_UART4_BASE 0x4806e000 |
| 42 | #define OMAP_MAX_NR_PORTS 4 |
Russell King | a09e64f | 2008-08-05 16:14:15 +0100 | [diff] [blame] | 43 | #endif |
| 44 | |
Russell King | a09e64f | 2008-08-05 16:14:15 +0100 | [diff] [blame] | 45 | #define OMAP1510_BASE_BAUD (12000000/16) |
| 46 | #define OMAP16XX_BASE_BAUD (48000000/16) |
Jouni Hogander | 6e81176 | 2008-10-06 15:49:15 +0300 | [diff] [blame] | 47 | #define OMAP24XX_BASE_BAUD (48000000/16) |
Russell King | a09e64f | 2008-08-05 16:14:15 +0100 | [diff] [blame] | 48 | |
Russell King | 5668545 | 2008-09-01 21:25:33 +0100 | [diff] [blame] | 49 | #define is_omap_port(pt) ({int __ret = 0; \ |
| 50 | if ((pt)->port.mapbase == OMAP_UART1_BASE || \ |
| 51 | (pt)->port.mapbase == OMAP_UART2_BASE || \ |
| 52 | (pt)->port.mapbase == OMAP_UART3_BASE) \ |
| 53 | __ret = 1; \ |
| 54 | __ret; \ |
Russell King | a09e64f | 2008-08-05 16:14:15 +0100 | [diff] [blame] | 55 | }) |
| 56 | |
Kevin Hilman | 4af4016 | 2009-02-04 10:51:40 -0800 | [diff] [blame] | 57 | #ifndef __ASSEMBLER__ |
Paul Walmsley | b3c6df3 | 2009-09-03 20:14:02 +0300 | [diff] [blame^] | 58 | extern void __init omap_serial_early_init(void); |
Kevin Hilman | 4af4016 | 2009-02-04 10:51:40 -0800 | [diff] [blame] | 59 | extern void omap_serial_init(void); |
| 60 | extern int omap_uart_can_sleep(void); |
| 61 | extern void omap_uart_check_wakeup(void); |
| 62 | extern void omap_uart_prepare_suspend(void); |
| 63 | extern void omap_uart_prepare_idle(int num); |
| 64 | extern void omap_uart_resume_idle(int num); |
Tero Kristo | 2466211 | 2009-03-05 16:32:23 +0200 | [diff] [blame] | 65 | extern void omap_uart_enable_irqs(int enable); |
Kevin Hilman | 4af4016 | 2009-02-04 10:51:40 -0800 | [diff] [blame] | 66 | #endif |
| 67 | |
Russell King | a09e64f | 2008-08-05 16:14:15 +0100 | [diff] [blame] | 68 | #endif |