diff options
author | Tony Lindgren <tony@atomide.com> | 2010-10-08 13:20:40 -0400 |
---|---|---|
committer | Tony Lindgren <tony@atomide.com> | 2010-10-08 13:20:40 -0400 |
commit | bc3caae8a191c712d8ae666d0b8d18807bfe2b14 (patch) | |
tree | 7b338ebba2f1fdbcee3785789bf9f4a74d93aa94 /arch/arm/plat-omap | |
parent | 73c5ef126f40b0b872e5964ff65dbe792eeec493 (diff) | |
parent | 69758ab7a1e2de5636a2188d5357dd03140bf1d8 (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')
-rw-r--r-- | arch/arm/plat-omap/common.c | 16 | ||||
-rw-r--r-- | arch/arm/plat-omap/devices.c | 41 | ||||
-rw-r--r-- | arch/arm/plat-omap/include/plat/common.h | 1 | ||||
-rw-r--r-- | arch/arm/plat-omap/include/plat/dma.h | 2 | ||||
-rw-r--r-- | arch/arm/plat-omap/include/plat/irqs.h | 2 | ||||
-rw-r--r-- | arch/arm/plat-omap/include/plat/omap-serial.h | 129 |
6 files changed, 133 insertions, 58 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 | ||
280 | void __init omap2_set_globals_242x(void) | 276 | void __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 | ||
301 | void __init omap2_set_globals_243x(void) | 294 | void __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 | ||
323 | void __init omap2_set_globals_3xxx(void) | 312 | void __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 | ||
350 | void __init omap2_set_globals_443x(void) | 335 | void __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/devices.c b/arch/arm/plat-omap/devices.c index d1920be7833b..8e88e0e5d524 100644 --- a/arch/arm/plat-omap/devices.c +++ b/arch/arm/plat-omap/devices.c | |||
@@ -232,46 +232,6 @@ static void omap_init_uwire(void) | |||
232 | static inline void omap_init_uwire(void) {} | 232 | static inline void omap_init_uwire(void) {} |
233 | #endif | 233 | #endif |
234 | 234 | ||
235 | /*-------------------------------------------------------------------------*/ | ||
236 | |||
237 | #if defined(CONFIG_OMAP_WATCHDOG) || defined(CONFIG_OMAP_WATCHDOG_MODULE) | ||
238 | |||
239 | static struct resource wdt_resources[] = { | ||
240 | { | ||
241 | .flags = IORESOURCE_MEM, | ||
242 | }, | ||
243 | }; | ||
244 | |||
245 | static struct platform_device omap_wdt_device = { | ||
246 | .name = "omap_wdt", | ||
247 | .id = -1, | ||
248 | .num_resources = ARRAY_SIZE(wdt_resources), | ||
249 | .resource = wdt_resources, | ||
250 | }; | ||
251 | |||
252 | static void omap_init_wdt(void) | ||
253 | { | ||
254 | if (cpu_is_omap16xx()) | ||
255 | wdt_resources[0].start = 0xfffeb000; | ||
256 | else if (cpu_is_omap2420()) | ||
257 | wdt_resources[0].start = 0x48022000; /* WDT2 */ | ||
258 | else if (cpu_is_omap2430()) | ||
259 | wdt_resources[0].start = 0x49016000; /* WDT2 */ | ||
260 | else if (cpu_is_omap343x()) | ||
261 | wdt_resources[0].start = 0x48314000; /* WDT2 */ | ||
262 | else if (cpu_is_omap44xx()) | ||
263 | wdt_resources[0].start = 0x4a314000; | ||
264 | else | ||
265 | return; | ||
266 | |||
267 | wdt_resources[0].end = wdt_resources[0].start + 0x4f; | ||
268 | |||
269 | (void) platform_device_register(&omap_wdt_device); | ||
270 | } | ||
271 | #else | ||
272 | static inline void omap_init_wdt(void) {} | ||
273 | #endif | ||
274 | |||
275 | /* | 235 | /* |
276 | * This gets called after board-specific INIT_MACHINE, and initializes most | 236 | * This gets called after board-specific INIT_MACHINE, and initializes most |
277 | * on-chip peripherals accessible on this board (except for few like USB): | 237 | * on-chip peripherals accessible on this board (except for few like USB): |
@@ -300,7 +260,6 @@ static int __init omap_init_devices(void) | |||
300 | omap_init_rng(); | 260 | omap_init_rng(); |
301 | omap_init_mcpdm(); | 261 | omap_init_mcpdm(); |
302 | omap_init_uwire(); | 262 | omap_init_uwire(); |
303 | omap_init_wdt(); | ||
304 | return 0; | 263 | return 0; |
305 | } | 264 | } |
306 | arch_initcall(omap_init_devices); | 265 | arch_initcall(omap_init_devices); |
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 *); | |||
67 | void omap2_set_globals_sdrc(struct omap_globals *); | 67 | void omap2_set_globals_sdrc(struct omap_globals *); |
68 | void omap2_set_globals_control(struct omap_globals *); | 68 | void omap2_set_globals_control(struct omap_globals *); |
69 | void omap2_set_globals_prcm(struct omap_globals *); | 69 | void omap2_set_globals_prcm(struct omap_globals *); |
70 | void omap2_set_globals_uart(struct omap_globals *); | ||
71 | 70 | ||
72 | void omap3_map_io(void); | 71 | void 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 | |||
72 | struct 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 | |||
81 | struct 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 | |||
106 | struct 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__ */ | ||