Commit 9168fd3982efaecffecf9c279a94ad7adaf9ad44
1 parent
a89a8bf416
Exists in
smarc_8mm-imx_v2018.03_4.14.98_2.0.0_ga
and in
5 other branches
MLK-14938-12 serial_lpuart: Update lpuart driver to support i.MX8
Add i.MX8 compatible string and cpu type support to lpuart driver, to use little endian 32 bits configurations. Signed-off-by: Ye Li <ye.li@nxp.com> (cherry picked from commit 0b1a70b2e3f519d6bf6c34f0df3a81ff1a4852cb)
Showing 2 changed files with 9 additions and 4 deletions Side-by-side Diff
drivers/serial/serial_lpuart.c
... | ... | @@ -55,7 +55,8 @@ |
55 | 55 | enum lpuart_devtype { |
56 | 56 | DEV_VF610 = 1, |
57 | 57 | DEV_LS1021A, |
58 | - DEV_MX7ULP | |
58 | + DEV_MX7ULP, | |
59 | + DEV_IMX8 | |
59 | 60 | }; |
60 | 61 | |
61 | 62 | struct lpuart_serial_platdata { |
... | ... | @@ -326,7 +327,7 @@ |
326 | 327 | |
327 | 328 | lpuart_write32(plat->flags, &base->match, 0); |
328 | 329 | |
329 | - if (plat->devtype == DEV_MX7ULP) { | |
330 | + if (plat->devtype == DEV_MX7ULP || plat->devtype == DEV_IMX8) { | |
330 | 331 | _lpuart32_serial_setbrg_7ulp(plat, gd->baudrate); |
331 | 332 | } else { |
332 | 333 | /* provide data bits, parity, stop bit, etc */ |
... | ... | @@ -343,7 +344,7 @@ |
343 | 344 | struct lpuart_serial_platdata *plat = dev->platdata; |
344 | 345 | |
345 | 346 | if (is_lpuart32(dev)) { |
346 | - if (plat->devtype == DEV_MX7ULP) | |
347 | + if (plat->devtype == DEV_MX7ULP || plat->devtype == DEV_IMX8) | |
347 | 348 | _lpuart32_serial_setbrg_7ulp(plat, baudrate); |
348 | 349 | else |
349 | 350 | _lpuart32_serial_setbrg(plat, baudrate); |
... | ... | @@ -428,6 +429,8 @@ |
428 | 429 | plat->devtype = DEV_MX7ULP; |
429 | 430 | else if (!fdt_node_check_compatible(blob, node, "fsl,vf610-lpuart")) |
430 | 431 | plat->devtype = DEV_VF610; |
432 | + else if (!fdt_node_check_compatible(blob, node, "fsl,imx8qm-lpuart")) | |
433 | + plat->devtype = DEV_IMX8; | |
431 | 434 | |
432 | 435 | return 0; |
433 | 436 | } |
... | ... | @@ -445,6 +448,8 @@ |
445 | 448 | { .compatible = "fsl,imx7ulp-lpuart", |
446 | 449 | .data = LPUART_FLAG_REGMAP_32BIT_REG }, |
447 | 450 | { .compatible = "fsl,vf610-lpuart"}, |
451 | + { .compatible = "fsl,imx8qm-lpuart", | |
452 | + .data = LPUART_FLAG_REGMAP_32BIT_REG }, | |
448 | 453 | { } |
449 | 454 | }; |
450 | 455 |