[PATCH v7 12/12] serial: 8250_dw: configure RX trigger thresholds for Octeon

From: James Hilliard

Date: Tue Nov 03 2026 - 16:41:18 EST


Octeon uses the DesignWare receive-trigger mapping with a 64-byte FIFO,
giving thresholds of 1, 16, 32 and 62 bytes. Its setup bypasses
dw8250_setup_port(), so it does not install the common trigger callbacks.
PORT_OCTEON also has no static trigger table, so rx_trig_bytes is not
exposed.

Supply the fixed depth from platform data when firmware has not provided
one and initialize the common trigger table before port registration.
This makes rx_trig_bytes available while preserving the Octeon port type
and register accessors.

Select DMA before filling in the default depth, as before when the 8250
core supplied that default during registration. Thus the new trigger
setup preserves which ports attach DMA and their existing burst sizes.

Signed-off-by: James Hilliard <james.hilliard1@xxxxxxxxx>
---
drivers/tty/serial/8250/8250_dw.c | 19 ++++++++++++++++++-
1 file changed, 18 insertions(+), 1 deletion(-)

diff --git a/drivers/tty/serial/8250/8250_dw.c b/drivers/tty/serial/8250/8250_dw.c
index cdd3a62dfa7e..063441923864 100644
--- a/drivers/tty/serial/8250/8250_dw.c
+++ b/drivers/tty/serial/8250/8250_dw.c
@@ -663,6 +663,22 @@ static int dw8250_setup(struct uart_port *p)
return dw8250_setup_dma(p);
}

+static int dw8250_octeon_setup(struct uart_port *p)
+{
+ struct dw8250_data *data = to_dw8250_data(p->private_data);
+ int ret;
+
+ /* Preserve DMA selection before supplying the fixed FIFO depth */
+ ret = dw8250_setup_dma(p);
+ if (ret)
+ return ret;
+
+ if (!p->fifosize)
+ p->fifosize = data->pdata->fifo_size;
+
+ return dw8250_setup_rxtrig(p);
+}
+
static int dw8250_sunxi_setup(struct uart_port *p)
{
struct dw8250_data *data = to_dw8250_data(p->private_data);
@@ -931,8 +947,9 @@ static const struct dw8250_platform_data dw8250_a523_data = {

static const struct dw8250_platform_data dw8250_octeon_3860_data = {
.usr_reg = OCTEON_UART_USR,
+ .fifo_size = 64,
.quirks = DW_UART_QUIRK_OCTEON,
- .setup = dw8250_setup_dma,
+ .setup = dw8250_octeon_setup,
};

static const struct dw8250_platform_data dw8250_armada_38x_data = {

--
2.53.0