Tony Lindgren | 1dbae81 | 2005-11-10 14:26:51 +0000 | [diff] [blame] | 1 | /* |
Uwe Zeisberger | f30c226 | 2006-10-03 23:01:26 +0200 | [diff] [blame] | 2 | * arch/arm/mach-omap2/serial.c |
Tony Lindgren | 1dbae81 | 2005-11-10 14:26:51 +0000 | [diff] [blame] | 3 | * |
| 4 | * OMAP2 serial support. |
| 5 | * |
Jouni Hogander | 6e81176 | 2008-10-06 15:49:15 +0300 | [diff] [blame] | 6 | * Copyright (C) 2005-2008 Nokia Corporation |
Tony Lindgren | 1dbae81 | 2005-11-10 14:26:51 +0000 | [diff] [blame] | 7 | * Author: Paul Mundt <paul.mundt@nokia.com> |
| 8 | * |
Kevin Hilman | 4af4016 | 2009-02-04 10:51:40 -0800 | [diff] [blame] | 9 | * Major rework for PM support by Kevin Hilman |
| 10 | * |
Tony Lindgren | 1dbae81 | 2005-11-10 14:26:51 +0000 | [diff] [blame] | 11 | * Based off of arch/arm/mach-omap/omap1/serial.c |
| 12 | * |
Santosh Shilimkar | 4416907 | 2009-05-28 14:16:04 -0700 | [diff] [blame] | 13 | * Copyright (C) 2009 Texas Instruments |
| 14 | * Added OMAP4 support - Santosh Shilimkar <santosh.shilimkar@ti.com |
| 15 | * |
Tony Lindgren | 1dbae81 | 2005-11-10 14:26:51 +0000 | [diff] [blame] | 16 | * This file is subject to the terms and conditions of the GNU General Public |
| 17 | * License. See the file "COPYING" in the main directory of this archive |
| 18 | * for more details. |
| 19 | */ |
| 20 | #include <linux/kernel.h> |
| 21 | #include <linux/init.h> |
Russell King | f8ce254 | 2006-01-07 16:15:52 +0000 | [diff] [blame] | 22 | #include <linux/clk.h> |
Russell King | fced80c | 2008-09-06 12:10:45 +0100 | [diff] [blame] | 23 | #include <linux/io.h> |
Santosh Shilimkar | e03d37d | 2010-02-18 08:59:06 +0000 | [diff] [blame] | 24 | #include <linux/delay.h> |
Kevin Hilman | 6f251e9 | 2010-09-27 20:19:38 +0530 | [diff] [blame] | 25 | #include <linux/platform_device.h> |
| 26 | #include <linux/slab.h> |
Kevin Hilman | 3244fcd | 2010-09-27 20:19:53 +0530 | [diff] [blame] | 27 | #include <linux/pm_runtime.h> |
Paul Walmsley | 0d8e2d0 | 2010-11-24 16:49:05 -0700 | [diff] [blame] | 28 | #include <linux/console.h> |
Kevin Hilman | 6f251e9 | 2010-09-27 20:19:38 +0530 | [diff] [blame] | 29 | |
Kevin Hilman | 6f251e9 | 2010-09-27 20:19:38 +0530 | [diff] [blame] | 30 | #include <plat/omap-serial.h> |
Tony Lindgren | 4e65331 | 2011-11-10 22:45:17 +0100 | [diff] [blame] | 31 | #include "common.h" |
Tony Lindgren | ce491cf | 2009-10-20 09:40:47 -0700 | [diff] [blame] | 32 | #include <plat/board.h> |
Kevin Hilman | 6f251e9 | 2010-09-27 20:19:38 +0530 | [diff] [blame] | 33 | #include <plat/dma.h> |
| 34 | #include <plat/omap_hwmod.h> |
| 35 | #include <plat/omap_device.h> |
Tony Lindgren | 1dbae81 | 2005-11-10 14:26:51 +0000 | [diff] [blame] | 36 | |
Paul Walmsley | 59fb659 | 2010-12-21 15:30:55 -0700 | [diff] [blame] | 37 | #include "prm2xxx_3xxx.h" |
Kevin Hilman | 4af4016 | 2009-02-04 10:51:40 -0800 | [diff] [blame] | 38 | #include "pm.h" |
Paul Walmsley | 59fb659 | 2010-12-21 15:30:55 -0700 | [diff] [blame] | 39 | #include "cm2xxx_3xxx.h" |
Kevin Hilman | 4af4016 | 2009-02-04 10:51:40 -0800 | [diff] [blame] | 40 | #include "prm-regbits-34xx.h" |
Paul Walmsley | 4814ced | 2010-10-08 11:40:20 -0600 | [diff] [blame] | 41 | #include "control.h" |
Tony Lindgren | 40e4439 | 2010-12-22 18:42:35 -0800 | [diff] [blame] | 42 | #include "mux.h" |
Kevin Hilman | 4af4016 | 2009-02-04 10:51:40 -0800 | [diff] [blame] | 43 | |
| 44 | #define UART_OMAP_WER 0x17 /* Wake-up enable register */ |
| 45 | |
Deepak K | 0003450 | 2010-08-02 13:18:12 +0300 | [diff] [blame] | 46 | #define UART_ERRATA_i202_MDR1_ACCESS (0x1 << 1) |
Nishanth Menon | 5a927b3 | 2010-08-02 13:18:12 +0300 | [diff] [blame] | 47 | |
Tony Lindgren | 301fe8e | 2010-02-01 12:34:31 -0800 | [diff] [blame] | 48 | /* |
| 49 | * NOTE: By default the serial timeout is disabled as it causes lost characters |
| 50 | * over the serial ports. This means that the UART clocks will stay on until |
| 51 | * disabled via sysfs. This also causes that any deeper omap sleep states are |
| 52 | * blocked. |
| 53 | */ |
| 54 | #define DEFAULT_TIMEOUT 0 |
Kevin Hilman | 4af4016 | 2009-02-04 10:51:40 -0800 | [diff] [blame] | 55 | |
Kevin Hilman | 6f251e9 | 2010-09-27 20:19:38 +0530 | [diff] [blame] | 56 | #define MAX_UART_HWMOD_NAME_LEN 16 |
| 57 | |
Kevin Hilman | 4af4016 | 2009-02-04 10:51:40 -0800 | [diff] [blame] | 58 | struct omap_uart_state { |
| 59 | int num; |
| 60 | int can_sleep; |
Kevin Hilman | 4af4016 | 2009-02-04 10:51:40 -0800 | [diff] [blame] | 61 | |
| 62 | void __iomem *wk_st; |
| 63 | void __iomem *wk_en; |
| 64 | u32 wk_mask; |
| 65 | u32 padconf; |
Kevin Hilman | 6f251e9 | 2010-09-27 20:19:38 +0530 | [diff] [blame] | 66 | u32 dma_enabled; |
Kevin Hilman | 4af4016 | 2009-02-04 10:51:40 -0800 | [diff] [blame] | 67 | |
Kevin Hilman | 4af4016 | 2009-02-04 10:51:40 -0800 | [diff] [blame] | 68 | int clocked; |
| 69 | |
Kevin Hilman | 6f251e9 | 2010-09-27 20:19:38 +0530 | [diff] [blame] | 70 | int regshift; |
Kevin Hilman | 6f251e9 | 2010-09-27 20:19:38 +0530 | [diff] [blame] | 71 | void __iomem *membase; |
| 72 | resource_size_t mapbase; |
| 73 | |
Kevin Hilman | 4af4016 | 2009-02-04 10:51:40 -0800 | [diff] [blame] | 74 | struct list_head node; |
Kevin Hilman | 6f251e9 | 2010-09-27 20:19:38 +0530 | [diff] [blame] | 75 | struct omap_hwmod *oh; |
| 76 | struct platform_device *pdev; |
Kevin Hilman | 4af4016 | 2009-02-04 10:51:40 -0800 | [diff] [blame] | 77 | |
Nishanth Menon | 5a927b3 | 2010-08-02 13:18:12 +0300 | [diff] [blame] | 78 | u32 errata; |
Kevin Hilman | 4af4016 | 2009-02-04 10:51:40 -0800 | [diff] [blame] | 79 | #if defined(CONFIG_ARCH_OMAP3) && defined(CONFIG_PM) |
| 80 | int context_valid; |
| 81 | |
| 82 | /* Registers to be saved/restored for OFF-mode */ |
| 83 | u16 dll; |
| 84 | u16 dlh; |
| 85 | u16 ier; |
| 86 | u16 sysc; |
| 87 | u16 scr; |
| 88 | u16 wer; |
Govindraj R | 5ade4ff | 2010-08-02 13:18:11 +0300 | [diff] [blame] | 89 | u16 mcr; |
Kevin Hilman | 4af4016 | 2009-02-04 10:51:40 -0800 | [diff] [blame] | 90 | #endif |
| 91 | }; |
| 92 | |
Kevin Hilman | 4af4016 | 2009-02-04 10:51:40 -0800 | [diff] [blame] | 93 | static LIST_HEAD(uart_list); |
Kevin Hilman | 6f251e9 | 2010-09-27 20:19:38 +0530 | [diff] [blame] | 94 | static u8 num_uarts; |
Tony Lindgren | 1dbae81 | 2005-11-10 14:26:51 +0000 | [diff] [blame] | 95 | |
Alexander Shishkin | 9230372 | 2010-01-08 10:29:06 -0800 | [diff] [blame] | 96 | static inline unsigned int __serial_read_reg(struct uart_port *up, |
Kevin Hilman | 6f251e9 | 2010-09-27 20:19:38 +0530 | [diff] [blame] | 97 | int offset) |
Alexander Shishkin | 9230372 | 2010-01-08 10:29:06 -0800 | [diff] [blame] | 98 | { |
| 99 | offset <<= up->regshift; |
| 100 | return (unsigned int)__raw_readb(up->membase + offset); |
| 101 | } |
| 102 | |
Kevin Hilman | 6f251e9 | 2010-09-27 20:19:38 +0530 | [diff] [blame] | 103 | static inline unsigned int serial_read_reg(struct omap_uart_state *uart, |
Tony Lindgren | 1dbae81 | 2005-11-10 14:26:51 +0000 | [diff] [blame] | 104 | int offset) |
| 105 | { |
Kevin Hilman | 6f251e9 | 2010-09-27 20:19:38 +0530 | [diff] [blame] | 106 | offset <<= uart->regshift; |
| 107 | return (unsigned int)__raw_readb(uart->membase + offset); |
Tony Lindgren | 1dbae81 | 2005-11-10 14:26:51 +0000 | [diff] [blame] | 108 | } |
| 109 | |
Santosh Shilimkar | e03d37d | 2010-02-18 08:59:06 +0000 | [diff] [blame] | 110 | static inline void __serial_write_reg(struct uart_port *up, int offset, |
| 111 | int value) |
| 112 | { |
| 113 | offset <<= up->regshift; |
| 114 | __raw_writeb(value, up->membase + offset); |
| 115 | } |
| 116 | |
Kevin Hilman | 6f251e9 | 2010-09-27 20:19:38 +0530 | [diff] [blame] | 117 | static inline void serial_write_reg(struct omap_uart_state *uart, int offset, |
Tony Lindgren | 1dbae81 | 2005-11-10 14:26:51 +0000 | [diff] [blame] | 118 | int value) |
| 119 | { |
Kevin Hilman | 6f251e9 | 2010-09-27 20:19:38 +0530 | [diff] [blame] | 120 | offset <<= uart->regshift; |
| 121 | __raw_writeb(value, uart->membase + offset); |
Tony Lindgren | 1dbae81 | 2005-11-10 14:26:51 +0000 | [diff] [blame] | 122 | } |
| 123 | |
| 124 | /* |
| 125 | * Internal UARTs need to be initialized for the 8250 autoconfig to work |
| 126 | * properly. Note that the TX watermark initialization may not be needed |
| 127 | * once the 8250.c watermark handling code is merged. |
| 128 | */ |
Kevin Hilman | 6f251e9 | 2010-09-27 20:19:38 +0530 | [diff] [blame] | 129 | |
Kevin Hilman | 4af4016 | 2009-02-04 10:51:40 -0800 | [diff] [blame] | 130 | static inline void __init omap_uart_reset(struct omap_uart_state *uart) |
Tony Lindgren | 1dbae81 | 2005-11-10 14:26:51 +0000 | [diff] [blame] | 131 | { |
Andrei Emeltchenko | 498cb95 | 2010-11-30 14:11:49 -0800 | [diff] [blame] | 132 | serial_write_reg(uart, UART_OMAP_MDR1, UART_OMAP_MDR1_DISABLE); |
Kevin Hilman | 6f251e9 | 2010-09-27 20:19:38 +0530 | [diff] [blame] | 133 | serial_write_reg(uart, UART_OMAP_SCR, 0x08); |
Andrei Emeltchenko | 498cb95 | 2010-11-30 14:11:49 -0800 | [diff] [blame] | 134 | serial_write_reg(uart, UART_OMAP_MDR1, UART_OMAP_MDR1_16X_MODE); |
Tony Lindgren | 1dbae81 | 2005-11-10 14:26:51 +0000 | [diff] [blame] | 135 | } |
| 136 | |
Kevin Hilman | 4af4016 | 2009-02-04 10:51:40 -0800 | [diff] [blame] | 137 | #if defined(CONFIG_PM) && defined(CONFIG_ARCH_OMAP3) |
| 138 | |
Deepak K | 0003450 | 2010-08-02 13:18:12 +0300 | [diff] [blame] | 139 | /* |
| 140 | * Work Around for Errata i202 (3430 - 1.12, 3630 - 1.6) |
| 141 | * The access to uart register after MDR1 Access |
| 142 | * causes UART to corrupt data. |
| 143 | * |
| 144 | * Need a delay = |
| 145 | * 5 L4 clock cycles + 5 UART functional clock cycle (@48MHz = ~0.2uS) |
| 146 | * give 10 times as much |
| 147 | */ |
| 148 | static void omap_uart_mdr1_errataset(struct omap_uart_state *uart, u8 mdr1_val, |
| 149 | u8 fcr_val) |
| 150 | { |
Deepak K | 0003450 | 2010-08-02 13:18:12 +0300 | [diff] [blame] | 151 | u8 timeout = 255; |
| 152 | |
Kevin Hilman | 6f251e9 | 2010-09-27 20:19:38 +0530 | [diff] [blame] | 153 | serial_write_reg(uart, UART_OMAP_MDR1, mdr1_val); |
Deepak K | 0003450 | 2010-08-02 13:18:12 +0300 | [diff] [blame] | 154 | udelay(2); |
Kevin Hilman | 6f251e9 | 2010-09-27 20:19:38 +0530 | [diff] [blame] | 155 | serial_write_reg(uart, UART_FCR, fcr_val | UART_FCR_CLEAR_XMIT | |
Deepak K | 0003450 | 2010-08-02 13:18:12 +0300 | [diff] [blame] | 156 | UART_FCR_CLEAR_RCVR); |
| 157 | /* |
| 158 | * Wait for FIFO to empty: when empty, RX_FIFO_E bit is 0 and |
| 159 | * TX_FIFO_E bit is 1. |
| 160 | */ |
Kevin Hilman | 6f251e9 | 2010-09-27 20:19:38 +0530 | [diff] [blame] | 161 | while (UART_LSR_THRE != (serial_read_reg(uart, UART_LSR) & |
Deepak K | 0003450 | 2010-08-02 13:18:12 +0300 | [diff] [blame] | 162 | (UART_LSR_THRE | UART_LSR_DR))) { |
| 163 | timeout--; |
| 164 | if (!timeout) { |
| 165 | /* Should *never* happen. we warn and carry on */ |
Kevin Hilman | 6f251e9 | 2010-09-27 20:19:38 +0530 | [diff] [blame] | 166 | dev_crit(&uart->pdev->dev, "Errata i202: timedout %x\n", |
| 167 | serial_read_reg(uart, UART_LSR)); |
Deepak K | 0003450 | 2010-08-02 13:18:12 +0300 | [diff] [blame] | 168 | break; |
| 169 | } |
| 170 | udelay(1); |
| 171 | } |
| 172 | } |
| 173 | |
Kevin Hilman | 4af4016 | 2009-02-04 10:51:40 -0800 | [diff] [blame] | 174 | static void omap_uart_save_context(struct omap_uart_state *uart) |
Jouni Hogander | 6e81176 | 2008-10-06 15:49:15 +0300 | [diff] [blame] | 175 | { |
Kevin Hilman | 4af4016 | 2009-02-04 10:51:40 -0800 | [diff] [blame] | 176 | u16 lcr = 0; |
Kevin Hilman | 4af4016 | 2009-02-04 10:51:40 -0800 | [diff] [blame] | 177 | |
| 178 | if (!enable_off_mode) |
| 179 | return; |
| 180 | |
Kevin Hilman | 6f251e9 | 2010-09-27 20:19:38 +0530 | [diff] [blame] | 181 | lcr = serial_read_reg(uart, UART_LCR); |
Andrei Emeltchenko | 662b083a | 2010-11-30 14:11:49 -0800 | [diff] [blame] | 182 | serial_write_reg(uart, UART_LCR, UART_LCR_CONF_MODE_B); |
Kevin Hilman | 6f251e9 | 2010-09-27 20:19:38 +0530 | [diff] [blame] | 183 | uart->dll = serial_read_reg(uart, UART_DLL); |
| 184 | uart->dlh = serial_read_reg(uart, UART_DLM); |
| 185 | serial_write_reg(uart, UART_LCR, lcr); |
| 186 | uart->ier = serial_read_reg(uart, UART_IER); |
| 187 | uart->sysc = serial_read_reg(uart, UART_OMAP_SYSC); |
| 188 | uart->scr = serial_read_reg(uart, UART_OMAP_SCR); |
| 189 | uart->wer = serial_read_reg(uart, UART_OMAP_WER); |
Andrei Emeltchenko | 662b083a | 2010-11-30 14:11:49 -0800 | [diff] [blame] | 190 | serial_write_reg(uart, UART_LCR, UART_LCR_CONF_MODE_A); |
Kevin Hilman | 6f251e9 | 2010-09-27 20:19:38 +0530 | [diff] [blame] | 191 | uart->mcr = serial_read_reg(uart, UART_MCR); |
| 192 | serial_write_reg(uart, UART_LCR, lcr); |
Kevin Hilman | 4af4016 | 2009-02-04 10:51:40 -0800 | [diff] [blame] | 193 | |
| 194 | uart->context_valid = 1; |
| 195 | } |
| 196 | |
| 197 | static void omap_uart_restore_context(struct omap_uart_state *uart) |
| 198 | { |
| 199 | u16 efr = 0; |
Kevin Hilman | 4af4016 | 2009-02-04 10:51:40 -0800 | [diff] [blame] | 200 | |
| 201 | if (!enable_off_mode) |
| 202 | return; |
| 203 | |
| 204 | if (!uart->context_valid) |
| 205 | return; |
| 206 | |
| 207 | uart->context_valid = 0; |
| 208 | |
Deepak K | 0003450 | 2010-08-02 13:18:12 +0300 | [diff] [blame] | 209 | if (uart->errata & UART_ERRATA_i202_MDR1_ACCESS) |
Andrei Emeltchenko | 498cb95 | 2010-11-30 14:11:49 -0800 | [diff] [blame] | 210 | omap_uart_mdr1_errataset(uart, UART_OMAP_MDR1_DISABLE, 0xA0); |
Deepak K | 0003450 | 2010-08-02 13:18:12 +0300 | [diff] [blame] | 211 | else |
Andrei Emeltchenko | 498cb95 | 2010-11-30 14:11:49 -0800 | [diff] [blame] | 212 | serial_write_reg(uart, UART_OMAP_MDR1, UART_OMAP_MDR1_DISABLE); |
| 213 | |
Andrei Emeltchenko | 662b083a | 2010-11-30 14:11:49 -0800 | [diff] [blame] | 214 | serial_write_reg(uart, UART_LCR, UART_LCR_CONF_MODE_B); |
Kevin Hilman | 6f251e9 | 2010-09-27 20:19:38 +0530 | [diff] [blame] | 215 | efr = serial_read_reg(uart, UART_EFR); |
| 216 | serial_write_reg(uart, UART_EFR, UART_EFR_ECB); |
| 217 | serial_write_reg(uart, UART_LCR, 0x0); /* Operational mode */ |
| 218 | serial_write_reg(uart, UART_IER, 0x0); |
Andrei Emeltchenko | 662b083a | 2010-11-30 14:11:49 -0800 | [diff] [blame] | 219 | serial_write_reg(uart, UART_LCR, UART_LCR_CONF_MODE_B); |
Kevin Hilman | 6f251e9 | 2010-09-27 20:19:38 +0530 | [diff] [blame] | 220 | serial_write_reg(uart, UART_DLL, uart->dll); |
| 221 | serial_write_reg(uart, UART_DLM, uart->dlh); |
| 222 | serial_write_reg(uart, UART_LCR, 0x0); /* Operational mode */ |
| 223 | serial_write_reg(uart, UART_IER, uart->ier); |
Andrei Emeltchenko | 662b083a | 2010-11-30 14:11:49 -0800 | [diff] [blame] | 224 | serial_write_reg(uart, UART_LCR, UART_LCR_CONF_MODE_A); |
Kevin Hilman | 6f251e9 | 2010-09-27 20:19:38 +0530 | [diff] [blame] | 225 | serial_write_reg(uart, UART_MCR, uart->mcr); |
Andrei Emeltchenko | 662b083a | 2010-11-30 14:11:49 -0800 | [diff] [blame] | 226 | serial_write_reg(uart, UART_LCR, UART_LCR_CONF_MODE_B); |
Kevin Hilman | 6f251e9 | 2010-09-27 20:19:38 +0530 | [diff] [blame] | 227 | serial_write_reg(uart, UART_EFR, efr); |
| 228 | serial_write_reg(uart, UART_LCR, UART_LCR_WLEN8); |
| 229 | serial_write_reg(uart, UART_OMAP_SCR, uart->scr); |
| 230 | serial_write_reg(uart, UART_OMAP_WER, uart->wer); |
| 231 | serial_write_reg(uart, UART_OMAP_SYSC, uart->sysc); |
Andrei Emeltchenko | 498cb95 | 2010-11-30 14:11:49 -0800 | [diff] [blame] | 232 | |
Deepak K | 0003450 | 2010-08-02 13:18:12 +0300 | [diff] [blame] | 233 | if (uart->errata & UART_ERRATA_i202_MDR1_ACCESS) |
Andrei Emeltchenko | 498cb95 | 2010-11-30 14:11:49 -0800 | [diff] [blame] | 234 | omap_uart_mdr1_errataset(uart, UART_OMAP_MDR1_16X_MODE, 0xA1); |
Deepak K | 0003450 | 2010-08-02 13:18:12 +0300 | [diff] [blame] | 235 | else |
Kevin Hilman | 6f251e9 | 2010-09-27 20:19:38 +0530 | [diff] [blame] | 236 | /* UART 16x mode */ |
Andrei Emeltchenko | 498cb95 | 2010-11-30 14:11:49 -0800 | [diff] [blame] | 237 | serial_write_reg(uart, UART_OMAP_MDR1, |
| 238 | UART_OMAP_MDR1_16X_MODE); |
Kevin Hilman | 4af4016 | 2009-02-04 10:51:40 -0800 | [diff] [blame] | 239 | } |
| 240 | #else |
| 241 | static inline void omap_uart_save_context(struct omap_uart_state *uart) {} |
| 242 | static inline void omap_uart_restore_context(struct omap_uart_state *uart) {} |
| 243 | #endif /* CONFIG_PM && CONFIG_ARCH_OMAP3 */ |
| 244 | |
| 245 | static inline void omap_uart_enable_clocks(struct omap_uart_state *uart) |
| 246 | { |
| 247 | if (uart->clocked) |
| 248 | return; |
| 249 | |
Kevin Hilman | 6f251e9 | 2010-09-27 20:19:38 +0530 | [diff] [blame] | 250 | omap_device_enable(uart->pdev); |
Kevin Hilman | 4af4016 | 2009-02-04 10:51:40 -0800 | [diff] [blame] | 251 | uart->clocked = 1; |
| 252 | omap_uart_restore_context(uart); |
| 253 | } |
| 254 | |
| 255 | #ifdef CONFIG_PM |
| 256 | |
| 257 | static inline void omap_uart_disable_clocks(struct omap_uart_state *uart) |
| 258 | { |
| 259 | if (!uart->clocked) |
| 260 | return; |
| 261 | |
| 262 | omap_uart_save_context(uart); |
| 263 | uart->clocked = 0; |
Kevin Hilman | 6f251e9 | 2010-09-27 20:19:38 +0530 | [diff] [blame] | 264 | omap_device_idle(uart->pdev); |
Kevin Hilman | 4af4016 | 2009-02-04 10:51:40 -0800 | [diff] [blame] | 265 | } |
| 266 | |
Kevin Hilman | fd455ea | 2009-04-27 12:27:36 -0700 | [diff] [blame] | 267 | static void omap_uart_enable_wakeup(struct omap_uart_state *uart) |
| 268 | { |
| 269 | /* Set wake-enable bit */ |
| 270 | if (uart->wk_en && uart->wk_mask) { |
| 271 | u32 v = __raw_readl(uart->wk_en); |
| 272 | v |= uart->wk_mask; |
| 273 | __raw_writel(v, uart->wk_en); |
| 274 | } |
| 275 | |
| 276 | /* Ensure IOPAD wake-enables are set */ |
| 277 | if (cpu_is_omap34xx() && uart->padconf) { |
| 278 | u16 v = omap_ctrl_readw(uart->padconf); |
| 279 | v |= OMAP3_PADCONF_WAKEUPENABLE0; |
| 280 | omap_ctrl_writew(v, uart->padconf); |
| 281 | } |
| 282 | } |
| 283 | |
| 284 | static void omap_uart_disable_wakeup(struct omap_uart_state *uart) |
| 285 | { |
| 286 | /* Clear wake-enable bit */ |
| 287 | if (uart->wk_en && uart->wk_mask) { |
| 288 | u32 v = __raw_readl(uart->wk_en); |
| 289 | v &= ~uart->wk_mask; |
| 290 | __raw_writel(v, uart->wk_en); |
| 291 | } |
| 292 | |
| 293 | /* Ensure IOPAD wake-enables are cleared */ |
| 294 | if (cpu_is_omap34xx() && uart->padconf) { |
| 295 | u16 v = omap_ctrl_readw(uart->padconf); |
| 296 | v &= ~OMAP3_PADCONF_WAKEUPENABLE0; |
| 297 | omap_ctrl_writew(v, uart->padconf); |
| 298 | } |
| 299 | } |
| 300 | |
Kevin Hilman | 4af4016 | 2009-02-04 10:51:40 -0800 | [diff] [blame] | 301 | static void omap_uart_smart_idle_enable(struct omap_uart_state *uart, |
Kevin Hilman | 6f251e9 | 2010-09-27 20:19:38 +0530 | [diff] [blame] | 302 | int enable) |
Kevin Hilman | 4af4016 | 2009-02-04 10:51:40 -0800 | [diff] [blame] | 303 | { |
Kevin Hilman | 6f251e9 | 2010-09-27 20:19:38 +0530 | [diff] [blame] | 304 | u8 idlemode; |
Kevin Hilman | 4af4016 | 2009-02-04 10:51:40 -0800 | [diff] [blame] | 305 | |
Kevin Hilman | 6f251e9 | 2010-09-27 20:19:38 +0530 | [diff] [blame] | 306 | if (enable) { |
| 307 | /** |
| 308 | * Errata 2.15: [UART]:Cannot Acknowledge Idle Requests |
| 309 | * in Smartidle Mode When Configured for DMA Operations. |
| 310 | */ |
| 311 | if (uart->dma_enabled) |
| 312 | idlemode = HWMOD_IDLEMODE_FORCE; |
| 313 | else |
| 314 | idlemode = HWMOD_IDLEMODE_SMART; |
| 315 | } else { |
| 316 | idlemode = HWMOD_IDLEMODE_NO; |
| 317 | } |
Kevin Hilman | 4af4016 | 2009-02-04 10:51:40 -0800 | [diff] [blame] | 318 | |
Kevin Hilman | 6f251e9 | 2010-09-27 20:19:38 +0530 | [diff] [blame] | 319 | omap_hwmod_set_slave_idlemode(uart->oh, idlemode); |
Kevin Hilman | 4af4016 | 2009-02-04 10:51:40 -0800 | [diff] [blame] | 320 | } |
| 321 | |
| 322 | static void omap_uart_block_sleep(struct omap_uart_state *uart) |
| 323 | { |
| 324 | omap_uart_enable_clocks(uart); |
| 325 | |
| 326 | omap_uart_smart_idle_enable(uart, 0); |
| 327 | uart->can_sleep = 0; |
Kevin Hilman | 4af4016 | 2009-02-04 10:51:40 -0800 | [diff] [blame] | 328 | } |
| 329 | |
Kevin Hilman | 4af4016 | 2009-02-04 10:51:40 -0800 | [diff] [blame] | 330 | int omap_uart_can_sleep(void) |
| 331 | { |
| 332 | struct omap_uart_state *uart; |
| 333 | int can_sleep = 1; |
| 334 | |
| 335 | list_for_each_entry(uart, &uart_list, node) { |
| 336 | if (!uart->clocked) |
| 337 | continue; |
| 338 | |
| 339 | if (!uart->can_sleep) { |
| 340 | can_sleep = 0; |
| 341 | continue; |
| 342 | } |
| 343 | |
| 344 | /* This UART can now safely sleep. */ |
| 345 | omap_uart_allow_sleep(uart); |
| 346 | } |
| 347 | |
| 348 | return can_sleep; |
| 349 | } |
| 350 | |
Kevin Hilman | 4af4016 | 2009-02-04 10:51:40 -0800 | [diff] [blame] | 351 | static void omap_uart_idle_init(struct omap_uart_state *uart) |
| 352 | { |
Kevin Hilman | 4af4016 | 2009-02-04 10:51:40 -0800 | [diff] [blame] | 353 | int ret; |
| 354 | |
| 355 | uart->can_sleep = 0; |
Kevin Hilman | 4af4016 | 2009-02-04 10:51:40 -0800 | [diff] [blame] | 356 | omap_uart_smart_idle_enable(uart, 0); |
| 357 | |
Hemant Pedanekar | a920360 | 2011-12-13 10:46:44 -0800 | [diff] [blame] | 358 | if (cpu_is_omap34xx() && !(cpu_is_ti81xx() || cpu_is_am33xx())) { |
Govindraj.R | 52663ae | 2010-09-27 20:20:41 +0530 | [diff] [blame] | 359 | u32 mod = (uart->num > 1) ? OMAP3430_PER_MOD : CORE_MOD; |
Kevin Hilman | 4af4016 | 2009-02-04 10:51:40 -0800 | [diff] [blame] | 360 | u32 wk_mask = 0; |
| 361 | u32 padconf = 0; |
| 362 | |
Paul Walmsley | c4d7e58 | 2010-12-21 21:05:14 -0700 | [diff] [blame] | 363 | /* XXX These PRM accesses do not belong here */ |
Kevin Hilman | 4af4016 | 2009-02-04 10:51:40 -0800 | [diff] [blame] | 364 | uart->wk_en = OMAP34XX_PRM_REGADDR(mod, PM_WKEN1); |
| 365 | uart->wk_st = OMAP34XX_PRM_REGADDR(mod, PM_WKST1); |
| 366 | switch (uart->num) { |
| 367 | case 0: |
| 368 | wk_mask = OMAP3430_ST_UART1_MASK; |
| 369 | padconf = 0x182; |
| 370 | break; |
| 371 | case 1: |
| 372 | wk_mask = OMAP3430_ST_UART2_MASK; |
| 373 | padconf = 0x17a; |
| 374 | break; |
| 375 | case 2: |
| 376 | wk_mask = OMAP3430_ST_UART3_MASK; |
| 377 | padconf = 0x19e; |
| 378 | break; |
Govindraj.R | 52663ae | 2010-09-27 20:20:41 +0530 | [diff] [blame] | 379 | case 3: |
| 380 | wk_mask = OMAP3630_ST_UART4_MASK; |
| 381 | padconf = 0x0d2; |
| 382 | break; |
Kevin Hilman | 4af4016 | 2009-02-04 10:51:40 -0800 | [diff] [blame] | 383 | } |
| 384 | uart->wk_mask = wk_mask; |
| 385 | uart->padconf = padconf; |
| 386 | } else if (cpu_is_omap24xx()) { |
| 387 | u32 wk_mask = 0; |
Kevin Hilman | cb74f02 | 2010-10-20 23:19:03 +0000 | [diff] [blame] | 388 | u32 wk_en = PM_WKEN1, wk_st = PM_WKST1; |
Kevin Hilman | 4af4016 | 2009-02-04 10:51:40 -0800 | [diff] [blame] | 389 | |
Kevin Hilman | 4af4016 | 2009-02-04 10:51:40 -0800 | [diff] [blame] | 390 | switch (uart->num) { |
| 391 | case 0: |
| 392 | wk_mask = OMAP24XX_ST_UART1_MASK; |
| 393 | break; |
| 394 | case 1: |
| 395 | wk_mask = OMAP24XX_ST_UART2_MASK; |
| 396 | break; |
| 397 | case 2: |
Kevin Hilman | cb74f02 | 2010-10-20 23:19:03 +0000 | [diff] [blame] | 398 | wk_en = OMAP24XX_PM_WKEN2; |
| 399 | wk_st = OMAP24XX_PM_WKST2; |
Kevin Hilman | 4af4016 | 2009-02-04 10:51:40 -0800 | [diff] [blame] | 400 | wk_mask = OMAP24XX_ST_UART3_MASK; |
| 401 | break; |
| 402 | } |
| 403 | uart->wk_mask = wk_mask; |
Kevin Hilman | cb74f02 | 2010-10-20 23:19:03 +0000 | [diff] [blame] | 404 | if (cpu_is_omap2430()) { |
| 405 | uart->wk_en = OMAP2430_PRM_REGADDR(CORE_MOD, wk_en); |
| 406 | uart->wk_st = OMAP2430_PRM_REGADDR(CORE_MOD, wk_st); |
| 407 | } else if (cpu_is_omap2420()) { |
| 408 | uart->wk_en = OMAP2420_PRM_REGADDR(CORE_MOD, wk_en); |
| 409 | uart->wk_st = OMAP2420_PRM_REGADDR(CORE_MOD, wk_st); |
| 410 | } |
Kevin Hilman | 4af4016 | 2009-02-04 10:51:40 -0800 | [diff] [blame] | 411 | } else { |
Nishanth Menon | c54bae1 | 2010-08-02 13:18:11 +0300 | [diff] [blame] | 412 | uart->wk_en = NULL; |
| 413 | uart->wk_st = NULL; |
Kevin Hilman | 4af4016 | 2009-02-04 10:51:40 -0800 | [diff] [blame] | 414 | uart->wk_mask = 0; |
| 415 | uart->padconf = 0; |
| 416 | } |
Kevin Hilman | 4af4016 | 2009-02-04 10:51:40 -0800 | [diff] [blame] | 417 | } |
| 418 | |
| 419 | #else |
| 420 | static inline void omap_uart_idle_init(struct omap_uart_state *uart) {} |
Santosh Shilimkar | a1b04cc | 2010-10-11 11:05:18 +0000 | [diff] [blame] | 421 | static void omap_uart_block_sleep(struct omap_uart_state *uart) |
| 422 | { |
| 423 | /* Needed to enable UART clocks when built without CONFIG_PM */ |
| 424 | omap_uart_enable_clocks(uart); |
| 425 | } |
Kevin Hilman | 4af4016 | 2009-02-04 10:51:40 -0800 | [diff] [blame] | 426 | #endif /* CONFIG_PM */ |
| 427 | |
Tony Lindgren | 3e16f92 | 2011-02-14 15:40:20 -0800 | [diff] [blame] | 428 | static int __init omap_serial_early_init(void) |
Tony Lindgren | 1dbae81 | 2005-11-10 14:26:51 +0000 | [diff] [blame] | 429 | { |
Kevin Hilman | 6f251e9 | 2010-09-27 20:19:38 +0530 | [diff] [blame] | 430 | int i = 0; |
Tony Lindgren | 1dbae81 | 2005-11-10 14:26:51 +0000 | [diff] [blame] | 431 | |
Kevin Hilman | 6f251e9 | 2010-09-27 20:19:38 +0530 | [diff] [blame] | 432 | do { |
| 433 | char oh_name[MAX_UART_HWMOD_NAME_LEN]; |
| 434 | struct omap_hwmod *oh; |
| 435 | struct omap_uart_state *uart; |
Thomas Weber | 21b9034 | 2010-02-25 09:40:19 +0000 | [diff] [blame] | 436 | |
Kevin Hilman | 6f251e9 | 2010-09-27 20:19:38 +0530 | [diff] [blame] | 437 | snprintf(oh_name, MAX_UART_HWMOD_NAME_LEN, |
| 438 | "uart%d", i + 1); |
| 439 | oh = omap_hwmod_lookup(oh_name); |
| 440 | if (!oh) |
| 441 | break; |
Tony Lindgren | 1dbae81 | 2005-11-10 14:26:51 +0000 | [diff] [blame] | 442 | |
Kevin Hilman | 6f251e9 | 2010-09-27 20:19:38 +0530 | [diff] [blame] | 443 | uart = kzalloc(sizeof(struct omap_uart_state), GFP_KERNEL); |
| 444 | if (WARN_ON(!uart)) |
Tony Lindgren | 3e16f92 | 2011-02-14 15:40:20 -0800 | [diff] [blame] | 445 | return -ENODEV; |
Tony Lindgren | 1dbae81 | 2005-11-10 14:26:51 +0000 | [diff] [blame] | 446 | |
Kevin Hilman | 6f251e9 | 2010-09-27 20:19:38 +0530 | [diff] [blame] | 447 | uart->oh = oh; |
| 448 | uart->num = i++; |
| 449 | list_add_tail(&uart->node, &uart_list); |
| 450 | num_uarts++; |
| 451 | |
Tony Lindgren | 84f90c9 | 2009-10-16 09:53:00 -0700 | [diff] [blame] | 452 | /* |
Paul Walmsley | 550c809 | 2011-02-28 11:58:14 -0700 | [diff] [blame] | 453 | * NOTE: omap_hwmod_setup*() has not yet been called, |
Kevin Hilman | 6f251e9 | 2010-09-27 20:19:38 +0530 | [diff] [blame] | 454 | * so no hwmod functions will work yet. |
Tony Lindgren | 84f90c9 | 2009-10-16 09:53:00 -0700 | [diff] [blame] | 455 | */ |
Tony Lindgren | 84f90c9 | 2009-10-16 09:53:00 -0700 | [diff] [blame] | 456 | |
Kevin Hilman | 6f251e9 | 2010-09-27 20:19:38 +0530 | [diff] [blame] | 457 | /* |
| 458 | * During UART early init, device need to be probed |
| 459 | * to determine SoC specific init before omap_device |
| 460 | * is ready. Therefore, don't allow idle here |
| 461 | */ |
| 462 | uart->oh->flags |= HWMOD_INIT_NO_IDLE | HWMOD_INIT_NO_RESET; |
| 463 | } while (1); |
Tony Lindgren | 3e16f92 | 2011-02-14 15:40:20 -0800 | [diff] [blame] | 464 | |
| 465 | return 0; |
Paul Walmsley | b3c6df3 | 2009-09-03 20:14:02 +0300 | [diff] [blame] | 466 | } |
Tony Lindgren | 3e16f92 | 2011-02-14 15:40:20 -0800 | [diff] [blame] | 467 | core_initcall(omap_serial_early_init); |
Paul Walmsley | b3c6df3 | 2009-09-03 20:14:02 +0300 | [diff] [blame] | 468 | |
Mika Westerberg | f62349e | 2009-12-11 16:16:35 -0800 | [diff] [blame] | 469 | /** |
| 470 | * omap_serial_init_port() - initialize single serial port |
Tony Lindgren | 40e4439 | 2010-12-22 18:42:35 -0800 | [diff] [blame] | 471 | * @bdata: port specific board data pointer |
Mika Westerberg | f62349e | 2009-12-11 16:16:35 -0800 | [diff] [blame] | 472 | * |
Tony Lindgren | 40e4439 | 2010-12-22 18:42:35 -0800 | [diff] [blame] | 473 | * This function initialies serial driver for given port only. |
Mika Westerberg | f62349e | 2009-12-11 16:16:35 -0800 | [diff] [blame] | 474 | * Platforms can call this function instead of omap_serial_init() |
| 475 | * if they don't plan to use all available UARTs as serial ports. |
| 476 | * |
| 477 | * Don't mix calls to omap_serial_init_port() and omap_serial_init(), |
| 478 | * use only one of the two. |
| 479 | */ |
Tony Lindgren | 40e4439 | 2010-12-22 18:42:35 -0800 | [diff] [blame] | 480 | void __init omap_serial_init_port(struct omap_board_data *bdata) |
Mika Westerberg | f62349e | 2009-12-11 16:16:35 -0800 | [diff] [blame] | 481 | { |
| 482 | struct omap_uart_state *uart; |
Kevin Hilman | 6f251e9 | 2010-09-27 20:19:38 +0530 | [diff] [blame] | 483 | struct omap_hwmod *oh; |
Kevin Hilman | 3528c58 | 2011-07-21 13:48:45 -0700 | [diff] [blame] | 484 | struct platform_device *pdev; |
Kevin Hilman | 6f251e9 | 2010-09-27 20:19:38 +0530 | [diff] [blame] | 485 | void *pdata = NULL; |
| 486 | u32 pdata_size = 0; |
| 487 | char *name; |
Kevin Hilman | 6f251e9 | 2010-09-27 20:19:38 +0530 | [diff] [blame] | 488 | struct omap_uart_port_info omap_up; |
Mika Westerberg | f62349e | 2009-12-11 16:16:35 -0800 | [diff] [blame] | 489 | |
Tony Lindgren | 40e4439 | 2010-12-22 18:42:35 -0800 | [diff] [blame] | 490 | if (WARN_ON(!bdata)) |
Sergio Aguirre | e88d556 | 2010-02-27 14:13:43 -0600 | [diff] [blame] | 491 | return; |
Tony Lindgren | 40e4439 | 2010-12-22 18:42:35 -0800 | [diff] [blame] | 492 | if (WARN_ON(bdata->id < 0)) |
| 493 | return; |
| 494 | if (WARN_ON(bdata->id >= num_uarts)) |
Mika Westerberg | f62349e | 2009-12-11 16:16:35 -0800 | [diff] [blame] | 495 | return; |
| 496 | |
Kevin Hilman | 6f251e9 | 2010-09-27 20:19:38 +0530 | [diff] [blame] | 497 | list_for_each_entry(uart, &uart_list, node) |
Tony Lindgren | 40e4439 | 2010-12-22 18:42:35 -0800 | [diff] [blame] | 498 | if (bdata->id == uart->num) |
Kevin Hilman | 6f251e9 | 2010-09-27 20:19:38 +0530 | [diff] [blame] | 499 | break; |
| 500 | |
| 501 | oh = uart->oh; |
| 502 | uart->dma_enabled = 0; |
Kevin Hilman | 6f251e9 | 2010-09-27 20:19:38 +0530 | [diff] [blame] | 503 | name = DRIVER_NAME; |
| 504 | |
| 505 | omap_up.dma_enabled = uart->dma_enabled; |
| 506 | omap_up.uartclk = OMAP24XX_BASE_BAUD * 16; |
| 507 | omap_up.mapbase = oh->slaves[0]->addr->pa_start; |
| 508 | omap_up.membase = omap_hwmod_get_mpu_rt_va(oh); |
Govindraj.R | 273558b | 2011-09-13 14:01:01 +0530 | [diff] [blame^] | 509 | omap_up.flags = UPF_BOOT_AUTOCONF; |
Kevin Hilman | 6f251e9 | 2010-09-27 20:19:38 +0530 | [diff] [blame] | 510 | |
| 511 | pdata = &omap_up; |
| 512 | pdata_size = sizeof(struct omap_uart_port_info); |
Kevin Hilman | 6f251e9 | 2010-09-27 20:19:38 +0530 | [diff] [blame] | 513 | |
| 514 | if (WARN_ON(!oh)) |
| 515 | return; |
| 516 | |
Kevin Hilman | 3528c58 | 2011-07-21 13:48:45 -0700 | [diff] [blame] | 517 | pdev = omap_device_build(name, uart->num, oh, pdata, pdata_size, |
Benoit Cousson | f718e2c | 2011-08-10 15:30:09 +0200 | [diff] [blame] | 518 | NULL, 0, false); |
Kevin Hilman | 3528c58 | 2011-07-21 13:48:45 -0700 | [diff] [blame] | 519 | WARN(IS_ERR(pdev), "Could not build omap_device for %s: %s.\n", |
Kevin Hilman | 6f251e9 | 2010-09-27 20:19:38 +0530 | [diff] [blame] | 520 | name, oh->name); |
| 521 | |
Kevin Hilman | 9f8b694 | 2011-08-01 09:33:13 -0700 | [diff] [blame] | 522 | omap_device_disable_idle_on_suspend(pdev); |
Tony Lindgren | 40e4439 | 2010-12-22 18:42:35 -0800 | [diff] [blame] | 523 | oh->mux = omap_hwmod_mux_init(bdata->pads, bdata->pads_cnt); |
| 524 | |
Kevin Hilman | 6f251e9 | 2010-09-27 20:19:38 +0530 | [diff] [blame] | 525 | uart->regshift = 2; |
| 526 | uart->mapbase = oh->slaves[0]->addr->pa_start; |
| 527 | uart->membase = omap_hwmod_get_mpu_rt_va(oh); |
Kevin Hilman | 3528c58 | 2011-07-21 13:48:45 -0700 | [diff] [blame] | 528 | uart->pdev = pdev; |
Kevin Hilman | 6f251e9 | 2010-09-27 20:19:38 +0530 | [diff] [blame] | 529 | |
| 530 | oh->dev_attr = uart; |
| 531 | |
Torben Hohn | ac751ef | 2011-01-25 15:07:35 -0800 | [diff] [blame] | 532 | console_lock(); /* in case the earlycon is on the UART */ |
Paul Walmsley | 0d8e2d0 | 2010-11-24 16:49:05 -0700 | [diff] [blame] | 533 | |
Kevin Hilman | 6f251e9 | 2010-09-27 20:19:38 +0530 | [diff] [blame] | 534 | /* |
| 535 | * Because of early UART probing, UART did not get idled |
| 536 | * on init. Now that omap_device is ready, ensure full idle |
| 537 | * before doing omap_device_enable(). |
| 538 | */ |
| 539 | omap_hwmod_idle(uart->oh); |
| 540 | |
| 541 | omap_device_enable(uart->pdev); |
| 542 | omap_uart_idle_init(uart); |
| 543 | omap_uart_reset(uart); |
| 544 | omap_hwmod_enable_wakeup(uart->oh); |
| 545 | omap_device_idle(uart->pdev); |
| 546 | |
Kevin Hilman | 6f251e9 | 2010-09-27 20:19:38 +0530 | [diff] [blame] | 547 | omap_uart_block_sleep(uart); |
Torben Hohn | ac751ef | 2011-01-25 15:07:35 -0800 | [diff] [blame] | 548 | console_unlock(); |
Paul Walmsley | 0d8e2d0 | 2010-11-24 16:49:05 -0700 | [diff] [blame] | 549 | |
Kevin Hilman | 6f251e9 | 2010-09-27 20:19:38 +0530 | [diff] [blame] | 550 | if ((cpu_is_omap34xx() && uart->padconf) || |
Govindraj.R | 273558b | 2011-09-13 14:01:01 +0530 | [diff] [blame^] | 551 | (uart->wk_en && uart->wk_mask)) |
Kevin Hilman | 3528c58 | 2011-07-21 13:48:45 -0700 | [diff] [blame] | 552 | device_init_wakeup(&pdev->dev, true); |
Deepak K | 0003450 | 2010-08-02 13:18:12 +0300 | [diff] [blame] | 553 | |
| 554 | /* Enable the MDR1 errata for OMAP3 */ |
Hemant Pedanekar | a920360 | 2011-12-13 10:46:44 -0800 | [diff] [blame] | 555 | if (cpu_is_omap34xx() && !(cpu_is_ti81xx() || cpu_is_am33xx())) |
Deepak K | 0003450 | 2010-08-02 13:18:12 +0300 | [diff] [blame] | 556 | uart->errata |= UART_ERRATA_i202_MDR1_ACCESS; |
Mika Westerberg | f62349e | 2009-12-11 16:16:35 -0800 | [diff] [blame] | 557 | } |
| 558 | |
| 559 | /** |
Uwe Kleine-König | b595076 | 2010-11-01 15:38:34 -0400 | [diff] [blame] | 560 | * omap_serial_init() - initialize all supported serial ports |
Mika Westerberg | f62349e | 2009-12-11 16:16:35 -0800 | [diff] [blame] | 561 | * |
| 562 | * Initializes all available UARTs as serial ports. Platforms |
| 563 | * can call this function when they want to have default behaviour |
| 564 | * for serial ports (e.g initialize them all as serial ports). |
| 565 | */ |
Paul Walmsley | b3c6df3 | 2009-09-03 20:14:02 +0300 | [diff] [blame] | 566 | void __init omap_serial_init(void) |
| 567 | { |
Kevin Hilman | 6f251e9 | 2010-09-27 20:19:38 +0530 | [diff] [blame] | 568 | struct omap_uart_state *uart; |
Tony Lindgren | 40e4439 | 2010-12-22 18:42:35 -0800 | [diff] [blame] | 569 | struct omap_board_data bdata; |
Paul Walmsley | b3c6df3 | 2009-09-03 20:14:02 +0300 | [diff] [blame] | 570 | |
Tony Lindgren | 40e4439 | 2010-12-22 18:42:35 -0800 | [diff] [blame] | 571 | list_for_each_entry(uart, &uart_list, node) { |
| 572 | bdata.id = uart->num; |
| 573 | bdata.flags = 0; |
| 574 | bdata.pads = NULL; |
| 575 | bdata.pads_cnt = 0; |
| 576 | omap_serial_init_port(&bdata); |
| 577 | |
| 578 | } |
Tony Lindgren | 1dbae81 | 2005-11-10 14:26:51 +0000 | [diff] [blame] | 579 | } |