aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/layerscape/patches-5.4/819-uart-0005-tty-serial-fsl_lpuart-enable-dma-mode-for-imx8qxp.patch
diff options
context:
space:
mode:
authorJohn Audia <graysky@archlinux.us>2020-11-11 15:30:36 -0500
committerAdrian Schmutzler <freifunk@adrianschmutzler.de>2020-11-18 21:13:46 +0100
commit667f6c7f49c94213ca43a42ad5a9e23abfd81861 (patch)
treea16e6cc807cda32e1dfbaef1a0de486d5ba1166c /target/linux/layerscape/patches-5.4/819-uart-0005-tty-serial-fsl_lpuart-enable-dma-mode-for-imx8qxp.patch
parent79f3f1358bf993a5d7ae14eba9cea2686b40841d (diff)
downloadupstream-667f6c7f49c94213ca43a42ad5a9e23abfd81861.tar.gz
upstream-667f6c7f49c94213ca43a42ad5a9e23abfd81861.tar.bz2
upstream-667f6c7f49c94213ca43a42ad5a9e23abfd81861.zip
kernel: bump 5.4 to 5.4.77
Manually rebased patches: bcm27xx/patches-5.4/950-0135-spi-spi-bcm2835-Disable-forced-software-CS.patch generic-backport/744-v5.5-net-sfp-soft-status-and-control-support.patch layerscape/patches-5.4/819-uart-0005-tty-serial-fsl_lpuart-enable-dma-mode-for-imx8qxp.patch mvebu/patches-5.4/521-arm64-dts-marvell-espressobin-Add-ethernet-switch-al.patch Removed: layerscape/patches-5.4/819-uart-0012-tty-serial-lpuart-add-LS1028A-support.patch All modifications made by update_kernel.sh Build system: x86_64 Build-tested: ipq806x/R7800, ath79/generic, bcm27xx/bcm2711, lantiq/Easybox 904 xDSL, x86_64 Run-tested: ipq806x/R7800, lantiq/Easybox 904 xDSL, x86_64 No dmesg regressions, everything functional Signed-off-by: John Audia <graysky@archlinux.us> Co-developed-by: Adrian Schmutzler <freifunk@adrianschmutzler.de> Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Diffstat (limited to 'target/linux/layerscape/patches-5.4/819-uart-0005-tty-serial-fsl_lpuart-enable-dma-mode-for-imx8qxp.patch')
-rw-r--r--target/linux/layerscape/patches-5.4/819-uart-0005-tty-serial-fsl_lpuart-enable-dma-mode-for-imx8qxp.patch55
1 files changed, 31 insertions, 24 deletions
diff --git a/target/linux/layerscape/patches-5.4/819-uart-0005-tty-serial-fsl_lpuart-enable-dma-mode-for-imx8qxp.patch b/target/linux/layerscape/patches-5.4/819-uart-0005-tty-serial-fsl_lpuart-enable-dma-mode-for-imx8qxp.patch
index d4034bb9db..6edcc398d0 100644
--- a/target/linux/layerscape/patches-5.4/819-uart-0005-tty-serial-fsl_lpuart-enable-dma-mode-for-imx8qxp.patch
+++ b/target/linux/layerscape/patches-5.4/819-uart-0005-tty-serial-fsl_lpuart-enable-dma-mode-for-imx8qxp.patch
@@ -60,7 +60,7 @@ Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
/* Rx DMA timeout in ms, which is used to calculate Rx ring buffer size */
#define DMA_RX_TIMEOUT (10)
-@@ -253,6 +260,9 @@ struct lpuart_port {
+@@ -254,6 +261,9 @@ struct lpuart_port {
unsigned int txfifo_size;
unsigned int rxfifo_size;
@@ -70,7 +70,7 @@ Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
bool lpuart_dma_tx_use;
bool lpuart_dma_rx_use;
struct dma_chan *dma_tx_chan;
-@@ -278,28 +288,38 @@ struct lpuart_soc_data {
+@@ -279,33 +289,45 @@ struct lpuart_soc_data {
enum lpuart_type devtype;
char iotype;
u8 reg_off;
@@ -85,13 +85,20 @@ Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
+ .rx_dma_cyclic = true,
};
- static const struct lpuart_soc_data ls_data = {
+ static const struct lpuart_soc_data ls1021a_data = {
.devtype = LS1021A_LPUART,
.iotype = UPIO_MEM32BE,
+ .rx_watermark = 0,
+ .rx_dma_cyclic = true,
};
+ static const struct lpuart_soc_data ls1028a_data = {
+ .devtype = LS1028A_LPUART,
+ .iotype = UPIO_MEM32,
++ .rx_watermark = 0,
++ .rx_dma_cyclic = true,
+ };
+
static struct lpuart_soc_data imx7ulp_data = {
.devtype = IMX7ULP_LPUART,
.iotype = UPIO_MEM32,
@@ -109,15 +116,15 @@ Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
};
static const struct of_device_id lpuart_dt_ids[] = {
-@@ -313,6 +333,7 @@ MODULE_DEVICE_TABLE(of, lpuart_dt_ids);
+@@ -320,6 +342,7 @@ MODULE_DEVICE_TABLE(of, lpuart_dt_ids);
/* Forward declare this for the dma callbacks*/
static void lpuart_dma_tx_complete(void *arg);
+static int lpuart_sched_rx_dma(struct lpuart_port *sport);
- static inline bool is_imx8qxp_lpuart(struct lpuart_port *sport)
+ static inline bool is_layerscape_lpuart(struct lpuart_port *sport)
{
-@@ -998,19 +1019,15 @@ static irqreturn_t lpuart32_int(int irq,
+@@ -1011,19 +1034,15 @@ static irqreturn_t lpuart32_int(int irq,
if ((sts & UARTSTAT_TDRE) && !sport->lpuart_dma_tx_use)
lpuart32_txint(sport);
@@ -141,7 +148,7 @@ Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
if (lpuart_is_32(sport)) {
unsigned long sr = lpuart32_read(&sport->port, UARTSTAT);
-@@ -1062,8 +1079,21 @@ static void lpuart_copy_rx_to_tty(struct
+@@ -1075,8 +1094,21 @@ static void lpuart_copy_rx_to_tty(struct
writeb(cr2, sport->port.membase + UARTCR2);
}
}
@@ -164,7 +171,7 @@ Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
spin_lock_irqsave(&sport->port.lock, flags);
-@@ -1126,7 +1156,33 @@ static void lpuart_copy_rx_to_tty(struct
+@@ -1139,7 +1171,33 @@ static void lpuart_copy_rx_to_tty(struct
spin_unlock_irqrestore(&sport->port.lock, flags);
tty_flip_buffer_push(port);
@@ -199,7 +206,7 @@ Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
}
static void lpuart_dma_rx_complete(void *arg)
-@@ -1134,6 +1190,8 @@ static void lpuart_dma_rx_complete(void
+@@ -1147,6 +1205,8 @@ static void lpuart_dma_rx_complete(void
struct lpuart_port *sport = arg;
lpuart_copy_rx_to_tty(sport);
@@ -208,7 +215,7 @@ Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
}
static void lpuart_timer_func(struct timer_list *t)
-@@ -1141,13 +1199,78 @@ static void lpuart_timer_func(struct tim
+@@ -1154,13 +1214,78 @@ static void lpuart_timer_func(struct tim
struct lpuart_port *sport = from_timer(sport, t, lpuart_timer);
lpuart_copy_rx_to_tty(sport);
@@ -291,7 +298,7 @@ Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
int bits, baud;
struct tty_port *port = &sport->port.state->port;
struct tty_struct *tty = port->tty;
-@@ -1167,6 +1290,18 @@ static inline int lpuart_start_rx_dma(st
+@@ -1180,6 +1305,18 @@ static inline int lpuart_start_rx_dma(st
sport->rx_dma_rng_buf_len = (1 << (fls(sport->rx_dma_rng_buf_len) - 1));
if (sport->rx_dma_rng_buf_len < 16)
sport->rx_dma_rng_buf_len = 16;
@@ -310,7 +317,7 @@ Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
ring->buf = kzalloc(sport->rx_dma_rng_buf_len, GFP_ATOMIC);
if (!ring->buf)
-@@ -1192,32 +1327,7 @@ static inline int lpuart_start_rx_dma(st
+@@ -1205,32 +1342,7 @@ static inline int lpuart_start_rx_dma(st
return ret;
}
@@ -344,7 +351,7 @@ Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
}
static void lpuart_dma_rx_free(struct uart_port *port)
-@@ -1403,8 +1513,10 @@ static void lpuart_setup_watermark(struc
+@@ -1416,8 +1528,10 @@ static void lpuart_setup_watermark(struc
writeb(UARTSFIFO_RXUF, sport->port.membase + UARTSFIFO);
}
@@ -356,7 +363,7 @@ Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
/* Restore cr2 */
writeb(cr2_saved, sport->port.membase + UARTCR2);
-@@ -1425,6 +1537,7 @@ static void lpuart32_setup_watermark(str
+@@ -1438,6 +1552,7 @@ static void lpuart32_setup_watermark(str
{
unsigned long val, ctrl;
unsigned long ctrl_saved;
@@ -364,7 +371,7 @@ Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
ctrl = lpuart32_read(&sport->port, UARTCTRL);
ctrl_saved = ctrl;
-@@ -1436,12 +1549,26 @@ static void lpuart32_setup_watermark(str
+@@ -1449,12 +1564,26 @@ static void lpuart32_setup_watermark(str
val = lpuart32_read(&sport->port, UARTFIFO);
val |= UARTFIFO_TXFE | UARTFIFO_RXFE;
val |= UARTFIFO_TXFLUSH | UARTFIFO_RXFLUSH;
@@ -392,7 +399,7 @@ Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
/* Restore cr2 */
lpuart32_write(&sport->port, ctrl_saved, UARTCTRL);
}
-@@ -1453,17 +1580,29 @@ static void lpuart32_setup_watermark_ena
+@@ -1466,17 +1595,29 @@ static void lpuart32_setup_watermark_ena
lpuart32_setup_watermark(sport);
temp = lpuart32_read(&sport->port, UARTCTRL);
@@ -423,7 +430,7 @@ Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
static void lpuart_tx_dma_startup(struct lpuart_port *sport)
{
u32 uartbaud;
-@@ -1527,19 +1666,23 @@ static int lpuart_startup(struct uart_po
+@@ -1540,19 +1681,23 @@ static int lpuart_startup(struct uart_po
return 0;
}
@@ -454,7 +461,7 @@ Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
if (!sport->lpuart_dma_tx_use)
temp |= UARTCTRL_TIE;
lpuart32_write(&sport->port, temp, UARTCTRL);
-@@ -1572,12 +1715,12 @@ static int lpuart32_startup(struct uart_
+@@ -1596,12 +1741,12 @@ static int lpuart32_startup(struct uart_
spin_lock_irqsave(&sport->port.lock, flags);
@@ -469,7 +476,7 @@ Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
lpuart32_configure(sport);
spin_unlock_irqrestore(&sport->port.lock, flags);
-@@ -1587,7 +1730,7 @@ static int lpuart32_startup(struct uart_
+@@ -1611,7 +1756,7 @@ static int lpuart32_startup(struct uart_
static void lpuart_dma_shutdown(struct lpuart_port *sport)
{
if (sport->lpuart_dma_rx_use) {
@@ -478,7 +485,7 @@ Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
lpuart_dma_rx_free(&sport->port);
}
-@@ -1628,11 +1771,22 @@ static void lpuart32_shutdown(struct uar
+@@ -1652,11 +1797,22 @@ static void lpuart32_shutdown(struct uar
spin_lock_irqsave(&port->lock, flags);
@@ -503,7 +510,7 @@ Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
spin_unlock_irqrestore(&port->lock, flags);
-@@ -1729,10 +1883,10 @@ lpuart_set_termios(struct uart_port *por
+@@ -1753,10 +1909,10 @@ lpuart_set_termios(struct uart_port *por
* baud rate and restart Rx DMA path.
*
* Since timer function acqures sport->port.lock, need to stop before
@@ -516,7 +523,7 @@ Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
lpuart_dma_rx_free(&sport->port);
}
-@@ -1944,10 +2098,10 @@ lpuart32_set_termios(struct uart_port *p
+@@ -1968,10 +2124,10 @@ lpuart32_set_termios(struct uart_port *p
* baud rate and restart Rx DMA path.
*
* Since timer function acqures sport->port.lock, need to stop before
@@ -529,7 +536,7 @@ Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
lpuart_dma_rx_free(&sport->port);
}
-@@ -2456,6 +2610,10 @@ static int lpuart_probe(struct platform_
+@@ -2480,6 +2636,10 @@ static int lpuart_probe(struct platform_
sport->port.dev = &pdev->dev;
sport->port.type = PORT_LPUART;
sport->devtype = sdata->devtype;
@@ -540,7 +547,7 @@ Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
ret = platform_get_irq(pdev, 0);
if (ret < 0)
return ret;
-@@ -2618,7 +2776,7 @@ static int lpuart_suspend(struct device
+@@ -2642,7 +2802,7 @@ static int lpuart_suspend(struct device
* Rx DMA path before suspend and start Rx DMA path on resume.
*/
if (irq_wake) {