From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (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 5E0A331195A; Thu, 11 Sep 2025 11:23:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=140.211.166.183 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757589816; cv=none; b=X2wCCGvOojYd/1VtFCXqVlMZNyGu4oTw7udvYiVPPWpG0/S5gwQyraXibUzTvOYlgpxk+ziiH/B17ZUPTJopnb7+IvfcI0div2KDk7Jd/Ij8N83mX61Bsivxp+MXPBf7tCpZf3xvyiOtiVF0AG6jcLRTVBap8VBLSSu4WIhS0nk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757589816; c=relaxed/simple; bh=4/vJtGmxP8+dE0mnBLXp4BIkBrJoDZG56AJC60ogXtM=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=YeW4VivT4HQLKecYujTyHUV5fmTn7MgKkx5GVRA3tsCAsAkFo64yuQhywx6wUg/8jcj6v/p0H4gB0IvPykLf7UwlBSt3PJ0oZfpuangWkGxbKmHdNRc+SWnQZdvx3yDFFDSr2dtA6iyxomUSImiX5KOBUh26X1l9MlGfZKKFQWw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gentoo.org; spf=pass smtp.mailfrom=gentoo.org; arc=none smtp.client-ip=140.211.166.183 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gentoo.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gentoo.org Received: from localhost (unknown [116.232.18.168]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange secp256r1 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: dlan) by smtp.gentoo.org (Postfix) with ESMTPSA id A94333410A2; Thu, 11 Sep 2025 11:23:09 +0000 (UTC) Date: Thu, 11 Sep 2025 19:22:51 +0800 From: Yixun Lan To: Hendrik Hamerlinck Cc: robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, paul.walmsley@sifive.com, palmer@dabbelt.com, aou@eecs.berkeley.edu, alex@ghiti.fr, skhan@linuxfoundation.org, linux-kernel-mentees@lists.linux.dev, devicetree@vger.kernel.org, linux-riscv@lists.infradead.org, spacemit@lists.linux.dev, linux-kernel@vger.kernel.org Subject: Re: [PATCH] riscv: dts: spacemit: add UART pinctrl combinations Message-ID: <20250911112251-GYA1216475@gentoo.org> References: <20250903145334.425633-1-hendrik.hamerlinck@hammernet.be> Precedence: bulk X-Mailing-List: linux-kernel-mentees@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20250903145334.425633-1-hendrik.hamerlinck@hammernet.be> Hi Hendrik, On 16:53 Wed 03 Sep , Hendrik Hamerlinck wrote: > This adds UART pinctrl configurations based on the SoC datasheet and the > downstream Bianbu Linux tree. The drive strength values were taken from > the downstream implementation, which uses medium drive strength. > > For convenience, the board DTS files have been updated to include all > UART instances with their possible pinmux options in a disabled state. > > Tested this locally on both Orange Pi RV2 and Banana Pi BPI-F3 boards. > > Signed-off-by: Hendrik Hamerlinck > --- > .../boot/dts/spacemit/k1-bananapi-f3.dts | 18 ++ > .../boot/dts/spacemit/k1-orangepi-rv2.dts | 18 ++ > arch/riscv/boot/dts/spacemit/k1-pinctrl.dtsi | 276 +++++++++++++++++- > 3 files changed, 309 insertions(+), 3 deletions(-) > > diff --git a/arch/riscv/boot/dts/spacemit/k1-bananapi-f3.dts b/arch/riscv/boot/dts/spacemit/k1-bananapi-f3.dts > index 6013be258542..661d47d1ce9e 100644 > --- a/arch/riscv/boot/dts/spacemit/k1-bananapi-f3.dts > +++ b/arch/riscv/boot/dts/spacemit/k1-bananapi-f3.dts > @@ -49,3 +49,21 @@ &uart0 { > pinctrl-0 = <&uart0_2_cfg>; > status = "okay"; > }; > + > +&uart5 { > + pinctrl-names = "default"; > + pinctrl-0 = <&uart5_3_cfg>; > + status = "disabled"; > +}; > + > +&uart8 { > + pinctrl-names = "default"; > + pinctrl-0 = <&uart8_2_cfg>; > + status = "disabled"; > +}; > + > +&uart9 { > + pinctrl-names = "default"; > + pinctrl-0 = <&uart9_2_cfg>; > + status = "disabled"; > +}; all of uart5, 8, 9 come from 26-pins port, the functionaly is very likely depending on the final use case.. and I get your idea of adding those nodes but with "disabled" status.. my suggestion is to not add them, or leave to users to add separated dtbo (Device tree overlays) files in the future but I'm ok to complete uart pinctrl info in the dtsi file > diff --git a/arch/riscv/boot/dts/spacemit/k1-orangepi-rv2.dts b/arch/riscv/boot/dts/spacemit/k1-orangepi-rv2.dts > index 337240ebb7b7..dc45b75b1ad4 100644 > --- a/arch/riscv/boot/dts/spacemit/k1-orangepi-rv2.dts > +++ b/arch/riscv/boot/dts/spacemit/k1-orangepi-rv2.dts > @@ -38,3 +38,21 @@ &uart0 { > pinctrl-0 = <&uart0_2_cfg>; > status = "okay"; > }; > + > +&uart5 { > + pinctrl-names = "default"; > + pinctrl-0 = <&uart5_3_cfg>; > + status = "disabled"; > +}; > + > +&uart8 { > + pinctrl-names = "default"; > + pinctrl-0 = <&uart8_2_cfg>; > + status = "disabled"; > +}; > + > +&uart9 { > + pinctrl-names = "default"; > + pinctrl-0 = <&uart9_2_cfg>; > + status = "disabled"; > +}; > diff --git a/arch/riscv/boot/dts/spacemit/k1-pinctrl.dtsi b/arch/riscv/boot/dts/spacemit/k1-pinctrl.dtsi > index 381055737422..43425530b5bf 100644 > --- a/arch/riscv/boot/dts/spacemit/k1-pinctrl.dtsi > +++ b/arch/riscv/boot/dts/spacemit/k1-pinctrl.dtsi > @@ -11,12 +11,282 @@ > #define K1_GPIO(x) (x / 32) (x % 32) > > &pinctrl { > + uart0_0_cfg: uart0-0-cfg { > + uart0-0-pins { > + pinmux = , /* uart0_txd */ > + ; /* uart0_rxd */ > + power-source = <3300>; > + bias-pull-up; > + drive-strength = <19>; > + }; > + }; > + > + uart0_1_cfg: uart0-1-cfg { > + uart0-1-pins { > + pinmux = , /* uart0_txd */ > + ; /* uart0_rxd */ > + power-source = <3300>; > + bias-pull-up; > + drive-strength = <19>; > + }; > + }; > + > uart0_2_cfg: uart0-2-cfg { > uart0-2-pins { > - pinmux = , > - ; > + pinmux = , /* uart0_txd */ > + ; /* uart0_rxd */ > + bias-pull-up; > + drive-strength = <32>; > + }; > + }; > > - bias-pull-up = <0>; > + uart2_0_cfg: uart2-0-cfg { > + uart2-0-pins { > + pinmux = , /* uart2_txd */ > + , /* uart2_rxd */ > + , /* uart2_cts */ > + ; /* uart2_rts */ I think for group has cts, rts pins, it's more practical to have two separated cfgs, so the final application can choose to request two pins (tx, rx), or four pins (tx, tx, cts, rts).. (I believe the hardware should support this) something like this: uart2_0_cfg: uart2-0-cfg { uart2-0-pins { pinmux = , /* uart2_txd */ , /* uart2_rxd */ }; }; uart2_0_cts_rts_cfg: uart2-0-cts-rts-cfg { uart2-0-pins { pinmux = , /* uart2_cts */ , /* uart2_rts */ }; }; &uart2 { pinctrl-names = "default"; pinctrl-0 = <&uart2_0_cfg>, <&uart2_0_cts_rts_cfg>; }; > + bias-pull-up; > + drive-strength = <32>; > + }; > + }; > + > + uart3_0_cfg: uart3-0-cfg { > + uart3-0-pins { > + pinmux = , /* uart3_txd */ > + , /* uart3_rxd */ > + , /* uart3_cts */ > + ; /* uart3_rts */ > + bias-pull-up; > + drive-strength = <32>; > + }; > + }; > + > + uart3_1_cfg: uart3-1-cfg { > + uart3-1-pins { > + pinmux = , /* uart3_txd */ > + , /* uart3_rxd */ > + , /* uart3_cts */ > + ; /* uart3_rts */ > + bias-pull-up; > + drive-strength = <32>; > + }; > + }; > + > + uart3_2_cfg: uart3-2-cfg { > + uart3-2-pins { > + pinmux = , /* uart3_txd */ > + , /* uart3_rxd */ > + , /* uart3_cts */ > + ; /* uart3_rts */ > + bias-pull-up; > + drive-strength = <32>; > + }; > + }; > + > + uart4_0_cfg: uart4-0-cfg { > + uart4-0-pins { > + pinmux = , /* uart4_txd */ > + ; /* uart4_rxd */ > + power-source = <3300>; > + bias-pull-up; > + drive-strength = <19>; > + }; > + }; > + > + uart4_1_cfg: uart4-1-cfg { > + uart4-1-pins { > + pinmux = , /* uart4_cts */ > + , /* uart4_rts */ > + , /* uart4_txd */ > + ; /* uart4_rxd */ > + bias-pull-up; > + drive-strength = <32>; > + }; > + }; > + > + uart4_2_cfg: uart4-2-cfg { > + uart4-2-pins { > + pinmux = , /* uart4_txd */ > + ; /* uart4_rxd */ > + bias-pull-up; > + drive-strength = <32>; > + }; > + }; > + > + uart4_3_cfg: uart4-3-cfg { > + uart4-3-pins { > + pinmux = , /* uart4_txd */ > + , /* uart4_rxd */ > + , /* uart4_cts */ > + ; /* uart4_rts */ > + bias-pull-up; > + drive-strength = <32>; > + }; > + }; > + > + uart4_4_cfg: uart4-4-cfg { > + uart4-4-pins { > + pinmux = , /* uart4_txd */ > + , /* uart4_rxd */ > + , /* uart4_cts */ > + ; /* uart4_rts */ > + bias-pull-up; > + drive-strength = <32>; > + }; > + }; > + > + uart5_0_cfg: uart5-0-cfg { > + uart5-0-pins { > + pinmux = , /* uart5_txd */ > + ; /* uart5_rxd */ > + power-source = <3300>; > + bias-pull-up; > + drive-strength = <19>; > + }; > + }; > + > + uart5_1_cfg: uart5-1-cfg { > + uart5-1-pins { > + pinmux = , /* uart5_txd */ > + , /* uart5_rxd */ > + , /* uart5_cts */ > + ; /* uart5_rts */ > + bias-pull-up; > + drive-strength = <32>; > + }; > + }; > + > + uart5_2_cfg: uart5-2-cfg { > + uart5-2-pins { > + pinmux = , /* uart5_txd */ > + , /* uart5_rxd */ > + , /* uart5_cts */ > + ; /* uart5_rts */ > + bias-pull-up; > + drive-strength = <32>; > + }; > + }; > + > + uart5_3_cfg: uart5-3-cfg { > + uart5-3-pins { > + pinmux = , /* uart5_txd */ > + , /* uart5_rxd */ > + , /* uart5_cts */ > + ; /* uart5_rts */ > + bias-pull-up; > + drive-strength = <32>; > + }; > + }; > + > + uart6_0_cfg: uart6-0-cfg { > + uart6-0-pins { > + pinmux = , /* uart6_cts */ > + , /* uart6_txd */ > + , /* uart6_rxd */ > + ; /* uart6_rts */ > + bias-pull-up; > + drive-strength = <32>; > + }; > + }; > + > + uart6_1_cfg: uart6-1-cfg { > + uart6-1-pins { > + pinmux = , /* uart6_txd */ > + , /* uart6_rxd */ > + , /* uart6_cts */ > + ; /* uart6_rts */ > + bias-pull-up; > + drive-strength = <32>; > + }; > + }; > + > + uart6_2_cfg: uart6-2-cfg { > + uart6-2-pins { > + pinmux = , /* uart6_txd */ > + ; /* uart6_rxd */ > + bias-pull-up; > + drive-strength = <32>; > + }; > + }; > + > + uart7_0_cfg: uart7-0-cfg { > + uart7-0-pins { > + pinmux = , /* uart7_txd */ > + ; /* uart7_rxd */ > + bias-pull-up; > + drive-strength = <32>; > + }; > + }; > + > + uart7_1_cfg: uart7-1-cfg { > + uart7-1-pins { > + pinmux = , /* uart7_txd */ > + , /* uart7_rxd */ > + , /* uart7_cts */ > + ; /* uart7_rts */ > + bias-pull-up; > + drive-strength = <32>; > + }; > + }; > + > + uart8_0_cfg: uart8-0-cfg { > + uart8-0-pins { > + pinmux = , /* uart8_txd */ > + ; /* uart8_rxd */ > + bias-pull-up; > + drive-strength = <32>; > + }; > + }; > + > + uart8_1_cfg: uart8-1-cfg { > + uart8-1-pins { > + pinmux = , /* uart8_txd */ > + , /* uart8_rxd */ > + , /* uart8_cts */ > + ; /* uart8_rts */ > + bias-pull-up; > + drive-strength = <32>; > + }; > + }; > + > + uart8_2_cfg: uart8-2-cfg { > + uart8-2-pins { > + pinmux = , /* uart8_txd */ > + , /* uart8_rxd */ > + , /* uart8_cts */ > + ; /* uart8_rts */ > + power-source = <3300>; > + bias-pull-up; > + drive-strength = <19>; > + }; > + }; > + > + uart9_0_cfg: uart9-0-cfg { > + uart9-0-pins { > + pinmux = , /* uart9_txd */ > + ; /* uart9_rxd */ > + bias-pull-up; > + drive-strength = <32>; > + }; > + }; > + > + uart9_1_cfg: uart9-1-cfg { > + uart9-1-pins { > + pinmux = , /* uart9_cts */ > + , /* uart9_rts */ > + , /* uart9_txd */ > + ; /* uart9_rxd */ > + bias-pull-up; > + drive-strength = <32>; > + }; > + }; > + > + uart9_2_cfg: uart9-2-cfg { > + uart9-2-pins { > + pinmux = , /* uart9_txd */ > + ; /* uart9_rxd */ > + bias-pull-up; > drive-strength = <32>; > }; > }; > -- > 2.43.0 > -- Yixun Lan (dlan)