aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/plat-omap/include
diff options
context:
space:
mode:
authorTony Lindgren <tony@atomide.com>2010-10-08 13:20:40 -0400
committerTony Lindgren <tony@atomide.com>2010-10-08 13:20:40 -0400
commitbc3caae8a191c712d8ae666d0b8d18807bfe2b14 (patch)
tree7b338ebba2f1fdbcee3785789bf9f4a74d93aa94 /arch/arm/plat-omap/include
parent73c5ef126f40b0b872e5964ff65dbe792eeec493 (diff)
parent69758ab7a1e2de5636a2188d5357dd03140bf1d8 (diff)
Merge branch 'pm-hwmods' of ssh://master.kernel.org/pub/scm/linux/kernel/git/khilman/linux-omap-pm into omap-for-linus
Diffstat (limited to 'arch/arm/plat-omap/include')
-rw-r--r--arch/arm/plat-omap/include/plat/common.h1
-rw-r--r--arch/arm/plat-omap/include/plat/dma.h2
-rw-r--r--arch/arm/plat-omap/include/plat/irqs.h2
-rw-r--r--arch/arm/plat-omap/include/plat/omap-serial.h129
4 files changed, 133 insertions, 1 deletions
diff --git a/arch/arm/plat-omap/include/plat/common.h b/arch/arm/plat-omap/include/plat/common.h
index 2d8f98d7ae50..a9d69a09920d 100644
--- a/arch/arm/plat-omap/include/plat/common.h
+++ b/arch/arm/plat-omap/include/plat/common.h
@@ -67,7 +67,6 @@ void omap2_set_globals_tap(struct omap_globals *);
67void omap2_set_globals_sdrc(struct omap_globals *); 67void omap2_set_globals_sdrc(struct omap_globals *);
68void omap2_set_globals_control(struct omap_globals *); 68void omap2_set_globals_control(struct omap_globals *);
69void omap2_set_globals_prcm(struct omap_globals *); 69void omap2_set_globals_prcm(struct omap_globals *);
70void omap2_set_globals_uart(struct omap_globals *);
71 70
72void omap3_map_io(void); 71void omap3_map_io(void);
73 72
diff --git a/arch/arm/plat-omap/include/plat/dma.h b/arch/arm/plat-omap/include/plat/dma.h
index af3a03941add..098f154f5d41 100644
--- a/arch/arm/plat-omap/include/plat/dma.h
+++ b/arch/arm/plat-omap/include/plat/dma.h
@@ -319,6 +319,8 @@
319#define OMAP34XX_DMA_USIM_TX 79 /* S_DMA_78 */ 319#define OMAP34XX_DMA_USIM_TX 79 /* S_DMA_78 */
320#define OMAP34XX_DMA_USIM_RX 80 /* S_DMA_79 */ 320#define OMAP34XX_DMA_USIM_RX 80 /* S_DMA_79 */
321 321
322#define OMAP36XX_DMA_UART4_TX 81 /* S_DMA_80 */
323#define OMAP36XX_DMA_UART4_RX 82 /* S_DMA_81 */
322/*----------------------------------------------------------------------------*/ 324/*----------------------------------------------------------------------------*/
323 325
324#define OMAP1_DMA_TOUT_IRQ (1 << 0) 326#define OMAP1_DMA_TOUT_IRQ (1 << 0)
diff --git a/arch/arm/plat-omap/include/plat/irqs.h b/arch/arm/plat-omap/include/plat/irqs.h
index c01d9f08a198..65e20a686713 100644
--- a/arch/arm/plat-omap/include/plat/irqs.h
+++ b/arch/arm/plat-omap/include/plat/irqs.h
@@ -345,6 +345,8 @@
345#define INT_34XX_MMC3_IRQ 94 345#define INT_34XX_MMC3_IRQ 94
346#define INT_34XX_GPT12_IRQ 95 346#define INT_34XX_GPT12_IRQ 95
347 347
348#define INT_36XX_UART4_IRQ 80
349
348#define INT_35XX_HECC0_IRQ 24 350#define INT_35XX_HECC0_IRQ 24
349#define INT_35XX_HECC1_IRQ 28 351#define INT_35XX_HECC1_IRQ 28
350#define INT_35XX_EMAC_C0_RXTHRESH_IRQ 67 352#define INT_35XX_EMAC_C0_RXTHRESH_IRQ 67
diff --git a/arch/arm/plat-omap/include/plat/omap-serial.h b/arch/arm/plat-omap/include/plat/omap-serial.h
new file mode 100644
index 000000000000..0d6f076cf748
--- /dev/null
+++ b/arch/arm/plat-omap/include/plat/omap-serial.h
@@ -0,0 +1,129 @@
1/*
2 * Driver for OMAP-UART controller.
3 * Based on drivers/serial/8250.c
4 *
5 * Copyright (C) 2010 Texas Instruments.
6 *
7 * Authors:
8 * Govindraj R <govindraj.raja@ti.com>
9 * Thara Gopinath <thara@ti.com>
10 *
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 2 of the License, or
14 * (at your option) any later version.
15 */
16
17#ifndef __OMAP_SERIAL_H__
18#define __OMAP_SERIAL_H__
19
20#include <linux/serial_core.h>
21#include <linux/platform_device.h>
22
23#include <plat/control.h>
24#include <plat/mux.h>
25
26#define DRIVER_NAME "omap-hsuart"
27
28/*
29 * Use tty device name as ttyO, [O -> OMAP]
30 * in bootargs we specify as console=ttyO0 if uart1
31 * is used as console uart.
32 */
33#define OMAP_SERIAL_NAME "ttyO"
34
35#define OMAP_MDR1_DISABLE 0x07
36#define OMAP_MDR1_MODE13X 0x03
37#define OMAP_MDR1_MODE16X 0x00
38#define OMAP_MODE13X_SPEED 230400
39
40/*
41 * LCR = 0XBF: Switch to Configuration Mode B.
42 * In configuration mode b allow access
43 * to EFR,DLL,DLH.
44 * Reference OMAP TRM Chapter 17
45 * Section: 1.4.3 Mode Selection
46 */
47#define OMAP_UART_LCR_CONF_MDB 0XBF
48
49/* WER = 0x7F
50 * Enable module level wakeup in WER reg
51 */
52#define OMAP_UART_WER_MOD_WKUP 0X7F
53
54/* Enable XON/XOFF flow control on output */
55#define OMAP_UART_SW_TX 0x04
56
57/* Enable XON/XOFF flow control on input */
58#define OMAP_UART_SW_RX 0x04
59
60#define OMAP_UART_SYSC_RESET 0X07
61#define OMAP_UART_TCR_TRIG 0X0F
62#define OMAP_UART_SW_CLR 0XF0
63#define OMAP_UART_FIFO_CLR 0X06
64
65#define OMAP_UART_DMA_CH_FREE -1
66
67#define RX_TIMEOUT (3 * HZ)
68#define OMAP_MAX_HSUART_PORTS 4
69
70#define MSR_SAVE_FLAGS UART_MSR_ANY_DELTA
71
72struct omap_uart_port_info {
73 bool dma_enabled; /* To specify DMA Mode */
74 unsigned int uartclk; /* UART clock rate */
75 void __iomem *membase; /* ioremap cookie or NULL */
76 resource_size_t mapbase; /* resource base */
77 unsigned long irqflags; /* request_irq flags */
78 upf_t flags; /* UPF_* flags */
79};
80
81struct uart_omap_dma {
82 u8 uart_dma_tx;
83 u8 uart_dma_rx;
84 int rx_dma_channel;
85 int tx_dma_channel;
86 dma_addr_t rx_buf_dma_phys;
87 dma_addr_t tx_buf_dma_phys;
88 unsigned int uart_base;
89 /*
90 * Buffer for rx dma.It is not required for tx because the buffer
91 * comes from port structure.
92 */
93 unsigned char *rx_buf;
94 unsigned int prev_rx_dma_pos;
95 int tx_buf_size;
96 int tx_dma_used;
97 int rx_dma_used;
98 spinlock_t tx_lock;
99 spinlock_t rx_lock;
100 /* timer to poll activity on rx dma */
101 struct timer_list rx_timer;
102 int rx_buf_size;
103 int rx_timeout;
104};
105
106struct uart_omap_port {
107 struct uart_port port;
108 struct uart_omap_dma uart_dma;
109 struct platform_device *pdev;
110
111 unsigned char ier;
112 unsigned char lcr;
113 unsigned char mcr;
114 unsigned char fcr;
115 unsigned char efr;
116
117 int use_dma;
118 /*
119 * Some bits in registers are cleared on a read, so they must
120 * be saved whenever the register is read but the bits will not
121 * be immediately processed.
122 */
123 unsigned int lsr_break_flag;
124 unsigned char msr_saved_flags;
125 char name[20];
126 unsigned long port_activity;
127};
128
129#endif /* __OMAP_SERIAL_H__ */