aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/plat-omap
diff options
context:
space:
mode:
authorKevin Hilman <khilman@deeprootsystems.com>2010-10-01 16:24:10 -0400
committerKevin Hilman <khilman@deeprootsystems.com>2010-10-01 16:24:10 -0400
commit69758ab7a1e2de5636a2188d5357dd03140bf1d8 (patch)
tree13d65cbee4cc6bfed697bd164a15529ad86c2b25 /arch/arm/plat-omap
parent963bfb0939232e415c7bfb19b08dce300eb148d9 (diff)
parent257f23d87f9309fee41d468575404b9371bf4c7d (diff)
manual merge for pm-hwmod-uart due to conflicts
Diffstat (limited to 'arch/arm/plat-omap')
-rw-r--r--arch/arm/plat-omap/common.c16
-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
5 files changed, 133 insertions, 17 deletions
diff --git a/arch/arm/plat-omap/common.c b/arch/arm/plat-omap/common.c
index 7d668b3b5363..947de3fb93f3 100644
--- a/arch/arm/plat-omap/common.c
+++ b/arch/arm/plat-omap/common.c
@@ -257,7 +257,6 @@ static void __init __omap2_set_globals(struct omap_globals *omap2_globals)
257 omap2_set_globals_sdrc(omap2_globals); 257 omap2_set_globals_sdrc(omap2_globals);
258 omap2_set_globals_control(omap2_globals); 258 omap2_set_globals_control(omap2_globals);
259 omap2_set_globals_prcm(omap2_globals); 259 omap2_set_globals_prcm(omap2_globals);
260 omap2_set_globals_uart(omap2_globals);
261} 260}
262 261
263#endif 262#endif
@@ -272,9 +271,6 @@ static struct omap_globals omap242x_globals = {
272 .ctrl = OMAP2420_CTRL_BASE, 271 .ctrl = OMAP2420_CTRL_BASE,
273 .prm = OMAP2420_PRM_BASE, 272 .prm = OMAP2420_PRM_BASE,
274 .cm = OMAP2420_CM_BASE, 273 .cm = OMAP2420_CM_BASE,
275 .uart1_phys = OMAP2_UART1_BASE,
276 .uart2_phys = OMAP2_UART2_BASE,
277 .uart3_phys = OMAP2_UART3_BASE,
278}; 274};
279 275
280void __init omap2_set_globals_242x(void) 276void __init omap2_set_globals_242x(void)
@@ -293,9 +289,6 @@ static struct omap_globals omap243x_globals = {
293 .ctrl = OMAP243X_CTRL_BASE, 289 .ctrl = OMAP243X_CTRL_BASE,
294 .prm = OMAP2430_PRM_BASE, 290 .prm = OMAP2430_PRM_BASE,
295 .cm = OMAP2430_CM_BASE, 291 .cm = OMAP2430_CM_BASE,
296 .uart1_phys = OMAP2_UART1_BASE,
297 .uart2_phys = OMAP2_UART2_BASE,
298 .uart3_phys = OMAP2_UART3_BASE,
299}; 292};
300 293
301void __init omap2_set_globals_243x(void) 294void __init omap2_set_globals_243x(void)
@@ -314,10 +307,6 @@ static struct omap_globals omap3_globals = {
314 .ctrl = OMAP343X_CTRL_BASE, 307 .ctrl = OMAP343X_CTRL_BASE,
315 .prm = OMAP3430_PRM_BASE, 308 .prm = OMAP3430_PRM_BASE,
316 .cm = OMAP3430_CM_BASE, 309 .cm = OMAP3430_CM_BASE,
317 .uart1_phys = OMAP3_UART1_BASE,
318 .uart2_phys = OMAP3_UART2_BASE,
319 .uart3_phys = OMAP3_UART3_BASE,
320 .uart4_phys = OMAP3_UART4_BASE, /* Only on 3630 */
321}; 310};
322 311
323void __init omap2_set_globals_3xxx(void) 312void __init omap2_set_globals_3xxx(void)
@@ -341,10 +330,6 @@ static struct omap_globals omap4_globals = {
341 .prm = OMAP4430_PRM_BASE, 330 .prm = OMAP4430_PRM_BASE,
342 .cm = OMAP4430_CM_BASE, 331 .cm = OMAP4430_CM_BASE,
343 .cm2 = OMAP4430_CM2_BASE, 332 .cm2 = OMAP4430_CM2_BASE,
344 .uart1_phys = OMAP4_UART1_BASE,
345 .uart2_phys = OMAP4_UART2_BASE,
346 .uart3_phys = OMAP4_UART3_BASE,
347 .uart4_phys = OMAP4_UART4_BASE,
348}; 333};
349 334
350void __init omap2_set_globals_443x(void) 335void __init omap2_set_globals_443x(void)
@@ -352,7 +337,6 @@ void __init omap2_set_globals_443x(void)
352 omap2_set_globals_tap(&omap4_globals); 337 omap2_set_globals_tap(&omap4_globals);
353 omap2_set_globals_control(&omap4_globals); 338 omap2_set_globals_control(&omap4_globals);
354 omap2_set_globals_prcm(&omap4_globals); 339 omap2_set_globals_prcm(&omap4_globals);
355 omap2_set_globals_uart(&omap4_globals);
356} 340}
357#endif 341#endif
358 342
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__ */