[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20250811163749.47028-5-ziyao@disroot.org>
Date: Mon, 11 Aug 2025 16:37:50 +0000
From: Yao Zi <ziyao@...root.org>
To: Linus Walleij <linus.walleij@...aro.org>,
Rob Herring <robh@...nel.org>,
Krzysztof Kozlowski <krzk+dt@...nel.org>,
Conor Dooley <conor+dt@...nel.org>,
Huacai Chen <chenhuacai@...nel.org>,
WANG Xuerui <kernel@...0n.name>
Cc: linux-gpio@...r.kernel.org,
devicetree@...r.kernel.org,
linux-kernel@...r.kernel.org,
loongarch@...ts.linux.dev,
Mingcong Bai <jeffbai@...c.io>,
Kexy Biscuit <kexybiscuit@...c.io>,
Yao Zi <ziyao@...root.org>
Subject: [PATCH 3/3] LoongArch: dts: Add pinctrl configuration for Loongson 2K0300
Describe the pin controller for Loongson 2K0300 SoC. As default settings
for the existing UARTs, pinctrls are added and multiplexed to pins taken
corresponding UART as main functionaility.
Signed-off-by: Yao Zi <ziyao@...root.org>
---
arch/loongarch/boot/dts/loongson-2k0300.dtsi | 39 ++++++++++++++++++++
1 file changed, 39 insertions(+)
diff --git a/arch/loongarch/boot/dts/loongson-2k0300.dtsi b/arch/loongarch/boot/dts/loongson-2k0300.dtsi
index d909a4eca312..a8ad8bd43f5d 100644
--- a/arch/loongarch/boot/dts/loongson-2k0300.dtsi
+++ b/arch/loongarch/boot/dts/loongson-2k0300.dtsi
@@ -9,6 +9,8 @@
#include <dt-bindings/clock/loongson,ls2k0300-clk.h>
#include <dt-bindings/interrupt-controller/irq.h>
+#define PINMUX(pin, func) (((pin) << 8) | func)
+
/ {
compatible = "loongson,ls2k0300";
#address-cells = <2>;
@@ -55,6 +57,35 @@ clk: clock-controller@...00400 {
#clock-cells = <1>;
};
+ pinctrl: pinctrl@...00490 {
+ compatible = "loongson,ls2k0300-pinctrl";
+ reg = <0x0 0x16000490 0x0 0x20>,
+ <0x0 0x16000110 0x0 0x4>;
+ reg-names = "mux", "drive";
+
+ func-uart {
+ uart0_pins: uart0-pins {
+ pinmux = <PINMUX(40, 0x3)>,
+ <PINMUX(41, 0x3)>;
+ };
+
+ uart1_pins: uart1-pins {
+ pinmux = <PINMUX(42, 0x3)>,
+ <PINMUX(43, 0x3)>;
+ };
+
+ uart2_pins: uart2-pins {
+ pinmux = <PINMUX(44, 0x3)>,
+ <PINMUX(45, 0x3)>;
+ };
+
+ uart3_pins: uart3-pins {
+ pinmux = <PINMUX(46, 0x3)>,
+ <PINMUX(47, 0x3)>;
+ };
+ };
+ };
+
liointc0: interrupt-controller@...01400 {
compatible = "loongson,liointc-2.0";
reg = <0x0 0x16001400 0x0 0x40>,
@@ -100,6 +131,8 @@ uart0: serial@...00000 {
interrupt-parent = <&liointc0>;
interrupts = <0 IRQ_TYPE_LEVEL_HIGH>;
no-loopback-test;
+ pinctrl-names = "default";
+ pinctrl-0 = <&uart0_pins>;
status = "disabled";
};
@@ -109,6 +142,8 @@ uart1: serial@...00400 {
interrupt-parent = <&liointc0>;
interrupts = <1 IRQ_TYPE_LEVEL_HIGH>;
no-loopback-test;
+ pinctrl-names = "default";
+ pinctrl-0 = <&uart1_pins>;
status = "disabled";
};
@@ -118,6 +153,8 @@ uart2: serial@...00800 {
interrupt-parent = <&liointc0>;
interrupts = <2 IRQ_TYPE_LEVEL_HIGH>;
no-loopback-test;
+ pinctrl-names = "default";
+ pinctrl-0 = <&uart2_pins>;
status = "disabled";
};
@@ -127,6 +164,8 @@ uart3: serial@...00c00 {
interrupt-parent = <&liointc0>;
interrupts = <2 IRQ_TYPE_LEVEL_HIGH>;
no-loopback-test;
+ pinctrl-names = "default";
+ pinctrl-0 = <&uart3_pins>;
status = "disabled";
};
--
2.50.1
Powered by blists - more mailing lists