Linux Serial subsystem development
 help / color / mirror / Atom feed
* [PATCH 0/3] serial: 8250: Add Loongson-2K0300 and Loongson-2K3000 UART support
@ 2026-11-04  7:45 Binbin Zhou
  2026-11-04  7:45 ` [PATCH 1/3] dt-bindings: serial: 8250: Document Loongson-2K0300 UART compatible Binbin Zhou
                   ` (3 more replies)
  0 siblings, 4 replies; 12+ messages in thread
From: Binbin Zhou @ 2026-11-04  7:45 UTC (permalink / raw)
  To: Binbin Zhou, Huacai Chen, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Greg Kroah-Hartman, Jiri Slaby, Haowei Zheng
  Cc: Huacai Chen, Xuerui Wang, loongarch, devicetree, linux-serial,
	Binbin Zhou

Hi all:

This series adds UART support for two Loongson SoCs.

The Loongson-2K0300 UART is the same as the one found on the
Loongson-2K1500, so it is documented as falling back to
"loongson,ls2k1500-uart" and then "ns16550a". No driver changes are
needed.

The Loongson-2K3000 UART differs from earlier Loongson UARTs in that it
does not require MCR/MSR signal inversion. It also supports a fractional
baud rate divisor. A dedicated compatible and driver data are added so
the driver can distinguish it.

Thanks.
Binbin

Binbin Zhou (3):
  dt-bindings: serial: 8250: Document Loongson-2K0300 UART compatible
  dt-bindings: serial: 8250: Add dedicated Loongson-2K3000 UART
    compatible
  serial: 8250_loongson: Add Loongson-2K3000 UART support

 Documentation/devicetree/bindings/serial/8250.yaml | 4 ++++
 drivers/tty/serial/8250/8250_loongson.c            | 7 +++++++
 2 files changed, 11 insertions(+)


base-commit: 6628e7d4c6b25c8d18f1345e3a20d21829aae7e4
-- 
2.52.0


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH 1/3] dt-bindings: serial: 8250: Document Loongson-2K0300 UART compatible
  2026-11-04  7:45 [PATCH 0/3] serial: 8250: Add Loongson-2K0300 and Loongson-2K3000 UART support Binbin Zhou
@ 2026-11-04  7:45 ` Binbin Zhou
  2026-11-04  7:49   ` sashiko-bot
  2026-11-19 21:43   ` Rob Herring (Arm)
  2026-11-04  7:45 ` [PATCH 2/3] dt-bindings: serial: 8250: Add dedicated Loongson-2K3000 " Binbin Zhou
                   ` (2 subsequent siblings)
  3 siblings, 2 replies; 12+ messages in thread
From: Binbin Zhou @ 2026-11-04  7:45 UTC (permalink / raw)
  To: Binbin Zhou, Huacai Chen, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Greg Kroah-Hartman, Jiri Slaby, Haowei Zheng
  Cc: Huacai Chen, Xuerui Wang, loongarch, devicetree, linux-serial,
	Binbin Zhou

The UART on the Loongson-2K0300 SoC is identical to the Loongson-2K1500
UART. Document the SoC-specific compatible `loongson,ls2k0300-uart`
with fallback to `loongson,ls2k1500-uart` and then `ns16550a`.

Signed-off-by: Binbin Zhou <zhoubinbin@loongson.cn>
---
 Documentation/devicetree/bindings/serial/8250.yaml | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Documentation/devicetree/bindings/serial/8250.yaml b/Documentation/devicetree/bindings/serial/8250.yaml
index 50d5c977afa3..01abd39509a7 100644
--- a/Documentation/devicetree/bindings/serial/8250.yaml
+++ b/Documentation/devicetree/bindings/serial/8250.yaml
@@ -192,6 +192,7 @@ properties:
               - loongson,ls3a4000-uart
               - loongson,ls3a5000-uart
               - loongson,ls3a6000-uart
+              - loongson,ls2k0300-uart
               - loongson,ls2k2000-uart
           - const: loongson,ls2k1500-uart
           - const: ns16550a
-- 
2.52.0


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 2/3] dt-bindings: serial: 8250: Add dedicated Loongson-2K3000 UART compatible
  2026-11-04  7:45 [PATCH 0/3] serial: 8250: Add Loongson-2K0300 and Loongson-2K3000 UART support Binbin Zhou
  2026-11-04  7:45 ` [PATCH 1/3] dt-bindings: serial: 8250: Document Loongson-2K0300 UART compatible Binbin Zhou
@ 2026-11-04  7:45 ` Binbin Zhou
  2026-11-04  7:52   ` sashiko-bot
  2026-11-04  7:45 ` [PATCH 3/3] serial: 8250_loongson: Add Loongson-2K3000 UART support Binbin Zhou
  2026-11-04  7:58 ` [PATCH 0/3] serial: 8250: Add Loongson-2K0300 and " Huacai Chen
  3 siblings, 1 reply; 12+ messages in thread
From: Binbin Zhou @ 2026-11-04  7:45 UTC (permalink / raw)
  To: Binbin Zhou, Huacai Chen, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Greg Kroah-Hartman, Jiri Slaby, Haowei Zheng
  Cc: Huacai Chen, Xuerui Wang, loongarch, devicetree, linux-serial,
	Binbin Zhou

Unlike earlier Loongson UARTs, the Loongson-2K3000 UART does not require
MCR/MSR signal inversion. Add a dedicated compatible so the driver can
distinguish it from the existing Loongson UART variants.

Document `loongson,ls2k3000-uart` with `ns16550a` as fallback.

Signed-off-by: Haowei Zheng <zhenghaowei@loongson.cn>
Signed-off-by: Binbin Zhou <zhoubinbin@loongson.cn>
---
 Documentation/devicetree/bindings/serial/8250.yaml | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/Documentation/devicetree/bindings/serial/8250.yaml b/Documentation/devicetree/bindings/serial/8250.yaml
index 01abd39509a7..33c13c48ed56 100644
--- a/Documentation/devicetree/bindings/serial/8250.yaml
+++ b/Documentation/devicetree/bindings/serial/8250.yaml
@@ -196,6 +196,9 @@ properties:
               - loongson,ls2k2000-uart
           - const: loongson,ls2k1500-uart
           - const: ns16550a
+      - items:
+          - const: loongson,ls2k3000-uart
+          - const: ns16550a
       - items:
           - enum:
               - aspeed,ast2600-vuart
-- 
2.52.0


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 3/3] serial: 8250_loongson: Add Loongson-2K3000 UART support
  2026-11-04  7:45 [PATCH 0/3] serial: 8250: Add Loongson-2K0300 and Loongson-2K3000 UART support Binbin Zhou
  2026-11-04  7:45 ` [PATCH 1/3] dt-bindings: serial: 8250: Document Loongson-2K0300 UART compatible Binbin Zhou
  2026-11-04  7:45 ` [PATCH 2/3] dt-bindings: serial: 8250: Add dedicated Loongson-2K3000 " Binbin Zhou
@ 2026-11-04  7:45 ` Binbin Zhou
  2026-11-04  7:50   ` sashiko-bot
  2026-11-04  7:58 ` [PATCH 0/3] serial: 8250: Add Loongson-2K0300 and " Huacai Chen
  3 siblings, 1 reply; 12+ messages in thread
From: Binbin Zhou @ 2026-11-04  7:45 UTC (permalink / raw)
  To: Binbin Zhou, Huacai Chen, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Greg Kroah-Hartman, Jiri Slaby, Haowei Zheng
  Cc: Huacai Chen, Xuerui Wang, loongarch, devicetree, linux-serial,
	Binbin Zhou

The Loongson-2K3000 UART differs from earlier Loongson UARTs in that it
does not require MCR/MSR signal inversion. It also supports a fractional
baud rate divisor.

Add the corresponding OF match entry for `loongson,ls2k3000-uart` so the
driver can probe with the new driver data.

Signed-off-by: Haowei Zheng <zhenghaowei@loongson.cn>
Signed-off-by: Binbin Zhou <zhoubinbin@loongson.cn>
---
 drivers/tty/serial/8250/8250_loongson.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/tty/serial/8250/8250_loongson.c b/drivers/tty/serial/8250/8250_loongson.c
index 6d06ed28382d..0458a9f82d86 100644
--- a/drivers/tty/serial/8250/8250_loongson.c
+++ b/drivers/tty/serial/8250/8250_loongson.c
@@ -43,6 +43,12 @@ static const struct loongson_uart_ddata ls2k1500_uart_data = {
 	.msr_invert = 0,
 };
 
+static const struct loongson_uart_ddata ls2k3000_uart_data = {
+	.has_frac = true,
+	.mcr_invert = 0,
+	.msr_invert = 0,
+};
+
 struct loongson_uart_priv {
 	struct uart_8250_port *uport;
 	struct clk *clk;
@@ -216,6 +222,7 @@ static DEFINE_SIMPLE_DEV_PM_OPS(loongson_uart_pm_ops, loongson_uart_suspend,
 static const struct of_device_id loongson_uart_of_ids[] = {
 	{ .compatible = "loongson,ls2k0500-uart", .data = &ls2k0500_uart_data },
 	{ .compatible = "loongson,ls2k1500-uart", .data = &ls2k1500_uart_data },
+	{ .compatible = "loongson,ls2k3000-uart", .data = &ls2k3000_uart_data },
 	{ },
 };
 MODULE_DEVICE_TABLE(of, loongson_uart_of_ids);
-- 
2.52.0


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* Re: [PATCH 1/3] dt-bindings: serial: 8250: Document Loongson-2K0300 UART compatible
  2026-11-04  7:45 ` [PATCH 1/3] dt-bindings: serial: 8250: Document Loongson-2K0300 UART compatible Binbin Zhou
@ 2026-11-04  7:49   ` sashiko-bot
  2026-11-19 21:43   ` Rob Herring (Arm)
  1 sibling, 0 replies; 12+ messages in thread
From: sashiko-bot @ 2026-11-04  7:49 UTC (permalink / raw)
  To: Binbin Zhou; +Cc: linux-serial

> The UART on the Loongson-2K0300 SoC is identical to the Loongson-2K1500
> UART. Document the SoC-specific compatible `loongson,ls2k0300-uart`
> with fallback to `loongson,ls2k1500-uart` and then `ns16550a`.
> 
> Signed-off-by: Binbin Zhou <zhoubinbin@loongson.cn>

Sashiko has reviewed this patch and found no issues.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/cover.1793776192.git.zhoubinbin@loongson.cn?part=1


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 3/3] serial: 8250_loongson: Add Loongson-2K3000 UART support
  2026-11-04  7:45 ` [PATCH 3/3] serial: 8250_loongson: Add Loongson-2K3000 UART support Binbin Zhou
@ 2026-11-04  7:50   ` sashiko-bot
  0 siblings, 0 replies; 12+ messages in thread
From: sashiko-bot @ 2026-11-04  7:50 UTC (permalink / raw)
  To: Binbin Zhou; +Cc: linux-serial

> The Loongson-2K3000 UART differs from earlier Loongson UARTs in that it
> does not require MCR/MSR signal inversion. It also supports a fractional
> baud rate divisor.
> 
> Add the corresponding OF match entry for `loongson,ls2k3000-uart` so the
> driver can probe with the new driver data.
> 
> Signed-off-by: Haowei Zheng <zhenghaowei@loongson.cn>
> Signed-off-by: Binbin Zhou <zhoubinbin@loongson.cn>

Sashiko has reviewed this patch and found no issues.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/cover.1793776192.git.zhoubinbin@loongson.cn?part=3


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 2/3] dt-bindings: serial: 8250: Add dedicated Loongson-2K3000 UART compatible
  2026-11-04  7:45 ` [PATCH 2/3] dt-bindings: serial: 8250: Add dedicated Loongson-2K3000 " Binbin Zhou
@ 2026-11-04  7:52   ` sashiko-bot
  2026-11-19 21:45     ` Rob Herring
  0 siblings, 1 reply; 12+ messages in thread
From: sashiko-bot @ 2026-11-04  7:52 UTC (permalink / raw)
  To: Binbin Zhou; +Cc: devicetree, linux-serial, robh, conor+dt

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] dt-bindings: serial: 8250: duplicate ns16550a fallback block for ls2k3000
--

commit 71974153fe22bc00d365059be9198364c9cfaa86
Author: Binbin Zhou <zhoubinbin@loongson.cn>

dt-bindings: serial: 8250: Add dedicated Loongson-2K3000 UART compatible

This commit documents the loongson,ls2k3000-uart compatible string with
ns16550a as a fallback so the driver can distinguish the Loongson-2K3000 UART
from earlier Loongson UARTs that require MCR/MSR signal inversion.

> diff --git a/Documentation/devicetree/bindings/serial/8250.yaml b/Documentation/devicetree/bindings/serial/8250.yaml
> index 01abd39509a7a..33c13c48ed56e 100644
> --- a/Documentation/devicetree/bindings/serial/8250.yaml
> +++ b/Documentation/devicetree/bindings/serial/8250.yaml
> @@ -196,6 +196,9 @@ properties:
>                - loongson,ls2k2000-uart
>            - const: loongson,ls2k1500-uart
>            - const: ns16550a
> +      - items:
> +          - const: loongson,ls2k3000-uart
> +          - const: ns16550a

[Severity: Low]
This isn't a bug, but properties:compatible in
Documentation/devicetree/bindings/serial/8250.yaml already has a two-item
block with const: ns16550a as the fallback that includes the other base
Loongson UART compatibles:

      - items:
          - enum:
              ...
              - loongson,ls2k0500-uart
              - loongson,ls2k1500-uart
          - const: ns16550a

Could loongson,ls2k3000-uart be added to that existing enum instead of adding
a separate two-item block?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/cover.1793776192.git.zhoubinbin@loongson.cn?part=2

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 0/3] serial: 8250: Add Loongson-2K0300 and Loongson-2K3000 UART support
  2026-11-04  7:45 [PATCH 0/3] serial: 8250: Add Loongson-2K0300 and Loongson-2K3000 UART support Binbin Zhou
                   ` (2 preceding siblings ...)
  2026-11-04  7:45 ` [PATCH 3/3] serial: 8250_loongson: Add Loongson-2K3000 UART support Binbin Zhou
@ 2026-11-04  7:58 ` Huacai Chen
  3 siblings, 0 replies; 12+ messages in thread
From: Huacai Chen @ 2026-11-04  7:58 UTC (permalink / raw)
  To: Binbin Zhou
  Cc: Binbin Zhou, Huacai Chen, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Greg Kroah-Hartman, Jiri Slaby, Haowei Zheng,
	Xuerui Wang, loongarch, devicetree, linux-serial

For this series:

Reviewed-by: Huacai Chen <chenhuacai@loongson.cn>

On Wed, Nov 4, 2026 at 3:46 PM Binbin Zhou <zhoubinbin@loongson.cn> wrote:
>
> Hi all:
>
> This series adds UART support for two Loongson SoCs.
>
> The Loongson-2K0300 UART is the same as the one found on the
> Loongson-2K1500, so it is documented as falling back to
> "loongson,ls2k1500-uart" and then "ns16550a". No driver changes are
> needed.
>
> The Loongson-2K3000 UART differs from earlier Loongson UARTs in that it
> does not require MCR/MSR signal inversion. It also supports a fractional
> baud rate divisor. A dedicated compatible and driver data are added so
> the driver can distinguish it.
>
> Thanks.
> Binbin
>
> Binbin Zhou (3):
>   dt-bindings: serial: 8250: Document Loongson-2K0300 UART compatible
>   dt-bindings: serial: 8250: Add dedicated Loongson-2K3000 UART
>     compatible
>   serial: 8250_loongson: Add Loongson-2K3000 UART support
>
>  Documentation/devicetree/bindings/serial/8250.yaml | 4 ++++
>  drivers/tty/serial/8250/8250_loongson.c            | 7 +++++++
>  2 files changed, 11 insertions(+)
>
>
> base-commit: 6628e7d4c6b25c8d18f1345e3a20d21829aae7e4
> --
> 2.52.0
>

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 1/3] dt-bindings: serial: 8250: Document Loongson-2K0300 UART compatible
  2026-11-04  7:45 ` [PATCH 1/3] dt-bindings: serial: 8250: Document Loongson-2K0300 UART compatible Binbin Zhou
  2026-11-04  7:49   ` sashiko-bot
@ 2026-11-19 21:43   ` Rob Herring (Arm)
  1 sibling, 0 replies; 12+ messages in thread
From: Rob Herring (Arm) @ 2026-11-19 21:43 UTC (permalink / raw)
  To: Binbin Zhou
  Cc: Jiri Slaby, Huacai Chen, linux-serial, Huacai Chen, Conor Dooley,
	Greg Kroah-Hartman, Haowei Zheng, loongarch, Krzysztof Kozlowski,
	devicetree, Xuerui Wang, Binbin Zhou


On Wed, 04 Nov 2026 15:45:45 +0800, Binbin Zhou wrote:
> The UART on the Loongson-2K0300 SoC is identical to the Loongson-2K1500
> UART. Document the SoC-specific compatible `loongson,ls2k0300-uart`
> with fallback to `loongson,ls2k1500-uart` and then `ns16550a`.
> 
> Signed-off-by: Binbin Zhou <zhoubinbin@loongson.cn>
> ---
>  Documentation/devicetree/bindings/serial/8250.yaml | 1 +
>  1 file changed, 1 insertion(+)
> 

Acked-by: Rob Herring (Arm) <robh@kernel.org>


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 2/3] dt-bindings: serial: 8250: Add dedicated Loongson-2K3000 UART compatible
  2026-11-04  7:52   ` sashiko-bot
@ 2026-11-19 21:45     ` Rob Herring
  2026-11-24  6:58       ` Binbin Zhou
  0 siblings, 1 reply; 12+ messages in thread
From: Rob Herring @ 2026-11-19 21:45 UTC (permalink / raw)
  To: sashiko-reviews; +Cc: Binbin Zhou, devicetree, linux-serial, conor+dt

On Wed, Nov 04, 2026 at 07:52:04AM +0000, sashiko-bot@kernel.org wrote:
> Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
> - [Low] dt-bindings: serial: 8250: duplicate ns16550a fallback block for ls2k3000
> --
> 
> commit 71974153fe22bc00d365059be9198364c9cfaa86
> Author: Binbin Zhou <zhoubinbin@loongson.cn>
> 
> dt-bindings: serial: 8250: Add dedicated Loongson-2K3000 UART compatible
> 
> This commit documents the loongson,ls2k3000-uart compatible string with
> ns16550a as a fallback so the driver can distinguish the Loongson-2K3000 UART
> from earlier Loongson UARTs that require MCR/MSR signal inversion.
> 
> > diff --git a/Documentation/devicetree/bindings/serial/8250.yaml b/Documentation/devicetree/bindings/serial/8250.yaml
> > index 01abd39509a7a..33c13c48ed56e 100644
> > --- a/Documentation/devicetree/bindings/serial/8250.yaml
> > +++ b/Documentation/devicetree/bindings/serial/8250.yaml
> > @@ -196,6 +196,9 @@ properties:
> >                - loongson,ls2k2000-uart
> >            - const: loongson,ls2k1500-uart
> >            - const: ns16550a
> > +      - items:
> > +          - const: loongson,ls2k3000-uart
> > +          - const: ns16550a
> 
> [Severity: Low]
> This isn't a bug, but properties:compatible in
> Documentation/devicetree/bindings/serial/8250.yaml already has a two-item
> block with const: ns16550a as the fallback that includes the other base
> Loongson UART compatibles:
> 
>       - items:
>           - enum:
>               ...
>               - loongson,ls2k0500-uart
>               - loongson,ls2k1500-uart
>           - const: ns16550a
> 
> Could loongson,ls2k3000-uart be added to that existing enum instead of adding
> a separate two-item block?

Sashiko is correct. Please address this comment.

And please answer sashiko comments before the maintainers have to.

Rob

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 2/3] dt-bindings: serial: 8250: Add dedicated Loongson-2K3000 UART compatible
  2026-11-19 21:45     ` Rob Herring
@ 2026-11-24  6:58       ` Binbin Zhou
  2026-11-24 13:44         ` Rob Herring
  0 siblings, 1 reply; 12+ messages in thread
From: Binbin Zhou @ 2026-11-24  6:58 UTC (permalink / raw)
  To: Rob Herring, sashiko-reviews
  Cc: devicetree, linux-serial, conor+dt, Binbin Zhou

Hi Rob:

Sorry for the late reply.

On 2026/11/20 05:45, Rob Herring wrote:
> On Wed, Nov 04, 2026 at 07:52:04AM +0000, sashiko-bot@kernel.org wrote:
>> Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
>> - [Low] dt-bindings: serial: 8250: duplicate ns16550a fallback block for ls2k3000
>> --
>>
>> commit 71974153fe22bc00d365059be9198364c9cfaa86
>> Author: Binbin Zhou <zhoubinbin@loongson.cn>
>>
>> dt-bindings: serial: 8250: Add dedicated Loongson-2K3000 UART compatible
>>
>> This commit documents the loongson,ls2k3000-uart compatible string with
>> ns16550a as a fallback so the driver can distinguish the Loongson-2K3000 UART
>> from earlier Loongson UARTs that require MCR/MSR signal inversion.
>>
>>> diff --git a/Documentation/devicetree/bindings/serial/8250.yaml b/Documentation/devicetree/bindings/serial/8250.yaml
>>> index 01abd39509a7a..33c13c48ed56e 100644
>>> --- a/Documentation/devicetree/bindings/serial/8250.yaml
>>> +++ b/Documentation/devicetree/bindings/serial/8250.yaml
>>> @@ -196,6 +196,9 @@ properties:
>>>                 - loongson,ls2k2000-uart
>>>             - const: loongson,ls2k1500-uart
>>>             - const: ns16550a
>>> +      - items:
>>> +          - const: loongson,ls2k3000-uart
>>> +          - const: ns16550a
>>
>> [Severity: Low]
>> This isn't a bug, but properties:compatible in
>> Documentation/devicetree/bindings/serial/8250.yaml already has a two-item
>> block with const: ns16550a as the fallback that includes the other base
>> Loongson UART compatibles:
>>
>>        - items:
>>            - enum:
>>                ...
>>                - loongson,ls2k0500-uart
>>                - loongson,ls2k1500-uart
>>            - const: ns16550a
>>
>> Could loongson,ls2k3000-uart be added to that existing enum instead of adding
>> a separate two-item block?

Let me briefly explain why Loongson UART `compatible` is necessary at 
this time.
First, as described in the driver, each `compatible` type defines 
different driver data:
struct loongson_uart_ddata {
         bool has_frac;
         u8 mcr_invert;
         u8 msr_invert;
};
Since the Loongson-2k3000 has already fixed the hardware issues with 
mcr/msr, we need a new `compatible` to correspond to the updated 
`driver_data`.

static const struct loongson_uart_ddata ls2k3000_uart_data = {
         .has_frac = true,
         .mcr_invert = 0,
         .msr_invert = 0,
};

As for why a fallback to `ns16550a` is required in all cases, the DTS 
files for the Loongson-2K1000 and similar devices were merged into the 
repository before `8250_loongson.c`, and this approach was used at the 
time to maintain compatibility[1].


[1]: 
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=13532b5186a7aa4dfd9885355c6af7562b75dd7f
> 
> Sashiko is correct. Please address this comment.
> 
> And please answer sashiko comments before the maintainers have to.

Okay, I'll keep that in mind next time.
> 
> Rob

-- 
Thanks.
Binbin


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 2/3] dt-bindings: serial: 8250: Add dedicated Loongson-2K3000 UART compatible
  2026-11-24  6:58       ` Binbin Zhou
@ 2026-11-24 13:44         ` Rob Herring
  0 siblings, 0 replies; 12+ messages in thread
From: Rob Herring @ 2026-11-24 13:44 UTC (permalink / raw)
  To: Binbin Zhou
  Cc: sashiko-reviews, devicetree, linux-serial, conor+dt, Binbin Zhou

On Tue, Nov 24, 2026 at 02:58:40PM +0800, Binbin Zhou wrote:
> Hi Rob:
> 
> Sorry for the late reply.
> 
> On 2026/11/20 05:45, Rob Herring wrote:
> > On Wed, Nov 04, 2026 at 07:52:04AM +0000, sashiko-bot@kernel.org wrote:
> > > Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
> > > - [Low] dt-bindings: serial: 8250: duplicate ns16550a fallback block for ls2k3000
> > > --
> > > 
> > > commit 71974153fe22bc00d365059be9198364c9cfaa86
> > > Author: Binbin Zhou <zhoubinbin@loongson.cn>
> > > 
> > > dt-bindings: serial: 8250: Add dedicated Loongson-2K3000 UART compatible
> > > 
> > > This commit documents the loongson,ls2k3000-uart compatible string with
> > > ns16550a as a fallback so the driver can distinguish the Loongson-2K3000 UART
> > > from earlier Loongson UARTs that require MCR/MSR signal inversion.
> > > 
> > > > diff --git a/Documentation/devicetree/bindings/serial/8250.yaml b/Documentation/devicetree/bindings/serial/8250.yaml
> > > > index 01abd39509a7a..33c13c48ed56e 100644
> > > > --- a/Documentation/devicetree/bindings/serial/8250.yaml
> > > > +++ b/Documentation/devicetree/bindings/serial/8250.yaml
> > > > @@ -196,6 +196,9 @@ properties:
> > > >                 - loongson,ls2k2000-uart
> > > >             - const: loongson,ls2k1500-uart
> > > >             - const: ns16550a
> > > > +      - items:
> > > > +          - const: loongson,ls2k3000-uart
> > > > +          - const: ns16550a
> > > 
> > > [Severity: Low]
> > > This isn't a bug, but properties:compatible in
> > > Documentation/devicetree/bindings/serial/8250.yaml already has a two-item
> > > block with const: ns16550a as the fallback that includes the other base
> > > Loongson UART compatibles:
> > > 
> > >        - items:
> > >            - enum:
> > >                ...
> > >                - loongson,ls2k0500-uart
> > >                - loongson,ls2k1500-uart
> > >            - const: ns16550a
> > > 
> > > Could loongson,ls2k3000-uart be added to that existing enum instead of adding
> > > a separate two-item block?
> 
> Let me briefly explain why Loongson UART `compatible` is necessary at this
> time.
> First, as described in the driver, each `compatible` type defines different
> driver data:
> struct loongson_uart_ddata {
>         bool has_frac;
>         u8 mcr_invert;
>         u8 msr_invert;
> };
> Since the Loongson-2k3000 has already fixed the hardware issues with
> mcr/msr, we need a new `compatible` to correspond to the updated
> `driver_data`.
> 
> static const struct loongson_uart_ddata ls2k3000_uart_data = {
>         .has_frac = true,
>         .mcr_invert = 0,
>         .msr_invert = 0,
> };
> 
> As for why a fallback to `ns16550a` is required in all cases, the DTS files
> for the Loongson-2K1000 and similar devices were merged into the repository
> before `8250_loongson.c`, and this approach was used at the time to maintain
> compatibility[1].

No one is questioning what the compatibles are, just where you add the 
new schema entry. Use the existing one with the ns16550a fallback 
instead of a new oneOf entry:

      - items:
          - enum:
              - altr,16550-FIFO32
              - altr,16550-FIFO64
              - altr,16550-FIFO128
              - fsl,16550-FIFO64
              - andestech,uart16550
              - nxp,lpc1850-uart
              - opencores,uart16550-rtlsvn105
              - ti,da830-uart
              - loongson,ls2k0500-uart
              - loongson,ls2k1500-uart
          - const: ns16550a

Rob

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2026-11-24 13:44 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-04  7:45 [PATCH 0/3] serial: 8250: Add Loongson-2K0300 and Loongson-2K3000 UART support Binbin Zhou
2026-11-04  7:45 ` [PATCH 1/3] dt-bindings: serial: 8250: Document Loongson-2K0300 UART compatible Binbin Zhou
2026-11-04  7:49   ` sashiko-bot
2026-11-19 21:43   ` Rob Herring (Arm)
2026-11-04  7:45 ` [PATCH 2/3] dt-bindings: serial: 8250: Add dedicated Loongson-2K3000 " Binbin Zhou
2026-11-04  7:52   ` sashiko-bot
2026-11-19 21:45     ` Rob Herring
2026-11-24  6:58       ` Binbin Zhou
2026-11-24 13:44         ` Rob Herring
2026-11-04  7:45 ` [PATCH 3/3] serial: 8250_loongson: Add Loongson-2K3000 UART support Binbin Zhou
2026-11-04  7:50   ` sashiko-bot
2026-11-04  7:58 ` [PATCH 0/3] serial: 8250: Add Loongson-2K0300 and " Huacai Chen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox