Skip to content

Commit a496e62

Browse files
Huang Shijiegregkh
authored andcommitted
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 <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 1cf93e0 commit a496e62

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

drivers/tty/serial/imx.c

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,7 @@
186186
enum imx_uart_type {
187187
IMX1_UART,
188188
IMX21_UART,
189+
IMX6Q_UART,
189190
};
190191

191192
/* device type dependent stuff */
@@ -231,6 +232,10 @@ static struct imx_uart_data imx_uart_devdata[] = {
231232
.uts_reg = IMX21_UTS,
232233
.devtype = IMX21_UART,
233234
},
235+
[IMX6Q_UART] = {
236+
.uts_reg = IMX21_UTS,
237+
.devtype = IMX6Q_UART,
238+
},
234239
};
235240

236241
static struct platform_device_id imx_uart_devtype[] = {
@@ -240,13 +245,17 @@ static struct platform_device_id imx_uart_devtype[] = {
240245
}, {
241246
.name = "imx21-uart",
242247
.driver_data = (kernel_ulong_t) &imx_uart_devdata[IMX21_UART],
248+
}, {
249+
.name = "imx6q-uart",
250+
.driver_data = (kernel_ulong_t) &imx_uart_devdata[IMX6Q_UART],
243251
}, {
244252
/* sentinel */
245253
}
246254
};
247255
MODULE_DEVICE_TABLE(platform, imx_uart_devtype);
248256

249257
static struct of_device_id imx_uart_dt_ids[] = {
258+
{ .compatible = "fsl,imx6q-uart", .data = &imx_uart_devdata[IMX6Q_UART], },
250259
{ .compatible = "fsl,imx1-uart", .data = &imx_uart_devdata[IMX1_UART], },
251260
{ .compatible = "fsl,imx21-uart", .data = &imx_uart_devdata[IMX21_UART], },
252261
{ /* sentinel */ }
@@ -268,6 +277,10 @@ static inline int is_imx21_uart(struct imx_port *sport)
268277
return sport->devdata->devtype == IMX21_UART;
269278
}
270279

280+
static inline int is_imx6q_uart(struct imx_port *sport)
281+
{
282+
return sport->devdata->devtype == IMX6Q_UART;
283+
}
271284
/*
272285
* Save and restore functions for UCR1, UCR2 and UCR3 registers
273286
*/
@@ -800,7 +813,7 @@ static int imx_startup(struct uart_port *port)
800813
}
801814
}
802815

803-
if (is_imx21_uart(sport)) {
816+
if (!is_imx1_uart(sport)) {
804817
temp = readl(sport->port.membase + UCR3);
805818
temp |= IMX21_UCR3_RXDMUXSEL;
806819
writel(temp, sport->port.membase + UCR3);
@@ -1043,7 +1056,7 @@ imx_set_termios(struct uart_port *port, struct ktermios *termios,
10431056
writel(num, sport->port.membase + UBIR);
10441057
writel(denom, sport->port.membase + UBMR);
10451058

1046-
if (is_imx21_uart(sport))
1059+
if (!is_imx1_uart(sport))
10471060
writel(sport->port.uartclk / div / 1000,
10481061
sport->port.membase + IMX21_ONEMS);
10491062

0 commit comments

Comments
 (0)