* [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; 6+ 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] 6+ 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:45 ` [PATCH 2/3] dt-bindings: serial: 8250: Add dedicated Loongson-2K3000 " Binbin Zhou
` (2 subsequent siblings)
3 siblings, 0 replies; 6+ 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] 6+ 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; 6+ 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] 6+ 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:58 ` [PATCH 0/3] serial: 8250: Add Loongson-2K0300 and " Huacai Chen
3 siblings, 0 replies; 6+ 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] 6+ 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
0 siblings, 0 replies; 6+ 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] 6+ 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; 6+ 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] 6+ messages in thread
end of thread, other threads:[~2026-11-04 7:58 UTC | newest]
Thread overview: 6+ 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:45 ` [PATCH 2/3] dt-bindings: serial: 8250: Add dedicated Loongson-2K3000 " 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
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox