From nobody Tue Apr 7 07:34:42 2026 Received: from va-2-39.ptr.blmpb.com (va-2-39.ptr.blmpb.com [209.127.231.39]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E3ECE38AC7A for ; Sat, 14 Mar 2026 23:41:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.127.231.39 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773531716; cv=none; b=lVOMfUQRcmwnb6mmcPTDWAWS3vHpK58isg6TQ4IqO+23kHltEeO89E03fiBWTH0cxGM2G7s/8WK7lBkDzSLh28oskRCQ2dyxu94zM8ko2CTS9oHa5IbhX+NdjtxqDiWaSa5JJx6Oo8HMMIMuqfb8Fq0WXWdaXPNIvbC0piad/cI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773531716; c=relaxed/simple; bh=jm7rXByn7R76HvNJnKE25FhL+cyLR5bGS1nz/RgRzb0=; h=In-Reply-To:To:Cc:From:Subject:Message-Id:Mime-Version:Date: References:Content-Type; b=uQM0DckV8rS0yvi2Q5/3wPOAqNKCH8rsVI0zqiggip7WTNWCho8TnJJeZC6ikI3h7h8Ld+7lG4+uP3C7eg6N1l3ZoGgWFI0CY/lhvDfVpTwcDbj2u42A4fTx2GIU4xmz4uPYGSueVkVsYt4GkSHWHwucmvUEBZCr/Uof7ALMU/Q= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=oss.cipunited.com; spf=pass smtp.mailfrom=oss.cipunited.com; dkim=pass (2048-bit key) header.d=oss.cipunited.com header.i=@oss.cipunited.com header.b=vlQ/m5bI; arc=none smtp.client-ip=209.127.231.39 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=oss.cipunited.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.cipunited.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=oss.cipunited.com header.i=@oss.cipunited.com header.b="vlQ/m5bI" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; s=feishu2303200042; d=oss.cipunited.com; t=1773531709; h=from:subject:mime-version:from:date:message-id:subject:to:cc: reply-to:content-type:mime-version:in-reply-to:message-id; bh=NuHxZnrmW9mfPVCNo1dVIioyYd9nuGxeDz8GheH7iCw=; b=vlQ/m5bIbb8C8UgcB8z0cE7F6mKN/tCZG5QHy//NZsYWfkCHIkCslNuVW91rtk/02Wwn6+ /mVe6QzVxmtvijmbg8pgyX4E0fbj6p3R9GFZQ9Hxso+Z2RlaP6iERnvI20rBw11ZCc2QVF YHwa0YAsJrthg2Tw3AKFbBACDYIV2G986SBy3lznjOCHeQCXYQ/yPZ2hpNe8aGW8Ky2TEI pRkqWIBes/9vzLjpEvfJyUE/f2YbgOFgFbv7w8cAa+i8LPMVFd8X8YeJ/JD5aV2r8yGUK5 wmZ0fl6NltvLcVOGEKEMu8Nvlra4ubywhAXjREhWINjfqMgpKpKs7LEpa8vqtw== In-Reply-To: <20260314234143.651298-1-rongrong@oss.cipunited.com> To: "Greg Kroah-Hartman" , "Jiri Slaby" , "Rob Herring" , "Krzysztof Kozlowski" , "Conor Dooley" , "Thomas Bogendoerfer" , "Huacai Chen" , "Jiaxun Yang" Cc: "Rong Zhang" , , , , , "Yao Zi" , "Icenowy Zheng" , "Rong Zhang" From: "Rong Zhang" Subject: [PATCH 1/3] dt-bindings: serial: 8250: Add Loongson 3A4000 uart compatible Message-Id: <20260314234143.651298-2-rongrong@oss.cipunited.com> X-Mailer: git-send-email 2.53.0 X-Original-From: Rong Zhang Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Lms-Return-Path: Date: Sun, 15 Mar 2026 07:41:41 +0800 Received: from tb ([223.88.91.90]) by smtp.feishu.cn with ESMTPS; Sun, 15 Mar 2026 07:41:46 +0800 References: <20260314234143.651298-1-rongrong@oss.cipunited.com> Content-Type: text/plain; charset="utf-8" The UART controller on Loongson 3A4000 is compatible with Loongson 2K1500, which is NS16550A-compatible with an additional fractional frequency divisor register. Add loongson,ls3a4000-uart as compatible with loongson,ls2k1500-uart. Signed-off-by: Rong Zhang Acked-by: Krzysztof Kozlowski --- Documentation/devicetree/bindings/serial/8250.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/serial/8250.yaml b/Documenta= tion/devicetree/bindings/serial/8250.yaml index 73851f19330d..1d1f2a22776c 100644 --- a/Documentation/devicetree/bindings/serial/8250.yaml +++ b/Documentation/devicetree/bindings/serial/8250.yaml @@ -179,6 +179,7 @@ properties: - const: ns16550a - items: - enum: + - loongson,ls3a4000-uart - loongson,ls3a5000-uart - loongson,ls3a6000-uart - loongson,ls2k2000-uart --=20 2.53.0 From nobody Tue Apr 7 07:34:42 2026 Received: from va-2-38.ptr.blmpb.com (va-2-38.ptr.blmpb.com [209.127.231.38]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4A43538C2CB for ; Sat, 14 Mar 2026 23:41:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.127.231.38 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773531717; cv=none; b=ps/Dkd3vg1rxCXDlFB+eJ079DjU9u3N5dACh1tCTlZhktEUPFx+DfW2xLKAJsz9ip/hbDf9hpKbyDpUm1Twx1qsKwJu8pIR4zXkod3VmAc9hlXW3Ut+slE+9mt/4iMsO31xxKaRau0O0drhW1kcp8DQ3VXmoA5avTK47Jg48vyE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773531717; c=relaxed/simple; bh=jbTjQzTzKLODEEV96JhJ4cxD23a4Xp2o5KR4Cttb9Y0=; h=To:References:From:Subject:Mime-Version:In-Reply-To:Cc:Message-Id: Content-Type:Date; b=HYuR02JuFdAauXIzCfKgJRixNcyUWSD7TpEwTURRFOQmPQUPBAW+AqBHrQ942ZEJ06J7i6ipSTNb6ViG0K1uedOPbt22HR2M4hB3sv3XUlGNenIrrwrT/TIB/BBtNsxJ3y6as772/Lh8f3rUOl73SS6/Q8UXYb4kZIrheF08FQw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=oss.cipunited.com; spf=pass smtp.mailfrom=oss.cipunited.com; dkim=pass (2048-bit key) header.d=oss.cipunited.com header.i=@oss.cipunited.com header.b=JjsZ2sox; arc=none smtp.client-ip=209.127.231.38 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=oss.cipunited.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.cipunited.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=oss.cipunited.com header.i=@oss.cipunited.com header.b="JjsZ2sox" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; s=feishu2303200042; d=oss.cipunited.com; t=1773531710; h=from:subject:mime-version:from:date:message-id:subject:to:cc: reply-to:content-type:mime-version:in-reply-to:message-id; bh=qjwiWQK9ND0M8GvhVewD7xqCAHpseSipYcAsLmniDM0=; b=JjsZ2soxrm2uT3cQ0RfZzTqf9Z5jZJpknXpTVicIXVB95m9P2ZCTsiXkbtrfpV2rlNZHAU 3e5S939OxYIZf3HGci9Oeo9l1mcaqP8u5ncOwn/wMQuVs11YrvbZJUm8iOAHUUPipN9XMq ig6z+HwiV5mTDv2Wm5DEME31Pya+d++VBaUBbOFfHGC2NrlEhPd2rIjyN9MQ4Edar+edLA OsA936Vub6dEenhy3M97Cv/s7ixOEg3XJouYXH72phJt/RUTMfFpW/vX4Jd8JwJxYs8J+2 E3LUm+suixc1OGrC4n1Wpi10Yae8ZXaRZVE2SZN0LvfsZinLPH5anCHx1uvnng== To: "Greg Kroah-Hartman" , "Jiri Slaby" , "Rob Herring" , "Krzysztof Kozlowski" , "Conor Dooley" , "Thomas Bogendoerfer" , "Huacai Chen" , "Jiaxun Yang" Received: from tb ([223.88.91.90]) by smtp.feishu.cn with ESMTPS; Sun, 15 Mar 2026 07:41:48 +0800 X-Mailer: git-send-email 2.53.0 X-Lms-Return-Path: References: <20260314234143.651298-1-rongrong@oss.cipunited.com> From: "Rong Zhang" Subject: [PATCH 2/3] serial: 8250: loongson: Enable building on MIPS Loongson64 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 In-Reply-To: <20260314234143.651298-1-rongrong@oss.cipunited.com> Cc: "Rong Zhang" , , , , , "Yao Zi" , "Icenowy Zheng" , "Rong Zhang" Message-Id: <20260314234143.651298-3-rongrong@oss.cipunited.com> Content-Transfer-Encoding: quoted-printable Date: Sun, 15 Mar 2026 07:41:42 +0800 X-Original-From: Rong Zhang Content-Type: text/plain; charset="utf-8" Loongson 3A4000 is a MIPS-based Loongson64 CPU which also supports 8250_loongson (loongson-uart). Enable building on MIPS Loongson64 so that Loongson 3A4000 can benefit from it. Signed-off-by: Rong Zhang --- drivers/tty/serial/8250/Kconfig | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/tty/serial/8250/Kconfig b/drivers/tty/serial/8250/Kcon= fig index fd4e8b6ab60d..fc3e58d62233 100644 --- a/drivers/tty/serial/8250/Kconfig +++ b/drivers/tty/serial/8250/Kconfig @@ -465,11 +465,12 @@ config SERIAL_8250_OMAP_TTYO_FIXUP config SERIAL_8250_LOONGSON tristate "Loongson 8250 based serial port" depends on SERIAL_8250 - depends on LOONGARCH || COMPILE_TEST + depends on LOONGARCH || MACH_LOONGSON64 || COMPILE_TEST help - If you have a machine based on LoongArch CPU you can enable - its onboard serial ports by enabling this option. The option - is applicable to both devicetree and ACPI, say Y to this option. + If you have a machine based on LoongArch CPU or MIPS-based Loongson + 3A4000 CPU you can enable its onboard serial ports by enabling this + option. The option is applicable to both devicetree and ACPI, say Y + to enable this option. If unsure, say N. =20 config SERIAL_8250_LPC18XX --=20 2.53.0 From nobody Tue Apr 7 07:34:42 2026 Received: from va-2-38.ptr.blmpb.com (va-2-38.ptr.blmpb.com [209.127.231.38]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4E4AC38C40B for ; Sat, 14 Mar 2026 23:41:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.127.231.38 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773531718; cv=none; b=YqEkiveX9WP8w8Qp7JeGrJvN7bRjY46TKSZc8A+kEvVRNRf+1cCjpXonBcTlEwUM9x+R0jtsVQB8i1PNLvjgdcTnXk7b8yGTZAThpyO3hefX2OYdjw/RBMn5oKJS6sl2r06xi93ezRIUFPCHX8XqiW6CnIcYnEHJ3peWzUcaJDA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773531718; c=relaxed/simple; bh=wv6HpXrIlfr6EXsqbV6jc8CuC8VrTOicp6tv1wBw7BY=; h=Date:Mime-Version:In-Reply-To:To:Cc:From:Content-Type:Subject: Message-Id:References; b=Ohf/dft5AKXphmv/vvI4gy2ddRWAYEqhxyDd05qC4qo8SZbtYUJYi7ZjTPCwkVRB0v/GpnKLAMc9O5O4dBvDZwBGrCQX13cm+dPEIfKRj9WEK3kXM12UGys95e1wPSrUudFmlKoXJJu3/jPD9BOLYUHa27c1C95lu49s+Uaqv2Y= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=oss.cipunited.com; spf=pass smtp.mailfrom=oss.cipunited.com; dkim=pass (2048-bit key) header.d=oss.cipunited.com header.i=@oss.cipunited.com header.b=WFCXGrKW; arc=none smtp.client-ip=209.127.231.38 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=oss.cipunited.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.cipunited.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=oss.cipunited.com header.i=@oss.cipunited.com header.b="WFCXGrKW" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; s=feishu2303200042; d=oss.cipunited.com; t=1773531712; h=from:subject:mime-version:from:date:message-id:subject:to:cc: reply-to:content-type:mime-version:in-reply-to:message-id; bh=BZW8ZqsLZjXZI6wPg1zAMlBbDDZ7mr231EF1XozrvFk=; b=WFCXGrKWmmRok8znSvaJPV797atmUDGLEEJlJLw3A0Sdx8EeI0Ljc3rwzNF8gjkK8I98mN pfbPhgNp0sRcnWxP9E7L+TNDko/UQf3j1NwMf3OSmgDqcdnFvCBqcUKo6/s/187uawiR+0 m2bG3aOhYy6OS2Yp36INx13lxdnHry9RU6CkTE8rnVQqSQWlT+9pSzTLrSlBPJPAExHQK+ 1euDrE9Z5z7Yso8w/4R/1PiqiB+QeiHx+SHH43HkuQe+W+tRyMn+blofvbDiqILjUh+Ti9 iDHtxe/awCBPVZFpXc8q/R1ZyvBhCYWD/TiUB3Lvbo33EC/zQC+Sq8W7IT1g+Q== Date: Sun, 15 Mar 2026 07:41:43 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 In-Reply-To: <20260314234143.651298-1-rongrong@oss.cipunited.com> To: "Greg Kroah-Hartman" , "Jiri Slaby" , "Rob Herring" , "Krzysztof Kozlowski" , "Conor Dooley" , "Thomas Bogendoerfer" , "Huacai Chen" , "Jiaxun Yang" Cc: "Rong Zhang" , , , , , "Yao Zi" , "Icenowy Zheng" , "Rong Zhang" X-Lms-Return-Path: X-Mailer: git-send-email 2.53.0 From: "Rong Zhang" Received: from tb ([223.88.91.90]) by smtp.feishu.cn with ESMTPS; Sun, 15 Mar 2026 07:41:49 +0800 Content-Transfer-Encoding: quoted-printable X-Original-From: Rong Zhang Subject: [PATCH 3/3] MIPS: dts: loongson64g-package: Switch to Loongson UART driver Message-Id: <20260314234143.651298-4-rongrong@oss.cipunited.com> References: <20260314234143.651298-1-rongrong@oss.cipunited.com> Content-Type: text/plain; charset="utf-8" Loongson64g is Loongson 3A4000, whose UART controller is compatible with Loongson 2K1500, which is NS16550A-compatible with an additional fractional frequency divisor register. Update the compatible strings to reflect this, so that 3A4000 can benefit from the fractional frequency divisor provided by loongson-uart. This is required on some devices, otherwise their UART can't work at some high baud rates, e.g., 115200. Tested on Loongson-LS3A4000-7A1000-NUC-SE with a 25MHz UART clock. Without fractional frequency divisor, the actual baud rate was 111607 (25MHz / 16 / 14, measured value: 111545) and some USB-to-UART converters couldn't work with it at all. With fractional frequency divisor, the measured baud rate becomes 115207, which is quite accurate. Signed-off-by: Rong Zhang --- arch/mips/boot/dts/loongson/loongson64g-package.dtsi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/mips/boot/dts/loongson/loongson64g-package.dtsi b/arch/mi= ps/boot/dts/loongson/loongson64g-package.dtsi index d4314f62ccc2..029daeedd0ab 100644 --- a/arch/mips/boot/dts/loongson/loongson64g-package.dtsi +++ b/arch/mips/boot/dts/loongson/loongson64g-package.dtsi @@ -40,7 +40,7 @@ liointc: interrupt-controller@3ff01400 { }; =20 cpu_uart0: serial@1fe00100 { - compatible =3D "ns16550a"; + compatible =3D "loongson,ls3a4000-uart", "loongson,ls2k1500-uart", "ns1= 6550a"; reg =3D <0 0x1fe00100 0x10>; clock-frequency =3D <100000000>; interrupt-parent =3D <&liointc>; @@ -50,7 +50,7 @@ cpu_uart0: serial@1fe00100 { =20 cpu_uart1: serial@1fe00110 { status =3D "disabled"; - compatible =3D "ns16550a"; + compatible =3D "loongson,ls3a4000-uart", "loongson,ls2k1500-uart", "ns1= 6550a"; reg =3D <0 0x1fe00110 0x10>; clock-frequency =3D <100000000>; interrupts =3D <15 IRQ_TYPE_LEVEL_HIGH>; --=20 2.53.0