diff options
author | Huang Shijie <b32955@freescale.com> | 2013-07-08 05:14:17 -0400 |
---|---|---|
committer | Nitin Garg <nitin.garg@freescale.com> | 2014-04-16 09:00:50 -0400 |
commit | c71656822b6c43db294554a9c8a09220417a0796 (patch) | |
tree | 93ec2491b0e248a3f06f454a944737fa5062ad81 /drivers/tty | |
parent | 69aa551ddf370c1a5d0597c64a156c9bad26201e (diff) |
serial: imx: distinguish the imx6q uart from the others
We will add the DMA support for the imx uart. For the firmware's limit,
only the imx6 serial chips (including the imx6q, imx6dl, imx6sl) can
support the DMA.
This patch adds the necessary macro and helper to distinguish the
imx6q uart from the other imx uart. Other chips can use the "fsl,imx6q-uart"
to enable the DMA support.
This patch also replaces the check "is_imx21_uart()" with "!is_imx1_uart()".
Signed-off-by: Huang Shijie <b32955@freescale.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty')
-rw-r--r-- | drivers/tty/serial/imx.c | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c index b8b40e2b0bd3..46c513a20c65 100644 --- a/drivers/tty/serial/imx.c +++ b/drivers/tty/serial/imx.c | |||
@@ -187,6 +187,7 @@ | |||
187 | enum imx_uart_type { | 187 | enum imx_uart_type { |
188 | IMX1_UART, | 188 | IMX1_UART, |
189 | IMX21_UART, | 189 | IMX21_UART, |
190 | IMX6Q_UART, | ||
190 | }; | 191 | }; |
191 | 192 | ||
192 | /* device type dependent stuff */ | 193 | /* device type dependent stuff */ |
@@ -232,6 +233,10 @@ static struct imx_uart_data imx_uart_devdata[] = { | |||
232 | .uts_reg = IMX21_UTS, | 233 | .uts_reg = IMX21_UTS, |
233 | .devtype = IMX21_UART, | 234 | .devtype = IMX21_UART, |
234 | }, | 235 | }, |
236 | [IMX6Q_UART] = { | ||
237 | .uts_reg = IMX21_UTS, | ||
238 | .devtype = IMX6Q_UART, | ||
239 | }, | ||
235 | }; | 240 | }; |
236 | 241 | ||
237 | static struct platform_device_id imx_uart_devtype[] = { | 242 | static struct platform_device_id imx_uart_devtype[] = { |
@@ -242,12 +247,16 @@ static struct platform_device_id imx_uart_devtype[] = { | |||
242 | .name = "imx21-uart", | 247 | .name = "imx21-uart", |
243 | .driver_data = (kernel_ulong_t) &imx_uart_devdata[IMX21_UART], | 248 | .driver_data = (kernel_ulong_t) &imx_uart_devdata[IMX21_UART], |
244 | }, { | 249 | }, { |
250 | .name = "imx6q-uart", | ||
251 | .driver_data = (kernel_ulong_t) &imx_uart_devdata[IMX6Q_UART], | ||
252 | }, { | ||
245 | /* sentinel */ | 253 | /* sentinel */ |
246 | } | 254 | } |
247 | }; | 255 | }; |
248 | MODULE_DEVICE_TABLE(platform, imx_uart_devtype); | 256 | MODULE_DEVICE_TABLE(platform, imx_uart_devtype); |
249 | 257 | ||
250 | static struct of_device_id imx_uart_dt_ids[] = { | 258 | static struct of_device_id imx_uart_dt_ids[] = { |
259 | { .compatible = "fsl,imx6q-uart", .data = &imx_uart_devdata[IMX6Q_UART], }, | ||
251 | { .compatible = "fsl,imx1-uart", .data = &imx_uart_devdata[IMX1_UART], }, | 260 | { .compatible = "fsl,imx1-uart", .data = &imx_uart_devdata[IMX1_UART], }, |
252 | { .compatible = "fsl,imx21-uart", .data = &imx_uart_devdata[IMX21_UART], }, | 261 | { .compatible = "fsl,imx21-uart", .data = &imx_uart_devdata[IMX21_UART], }, |
253 | { /* sentinel */ } | 262 | { /* sentinel */ } |
@@ -269,6 +278,10 @@ static inline int is_imx21_uart(struct imx_port *sport) | |||
269 | return sport->devdata->devtype == IMX21_UART; | 278 | return sport->devdata->devtype == IMX21_UART; |
270 | } | 279 | } |
271 | 280 | ||
281 | static inline int is_imx6q_uart(struct imx_port *sport) | ||
282 | { | ||
283 | return sport->devdata->devtype == IMX6Q_UART; | ||
284 | } | ||
272 | /* | 285 | /* |
273 | * Save and restore functions for UCR1, UCR2 and UCR3 registers | 286 | * Save and restore functions for UCR1, UCR2 and UCR3 registers |
274 | */ | 287 | */ |
@@ -801,7 +814,7 @@ static int imx_startup(struct uart_port *port) | |||
801 | } | 814 | } |
802 | } | 815 | } |
803 | 816 | ||
804 | if (is_imx21_uart(sport)) { | 817 | if (!is_imx1_uart(sport)) { |
805 | temp = readl(sport->port.membase + UCR3); | 818 | temp = readl(sport->port.membase + UCR3); |
806 | temp |= IMX21_UCR3_RXDMUXSEL; | 819 | temp |= IMX21_UCR3_RXDMUXSEL; |
807 | writel(temp, sport->port.membase + UCR3); | 820 | writel(temp, sport->port.membase + UCR3); |
@@ -1044,7 +1057,7 @@ imx_set_termios(struct uart_port *port, struct ktermios *termios, | |||
1044 | writel(num, sport->port.membase + UBIR); | 1057 | writel(num, sport->port.membase + UBIR); |
1045 | writel(denom, sport->port.membase + UBMR); | 1058 | writel(denom, sport->port.membase + UBMR); |
1046 | 1059 | ||
1047 | if (is_imx21_uart(sport)) | 1060 | if (!is_imx1_uart(sport)) |
1048 | writel(sport->port.uartclk / div / 1000, | 1061 | writel(sport->port.uartclk / div / 1000, |
1049 | sport->port.membase + IMX21_ONEMS); | 1062 | sport->port.membase + IMX21_ONEMS); |
1050 | 1063 | ||