819-uart-0012-tty-serial-lpuart-add-LS1028A-support.patch 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. From 932dac0380bbf7276d4111c35674679bc9ad6384 Mon Sep 17 00:00:00 2001
  2. From: Vabhav Sharma <[email protected]>
  3. Date: Thu, 31 Oct 2019 19:20:47 +0530
  4. Subject: [PATCH] tty: serial: lpuart: add LS1028A support
  5. NXP LS1028A lpuart is the same IP as LS1021A, but it is
  6. little endian for register accessing instead of big endian
  7. on LS1021A.
  8. So add LS1028A matching data to distiguish the chips.
  9. Signed-off-by: Fugang Duan <[email protected]>
  10. Signed-off-by: Vabhav Sharma <[email protected]>
  11. Acked-by: Fugang Duan <[email protected]>
  12. ---
  13. drivers/tty/serial/fsl_lpuart.c | 14 ++++++++++++--
  14. 1 file changed, 12 insertions(+), 2 deletions(-)
  15. --- a/drivers/tty/serial/fsl_lpuart.c
  16. +++ b/drivers/tty/serial/fsl_lpuart.c
  17. @@ -3,6 +3,7 @@
  18. * Freescale lpuart serial port driver
  19. *
  20. * Copyright 2012-2014 Freescale Semiconductor, Inc.
  21. + * Copyright 2019 NXP
  22. */
  23. #if defined(CONFIG_SERIAL_FSL_LPUART_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ)
  24. @@ -260,6 +261,7 @@ static DEFINE_IDA(fsl_lpuart_ida);
  25. enum lpuart_type {
  26. VF610_LPUART,
  27. LS1021A_LPUART,
  28. + LS1028A_LPUART,
  29. IMX7ULP_LPUART,
  30. IMX8QXP_LPUART,
  31. };
  32. @@ -311,13 +313,20 @@ static const struct lpuart_soc_data vf_d
  33. .rx_dma_cyclic = true,
  34. };
  35. -static const struct lpuart_soc_data ls_data = {
  36. +static const struct lpuart_soc_data ls1021a_data = {
  37. .devtype = LS1021A_LPUART,
  38. .iotype = UPIO_MEM32BE,
  39. .rx_watermark = 0,
  40. .rx_dma_cyclic = true,
  41. };
  42. +static const struct lpuart_soc_data ls1028a_data = {
  43. + .devtype = LS1028A_LPUART,
  44. + .iotype = UPIO_MEM32,
  45. + .rx_watermark = 0,
  46. + .rx_dma_cyclic = true,
  47. +};
  48. +
  49. static struct lpuart_soc_data imx7ulp_data = {
  50. .devtype = IMX7ULP_LPUART,
  51. .iotype = UPIO_MEM32,
  52. @@ -336,7 +345,8 @@ static struct lpuart_soc_data imx8qxp_da
  53. static const struct of_device_id lpuart_dt_ids[] = {
  54. { .compatible = "fsl,vf610-lpuart", .data = &vf_data, },
  55. - { .compatible = "fsl,ls1021a-lpuart", .data = &ls_data, },
  56. + { .compatible = "fsl,ls1021a-lpuart", .data = &ls1021a_data, },
  57. + { .compatible = "fsl,ls1028a-lpuart", .data = &ls1028a_data, },
  58. { .compatible = "fsl,imx7ulp-lpuart", .data = &imx7ulp_data, },
  59. { .compatible = "fsl,imx8qxp-lpuart", .data = &imx8qxp_data, },
  60. { /* sentinel */ }