blob: 7f5a7a88a6eb9573737cf11d1ae7e9b5f4e6feeb [file] [log] [blame]
Russell Kinga09e64f2008-08-05 16:14:15 +01001/*
Santosh Shilimkar44169072009-05-28 14:16:04 -07002 * 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 Kinga09e64f2008-08-05 16:14:15 +01006 *
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 Walmsleyb3c6df32009-09-03 20:14:02 +030016#include <linux/init.h>
17
Russell Kinga09e64f2008-08-05 16:14:15 +010018/* OMAP1 serial ports */
Tony Lindgren4f2c49f2010-02-15 08:48:53 -080019#define OMAP1_UART1_BASE 0xfffb0000
20#define OMAP1_UART2_BASE 0xfffb0800
21#define OMAP1_UART3_BASE 0xfffb9800
22
Russell Kinga09e64f2008-08-05 16:14:15 +010023/* OMAP2 serial ports */
Tony Lindgren4f2c49f2010-02-15 08:48:53 -080024#define OMAP2_UART1_BASE 0x4806a000
25#define OMAP2_UART2_BASE 0x4806c000
26#define OMAP2_UART3_BASE 0x4806e000
27
Jouni Hogander6e811762008-10-06 15:49:15 +030028/* OMAP3 serial ports */
Tony Lindgren4f2c49f2010-02-15 08:48:53 -080029#define OMAP3_UART1_BASE 0x4806a000
30#define OMAP3_UART2_BASE 0x4806c000
31#define OMAP3_UART3_BASE 0x49020000
32#define OMAP3_UART4_BASE 0x49042000 /* Only on 36xx */
33
Santosh Shilimkar44169072009-05-28 14:16:04 -070034/* OMAP4 serial ports */
Tony Lindgren4f2c49f2010-02-15 08:48:53 -080035#define OMAP4_UART1_BASE 0x4806a000
36#define OMAP4_UART2_BASE 0x4806c000
37#define OMAP4_UART3_BASE 0x48020000
38#define OMAP4_UART4_BASE 0x4806e000
39
40#define OMAP_PORT_SHIFT 2
41#define OMAP7XX_PORT_SHIFT 0
Russell Kinga09e64f2008-08-05 16:14:15 +010042
Russell Kinga09e64f2008-08-05 16:14:15 +010043#define OMAP1510_BASE_BAUD (12000000/16)
44#define OMAP16XX_BASE_BAUD (48000000/16)
Jouni Hogander6e811762008-10-06 15:49:15 +030045#define OMAP24XX_BASE_BAUD (48000000/16)
Russell Kinga09e64f2008-08-05 16:14:15 +010046
Tony Lindgren4f2c49f2010-02-15 08:48:53 -080047/* This is only used by 8250.c for omap1510 */
Russell King56685452008-09-01 21:25:33 +010048#define is_omap_port(pt) ({int __ret = 0; \
Tony Lindgren4f2c49f2010-02-15 08:48:53 -080049 if ((pt)->port.mapbase == OMAP1_UART1_BASE || \
50 (pt)->port.mapbase == OMAP1_UART2_BASE || \
51 (pt)->port.mapbase == OMAP1_UART3_BASE) \
Russell King56685452008-09-01 21:25:33 +010052 __ret = 1; \
53 __ret; \
Russell Kinga09e64f2008-08-05 16:14:15 +010054 })
55
Kevin Hilman4af40162009-02-04 10:51:40 -080056#ifndef __ASSEMBLER__
Paul Walmsleyb3c6df32009-09-03 20:14:02 +030057extern void __init omap_serial_early_init(void);
Kevin Hilman4af40162009-02-04 10:51:40 -080058extern void omap_serial_init(void);
Mika Westerbergf62349e2009-12-11 16:16:35 -080059extern void omap_serial_init_port(int port);
Kevin Hilman4af40162009-02-04 10:51:40 -080060extern int omap_uart_can_sleep(void);
61extern void omap_uart_check_wakeup(void);
62extern void omap_uart_prepare_suspend(void);
63extern void omap_uart_prepare_idle(int num);
64extern void omap_uart_resume_idle(int num);
Tero Kristo24662112009-03-05 16:32:23 +020065extern void omap_uart_enable_irqs(int enable);
Kevin Hilman4af40162009-02-04 10:51:40 -080066#endif
67
Russell Kinga09e64f2008-08-05 16:14:15 +010068#endif