46 lines
1.5 KiB
Diff
46 lines
1.5 KiB
Diff
|
From 71394e3c1ec6c1b5812bb6034b1e63cc1fbf0f64 Mon Sep 17 00:00:00 2001
|
||
|
From: =?UTF-8?q?Ond=C5=99ej=20Jirman?= <megi@xff.cz>
|
||
|
Date: Sat, 1 Feb 2020 23:40:41 +0100
|
||
|
Subject: [PATCH 140/389] tty: serial: 8250-dw: Use fifo-size from DTS
|
||
|
|
||
|
Saves 20ms per port of boot time.
|
||
|
|
||
|
Signed-off-by: Ondrej Jirman <megi@xff.cz>
|
||
|
---
|
||
|
drivers/tty/serial/8250/8250_dw.c | 4 ++++
|
||
|
drivers/tty/serial/8250/8250_port.c | 3 +++
|
||
|
2 files changed, 7 insertions(+)
|
||
|
|
||
|
diff --git a/drivers/tty/serial/8250/8250_dw.c b/drivers/tty/serial/8250/8250_dw.c
|
||
|
index 7db51781289e..8442394e338e 100644
|
||
|
--- a/drivers/tty/serial/8250/8250_dw.c
|
||
|
+++ b/drivers/tty/serial/8250/8250_dw.c
|
||
|
@@ -594,6 +594,10 @@ static int dw8250_probe(struct platform_device *pdev)
|
||
|
/* Always ask for fixed clock rate from a property. */
|
||
|
device_property_read_u32(dev, "clock-frequency", &p->uartclk);
|
||
|
|
||
|
+ val = 0;
|
||
|
+ device_property_read_u32(dev, "fifo-size", &val);
|
||
|
+ p->fifosize = val;
|
||
|
+
|
||
|
/* If there is separate baudclk, get the rate from it. */
|
||
|
data->clk = devm_clk_get_optional(dev, "baudclk");
|
||
|
if (data->clk == NULL)
|
||
|
diff --git a/drivers/tty/serial/8250/8250_port.c b/drivers/tty/serial/8250/8250_port.c
|
||
|
index 388172289627..44f0efad5ae3 100644
|
||
|
--- a/drivers/tty/serial/8250/8250_port.c
|
||
|
+++ b/drivers/tty/serial/8250/8250_port.c
|
||
|
@@ -841,6 +841,9 @@ static int size_fifo(struct uart_8250_port *up)
|
||
|
unsigned short old_dl;
|
||
|
int count;
|
||
|
|
||
|
+ if (up->port.fifosize)
|
||
|
+ return up->port.fifosize;
|
||
|
+
|
||
|
old_lcr = serial_in(up, UART_LCR);
|
||
|
serial_out(up, UART_LCR, 0);
|
||
|
old_fcr = serial_in(up, UART_FCR);
|
||
|
--
|
||
|
2.35.3
|
||
|
|