Skip to contentSkip to conversation

serial: add Ambarella CV75 8250_dw quirks

PATCH In review Long Zhao 4 participants 7 messages Oct 9 – Oct 23

Subsystems (4)
lore
Share & tools
lore

Long Zhao

author
#0 lore raw

cover serial: add Ambarella CV75 8250_dw quirks

Split from the combined CV75 bring-up series. The 8250_dw driver does not depend on ARCH_AMBARELLA. The binding uses the ambarella vendor prefix, which is added by the SoC series and is not in mainline yet; dt_binding_check needs that prefix.

These patches match the UART patches in the combined v9.

To: Greg Kroah-Hartman <[email protected]>
To: Jiri Slaby <[email protected]>
To: [email protected]
Cc: Linus Walleij <[email protected]>
Cc: Andy Shevchenko <[email protected]>
Cc: Ilpo Järvinen <[email protected]>
Cc: Rob Herring <[email protected]>
Cc: Krzysztof Kozlowski <[email protected]>
Cc: Krzysztof Kozlowski <[email protected]>
Cc: Krzysztof Kozlowski <[email protected]>
Cc: Conor Dooley <[email protected]>
Cc: [email protected]
Cc: Long Zhao <[email protected]>
Cc: Long Zhao <[email protected]>
Cc: [email protected]

Assisted-by LLM

---
Long Zhao (2):
dt-bindings: serial: snps-dw-apb-uart: add ambarella,cv75-uart
serial: 8250_dw: add Ambarella CV75 quirks

 .../bindings/serial/snps-dw-apb-uart.yaml          |  1 +
 drivers/tty/serial/8250/8250_dw.c                  | 32 ++++++++++++++++++++++
 2 files changed, 33 insertions(+)

---
base-commit: 34cf6dafc47441dfb6b356a095b89c3585a93714
change-id: 20261007-cv75-uart-44a6029b6c31

Best regards,

Signature · 1 line
Long Zhao <[email protected]>
author
#1 lore raw

PATCH 1/2 dt-bindings: serial: snps-dw-apb-uart: add ambarella,cv75-uart

Add the Ambarella CV75 compatible string to the Synopsys DW APB UART binding. The block is Ambarella IP with a DW-like register map, so it is described as a DW APB UART variant.

---
 Documentation/devicetree/bindings/serial/snps-dw-apb-uart.yaml | 1 +
 1 file changed, 1 insertion(+)
Documentation/devicetree/bindings/serial/snps-dw-apb-uart.yaml +1 -0
index 49f51b002879..cec5c679f1a9 100644
@@ -51,6 +51,7 @@ properties:
           - const: renesas,rzn1-uart
       - items:
           - enum:
+              - ambarella,cv75-uart
               - anlogic,dr1v90-uart
               - brcm,bcm11351-dw-apb-uart
               - brcm,bcm21664-dw-apb-uart
Signature · 1 line
2.34.1
#2 lore raw

Re: [PATCH 1/2] dt-bindings: serial: snps-dw-apb-uart: add ambarella,cv75-uart

Sashiko has reviewed this patch and found no issues. It looks great!
Quoted 9 lines

From: Long Zhao <[email protected]>

Add the Ambarella CV75 compatible string to the Synopsys DW APB UART binding. The block is Ambarella IP with a DW-like register map, so it is described as a DW APB UART variant.

Sashiko has reviewed this patch and found no issues. It looks great!

Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1
#3 lore raw

Re: [PATCH 1/2] dt-bindings: serial: snps-dw-apb-uart: add ambarella,cv75-uart

In reply to Long Zhao
Quoted 18 lines · On 09/10/2026 12:59, Long Zhao via B4 Relay wrote:

From: Long Zhao <[email protected]>

Add the Ambarella CV75 compatible string to the Synopsys DW APB UART binding. The block is Ambarella IP with a DW-like register map, so it is described as a DW APB UART variant.

---
 Documentation/devicetree/bindings/serial/snps-dw-apb-uart.yaml | 1 +
 1 file changed, 1 insertion(+)
Documentation/devicetree/bindings/serial/snps-dw-apb-uart.yaml +0 -0
index 49f51b002879..cec5c679f1a9 100644

Documentation/devicetree/bindings/serial/snps-dw-apb-uart.yaml properties: · line 54

Quoted 4 lines
Documentation/devicetree/bindings/serial/snps-dw-apb-uart.yaml +1 -0
@@ -51,6 +51,7 @@ properties:
           - const: renesas,rzn1-uart
       - items:
           - enum:
+              - ambarella,cv75-uart

This depends on vendor prefix patch at least from next point of view.

Best regards,
Krzysztof

#4 lore raw

Re:Re: [PATCH 1/2] dt-bindings: serial: snps-dw-apb-uart: add ambarella,cv75-uart

Quoted 27 lines · Krzysztof Kozlowski
Quoted 18 lines · On 09/10/2026 12:59, Long Zhao via B4 Relay wrote:

From: Long Zhao <[email protected]>

Add the Ambarella CV75 compatible string to the Synopsys DW APB UART binding. The block is Ambarella IP with a DW-like register map, so it is described as a DW APB UART variant.

---
 Documentation/devicetree/bindings/serial/snps-dw-apb-uart.yaml | 1 +
 1 file changed, 1 insertion(+)
Documentation/devicetree/bindings/serial/snps-dw-apb-uart.yaml +0 -0
index 49f51b002879..cec5c679f1a9 100644

Documentation/devicetree/bindings/serial/snps-dw-apb-uart.yaml properties: · line 54

Quoted 4 lines
Documentation/devicetree/bindings/serial/snps-dw-apb-uart.yaml +1 -0
@@ -51,6 +51,7 @@ properties:
           - const: renesas,rzn1-uart
       - items:
           - enum:
+              - ambarella,cv75-uart

This depends on vendor prefix patch at least from next point of view.

Quoted 2 lines

Best regards,
Krzysztof

Hi Krzysztof, Greg, Jiri,

Gentle ping on this series.

The ambarella prefix is in linux-next now.
The driver patch already has R-b from Linus Walleij, Andy and Ilpo.

Please let me know if you have any concerns.

Best regards,
Long Zhao

author
#5 lore raw

PATCH 2/2 serial: 8250_dw: add Ambarella CV75 quirks

In reply to Long Zhao

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

---
 drivers/tty/serial/8250/8250_dw.c | 32 ++++++++++++++++++++++++++++++++
 1 file changed, 32 insertions(+)
drivers/tty/serial/8250/8250_dw.c +32 -0
index 5fba913f3301..06f03e893346 100644
@@ -43,6 +43,9 @@
 #define RZN1_UART_xDMACR_8_WORD_BURST	(2 << 1)
 #define RZN1_UART_xDMACR_BLK_SZ(x)	((x) << 3)
 
+/* Ambarella IER: receive timeout interrupt enable */
+#define AMBARELLA_UART_IER_ETOI		BIT(5)
+
 /* Quirks */
 #define DW_UART_QUIRK_OCTEON		BIT(0)
 #define DW_UART_QUIRK_ARMADA_38X	BIT(1)
@@ -60,6 +63,7 @@
 
 struct dw8250_platform_data {
 	u8 usr_reg;
+	u8 ier_mask;
 	u32 cpr_value;
 	unsigned int quirks;
 };
@@ -572,6 +576,25 @@ static void dw8250_prepare_rx_dma(struct uart_8250_port *p)
 	dw8250_writel_ext(up, RZN1_UART_RDMACR, val);
 }
 
+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.
+	 */
+	up->ier |= d->pdata->ier_mask;
+
+	return 0;
+}
+
 static void dw8250_quirks(struct uart_port *p, struct dw8250_data *data)
 {
 	unsigned int quirks = data->pdata->quirks;
@@ -606,6 +629,8 @@ static void dw8250_quirks(struct uart_port *p, struct dw8250_data *data)
 		p->serial_in = dw8250_serial_in32;
 		data->uart_16550_compatible = true;
 	}
+	if (data->pdata->ier_mask)
+		p->startup = dw8250_ier_mask_startup;
 }
 
 static void dw8250_reset_control_assert(void *data)
@@ -879,6 +904,12 @@ static const struct dw8250_platform_data dw8250_intc10ee = {
 	.quirks = DW_UART_QUIRK_IER_KICK,
 };
 
+static const struct dw8250_platform_data dw8250_ambarella_cv75_data = {
+	.usr_reg = DW_UART_USR,
+	.ier_mask = AMBARELLA_UART_IER_ETOI,
+	.quirks = DW_UART_QUIRK_SKIP_SET_RATE,
+};
+
 static const struct dw8250_platform_data dw8250_ultrarisc_dp1000_data = {
 	.usr_reg = DW_UART_USR,
 	.cpr_value = FIELD_PREP_CONST(DW_UART_CPR_ABP_DATA_WIDTH, 2) |
@@ -890,6 +921,7 @@ static const struct dw8250_platform_data dw8250_ultrarisc_dp1000_data = {
 
 static const struct of_device_id dw8250_of_match[] = {
 	{ .compatible = "snps,dw-apb-uart", .data = &dw8250_dw_apb },
+	{ .compatible = "ambarella,cv75-uart", .data = &dw8250_ambarella_cv75_data },
 	{ .compatible = "cavium,octeon-3860-uart", .data = &dw8250_octeon_3860_data },
 	{ .compatible = "marvell,armada-38x-uart", .data = &dw8250_armada_38x_data },
 	{ .compatible = "renesas,rzn1-uart", .data = &dw8250_renesas_rzn1_data },
Signature · 1 line
2.34.1
#6 lore raw

Re: [PATCH 2/2] serial: 8250_dw: add Ambarella CV75 quirks

Sashiko has reviewed this patch and found no issues. It looks great!
Quoted 7 lines

From: Long Zhao <[email protected]>

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.

Quoted 8 lines

Quirks:
- keep IER ETOI (bit 5) set for RX timeout behaviour
- skip set_rate; baud clock is managed outside the UART block

Sashiko has reviewed this patch and found no issues. It looks great!

Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=2