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