Thread (46 messages) flat view 46 messages, 8 authors, 2d ago

Re:Re: [PATCH v6 11/13] serial: 8250_dw: add Ambarella CV75 quirks

From: zl020895 <hidden>
Date: 2026-09-10 09:14:36
Also in: linux-clk, linux-devicetree, linux-gpio, linux-serial, lkml

Hi Andy,
Thanks for the Reviewed-by.
Wondering if we should undo this in the port's .shutdown() callback.
I saw the shutdown path already covers it: dw8250_shutdown() calls
serial8250_do_shutdown(), which does
	up->ier = 0;
	serial_port_out(port, UART_IER, 0);
so both the IER shadow and hardware IER are cleared, including ETOI.

Best regards,
Long Zhao

At 2026-09-10 16:33:14, "Andy Shevchenko" [off-list ref] wrote:
On Fri, Sep 04, 2026 at 02:38:18PM +0800, Long Zhao via B4 Relay wrote:
quoted
The Ambarella CV75 UART is Ambarella IP, not a Synopsys DesignWare
licensed block. At the register level it is close enough to DW APB UART
that a full custom UART driver is unnecessary: reuse 8250_dw with a
small platform quirk.

Quirks:
- keep IER ETOI (bit 5) set for RX timeout behaviour
- skip set_rate; baud clock is managed outside the UART block
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

...
quoted
+static int dw8250_ier_mask_startup(struct uart_port *p)
+{
+	struct dw8250_data *d = to_dw8250_data(p->private_data);
+	struct uart_8250_port *up = up_to_u8250p(p);
+	int ret;
+
+	ret = serial8250_do_startup(p);
+	if (ret)
+		return ret;
+
+	/*
+	 * Ambarella keeps variant IER bits (e.g. ETOI) set for correct RX
+	 * timeout behaviour. Force them into the 8250 IER shadow so later
+	 * generic IER updates do not clear them.
+	 */
Wondering if we should undo this in the port's .shutdown() callback.
quoted
+	up->ier |= d->pdata->ier_mask;
+	serial_port_out(p, UART_IER, up->ier);
+
+	return 0;
+}
-- 
With Best Regards,
Andy Shevchenko
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help