[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <F213A85E78015F1A+aMpnVc9S_ynYGDF8@LT-Guozexi>
Date: Wed, 17 Sep 2025 15:46:29 +0800
From: Troy Mitchell <troy.mitchell@...ux.spacemit.com>
To: Hendrik Hamerlinck <hendrik.hamerlinck@...mernet.be>, dlan@...too.org,
robh@...nel.org, krzk+dt@...nel.org, conor+dt@...nel.org,
paul.walmsley@...ive.com, palmer@...belt.com, aou@...s.berkeley.edu,
alex@...ti.fr
Cc: skhan@...uxfoundation.org, linux-kernel-mentees@...ts.linux.dev,
devicetree@...r.kernel.org, linux-riscv@...ts.infradead.org,
spacemit@...ts.linux.dev, linux-kernel@...r.kernel.org,
Troy Mitchell <troy.mitchell@...ux.spacemit.com>
Subject: Re: [PATCH v4] riscv: dts: spacemit: add UART pinctrl combinations
Hi Hendrik, Thanks for your patch!
On Wed, Sep 17, 2025 at 08:59:07AM +0200, Hendrik Hamerlinck wrote:
> Add 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.
> CTS/RTS are moved to separate *-cts-rts-cfg states so boards can enable
> hardware flow control conditionally.
>
> Signed-off-by: Hendrik Hamerlinck <hendrik.hamerlinck@...mernet.be>
> Reviewed-by: Yixun Lan <dlan@...too.org>
> ---
> Changes in v4:
> - Explicitly use 0 as bias-pull-up value
>
> Changes in v3:
> - Added /omit-if-no-ref/ to pinctrl states to reduce DT size
>
> Changes in v2:
> - Split cts/rts into separate pinctrl configs as suggested
> - Removed options from board DTS files to keep them cleaner
> ---
> arch/riscv/boot/dts/spacemit/k1-pinctrl.dtsi | 430 ++++++++++++++++++-
> 1 file changed, 428 insertions(+), 2 deletions(-)
>
> diff --git a/arch/riscv/boot/dts/spacemit/k1-pinctrl.dtsi b/arch/riscv/boot/dts/spacemit/k1-pinctrl.dtsi
> + /omit-if-no-ref/
> + uart2_0_cts_rts_cfg: uart2-0-cts-rts-cfg {
> + uart2-0-pins {
> + pinmux = <K1_PADCONF(23, 1)>, /* uart2_cts */
> + <K1_PADCONF(24, 1)>; /* uart2_rts */
> + bias-pull-up = <0>;
> + drive-strength = <32>;
> + };
> + };
We are currently using the 8250 UART driver, but hardware flow control does not
work properly on K1. We are considering fixing this when time permits.
Should we add a comment here to avoid confusing others who may run into this?
If so, I will remove the comment once the issue has been fixed.
Anyway,
Reviewed-by: Troy Mitchell <troy.mitchell@...ux.spacemit.com>
> +
> + /omit-if-no-ref/
> + uart3_0_cfg: uart3-0-cfg {
> + uart3-0-pins {
> + pinmux = <K1_PADCONF(81, 2)>, /* uart3_txd */
> + <K1_PADCONF(82, 2)>; /* uart3_rxd */
> + bias-pull-up = <0>;
> + drive-strength = <32>;
> + };
> + };
> +
> + /omit-if-no-ref/
> + uart3_0_cts_rts_cfg: uart3-0-cts-rts-cfg {
> + uart3-0-pins {
> + pinmux = <K1_PADCONF(83, 2)>, /* uart3_cts */
> + <K1_PADCONF(84, 2)>; /* uart3_rts */
> + bias-pull-up = <0>;
> + drive-strength = <32>;
> + };
> + };
> +
> + /omit-if-no-ref/
> + uart3_1_cfg: uart3-1-cfg {
> + uart3-1-pins {
> + pinmux = <K1_PADCONF(18, 2)>, /* uart3_txd */
> + <K1_PADCONF(19, 2)>; /* uart3_rxd */
> + bias-pull-up = <0>;
> + drive-strength = <32>;
> + };
> + };
> +
> + /omit-if-no-ref/
> + uart3_1_cts_rts_cfg: uart3-1-cts-rts-cfg {
> + uart3-1-pins {
> + pinmux = <K1_PADCONF(20, 2)>, /* uart3_cts */
> + <K1_PADCONF(21, 2)>; /* uart3_rts */
> + bias-pull-up = <0>;
> + drive-strength = <32>;
> + };
> + };
> +
> + /omit-if-no-ref/
> + uart3_2_cfg: uart3-2-cfg {
> + uart3-2-pins {
> + pinmux = <K1_PADCONF(53, 4)>, /* uart3_txd */
> + <K1_PADCONF(54, 4)>; /* uart3_rxd */
> + bias-pull-up = <0>;
> + drive-strength = <32>;
> + };
> + };
> +
> + /omit-if-no-ref/
> + uart3_2_cts_rts_cfg: uart3-2-cts-rts-cfg {
> + uart3-2-pins {
> + pinmux = <K1_PADCONF(55, 4)>, /* uart3_cts */
> + <K1_PADCONF(56, 4)>; /* uart3_rts */
> + bias-pull-up = <0>;
> + drive-strength = <32>;
> + };
> + };
> +
> + /omit-if-no-ref/
> + uart4_0_cfg: uart4-0-cfg {
> + uart4-0-pins {
> + pinmux = <K1_PADCONF(100, 4)>, /* uart4_txd */
> + <K1_PADCONF(101, 4)>; /* uart4_rxd */
> + power-source = <3300>;
> + bias-pull-up = <0>;
> + drive-strength = <19>;
> + };
> + };
> +
> + /omit-if-no-ref/
> + uart4_1_cfg: uart4-1-cfg {
> + uart4-1-pins {
> + pinmux = <K1_PADCONF(83, 3)>, /* uart4_txd */
> + <K1_PADCONF(84, 3)>; /* uart4_rxd */
> + bias-pull-up = <0>;
> + drive-strength = <32>;
> + };
> + };
> +
> + /omit-if-no-ref/
> + uart4_1_cts_rts_cfg: uart4-1-cts-rts-cfg {
> + uart4-1-pins {
> + pinmux = <K1_PADCONF(81, 3)>, /* uart4_cts */
> + <K1_PADCONF(82, 3)>; /* uart4_rts */
> + bias-pull-up = <0>;
> + drive-strength = <32>;
> + };
> + };
> +
> + /omit-if-no-ref/
> + uart4_2_cfg: uart4-2-cfg {
> + uart4-2-pins {
> + pinmux = <K1_PADCONF(23, 2)>, /* uart4_txd */
> + <K1_PADCONF(24, 2)>; /* uart4_rxd */
> + bias-pull-up = <0>;
> + drive-strength = <32>;
> + };
> + };
> +
> + /omit-if-no-ref/
> + uart4_3_cfg: uart4-3-cfg {
> + uart4-3-pins {
> + pinmux = <K1_PADCONF(33, 2)>, /* uart4_txd */
> + <K1_PADCONF(34, 2)>; /* uart4_rxd */
> + bias-pull-up = <0>;
> + drive-strength = <32>;
> + };
> + };
> +
> + /omit-if-no-ref/
> + uart4_3_cts_rts_cfg: uart4-3-cts-rts-cfg {
> + uart4-3-pins {
> + pinmux = <K1_PADCONF(35, 2)>, /* uart4_cts */
> + <K1_PADCONF(36, 2)>; /* uart4_rts */
> + bias-pull-up = <0>;
> + drive-strength = <32>;
> + };
> + };
> +
> + /omit-if-no-ref/
> + uart4_4_cfg: uart4-4-cfg {
> + uart4-4-pins {
> + pinmux = <K1_PADCONF(111, 4)>, /* uart4_txd */
> + <K1_PADCONF(112, 4)>; /* uart4_rxd */
> + bias-pull-up = <0>;
> + drive-strength = <32>;
> + };
> + };
> +
> + /omit-if-no-ref/
> + uart4_4_cts_rts_cfg: uart4-4-cts-rts-cfg {
> + uart4-4-pins {
> + pinmux = <K1_PADCONF(113, 4)>, /* uart4_cts */
> + <K1_PADCONF(114, 4)>; /* uart4_rts */
> + bias-pull-up = <0>;
> + drive-strength = <32>;
> + };
> + };
> +
> + /omit-if-no-ref/
> + uart5_0_cfg: uart5-0-cfg {
> + uart5-0-pins {
> + pinmux = <K1_PADCONF(102, 3)>, /* uart5_txd */
> + <K1_PADCONF(103, 3)>; /* uart5_rxd */
> + power-source = <3300>;
> + bias-pull-up = <0>;
> + drive-strength = <19>;
> + };
> + };
> +
> + /omit-if-no-ref/
> + uart5_1_cfg: uart5-1-cfg {
> + uart5-1-pins {
> + pinmux = <K1_PADCONF(25, 2)>, /* uart5_txd */
> + <K1_PADCONF(26, 2)>; /* uart5_rxd */
> + bias-pull-up = <0>;
> + drive-strength = <32>;
> + };
> + };
> +
> + /omit-if-no-ref/
> + uart5_1_cts_rts_cfg: uart5-1-cts-rts-cfg {
> + uart5-1-pins {
> + pinmux = <K1_PADCONF(27, 2)>, /* uart5_cts */
> + <K1_PADCONF(28, 2)>; /* uart5_rts */
> + bias-pull-up = <0>;
> + drive-strength = <32>;
> + };
> + };
> +
> + /omit-if-no-ref/
> + uart5_2_cfg: uart5-2-cfg {
> + uart5-2-pins {
> + pinmux = <K1_PADCONF(42, 2)>, /* uart5_txd */
> + <K1_PADCONF(43, 2)>; /* uart5_rxd */
> + bias-pull-up = <0>;
> + drive-strength = <32>;
> + };
> + };
> +
> + /omit-if-no-ref/
> + uart5_2_cts_rts_cfg: uart5-2-cts-rts-cfg {
> + uart5-2-pins {
> + pinmux = <K1_PADCONF(44, 2)>, /* uart5_cts */
> + <K1_PADCONF(45, 2)>; /* uart5_rts */
> + bias-pull-up = <0>;
> + drive-strength = <32>;
> + };
> + };
> +
> + /omit-if-no-ref/
> + uart5_3_cfg: uart5-3-cfg {
> + uart5-3-pins {
> + pinmux = <K1_PADCONF(70, 4)>, /* uart5_txd */
> + <K1_PADCONF(71, 4)>; /* uart5_rxd */
> + bias-pull-up = <0>;
> + drive-strength = <32>;
> + };
> + };
> +
> + /omit-if-no-ref/
> + uart5_3_cts_rts_cfg: uart5-3-cts-rts-cfg {
> + uart5-3-pins {
> + pinmux = <K1_PADCONF(72, 4)>, /* uart5_cts */
> + <K1_PADCONF(73, 4)>; /* uart5_rts */
> + bias-pull-up = <0>;
> + drive-strength = <32>;
> + };
> + };
> +
> + /omit-if-no-ref/
> + uart6_0_cfg: uart6-0-cfg {
> + uart6-0-pins {
> + pinmux = <K1_PADCONF(86, 2)>, /* uart6_txd */
> + <K1_PADCONF(87, 2)>; /* uart6_rxd */
> + bias-pull-up = <0>;
> + drive-strength = <32>;
> + };
> + };
> +
> + /omit-if-no-ref/
> + uart6_0_cts_rts_cfg: uart6-0-cts-rts-cfg {
> + uart6-0-pins {
> + pinmux = <K1_PADCONF(85, 2)>, /* uart6_cts */
> + <K1_PADCONF(90, 2)>; /* uart6_rts */
> + bias-pull-up = <0>;
> + drive-strength = <32>;
> + };
> + };
> +
> + /omit-if-no-ref/
> + uart6_1_cfg: uart6-1-cfg {
> + uart6-1-pins {
> + pinmux = <K1_PADCONF(0, 2)>, /* uart6_txd */
> + <K1_PADCONF(1, 2)>; /* uart6_rxd */
> + bias-pull-up = <0>;
> + drive-strength = <32>;
> + };
> + };
> +
> + /omit-if-no-ref/
> + uart6_1_cts_rts_cfg: uart6-1-cts-rts-cfg {
> + uart6-1-pins {
> + pinmux = <K1_PADCONF(2, 2)>, /* uart6_cts */
> + <K1_PADCONF(3, 2)>; /* uart6_rts */
> + bias-pull-up = <0>;
> + drive-strength = <32>;
> + };
> + };
> +
> + /omit-if-no-ref/
> + uart6_2_cfg: uart6-2-cfg {
> + uart6-2-pins {
> + pinmux = <K1_PADCONF(56, 2)>, /* uart6_txd */
> + <K1_PADCONF(57, 2)>; /* uart6_rxd */
> + bias-pull-up = <0>;
> + drive-strength = <32>;
> + };
> + };
> +
> + /omit-if-no-ref/
> + uart7_0_cfg: uart7-0-cfg {
> + uart7-0-pins {
> + pinmux = <K1_PADCONF(88, 2)>, /* uart7_txd */
> + <K1_PADCONF(89, 2)>; /* uart7_rxd */
> + bias-pull-up = <0>;
> + drive-strength = <32>;
> + };
> + };
> +
> + /omit-if-no-ref/
> + uart7_1_cfg: uart7-1-cfg {
> + uart7-1-pins {
> + pinmux = <K1_PADCONF(4, 2)>, /* uart7_txd */
> + <K1_PADCONF(5, 2)>; /* uart7_rxd */
> + bias-pull-up = <0>;
> + drive-strength = <32>;
> + };
> + };
> +
> + /omit-if-no-ref/
> + uart7_1_cts_rts_cfg: uart7-1-cts-rts-cfg {
> + uart7-1-pins {
> + pinmux = <K1_PADCONF(6, 2)>, /* uart7_cts */
> + <K1_PADCONF(7, 2)>; /* uart7_rts */
> + bias-pull-up = <0>;
> + drive-strength = <32>;
> + };
> + };
> +
> + /omit-if-no-ref/
> + uart8_0_cfg: uart8-0-cfg {
> + uart8-0-pins {
> + pinmux = <K1_PADCONF(82, 4)>, /* uart8_txd */
> + <K1_PADCONF(83, 4)>; /* uart8_rxd */
> + bias-pull-up = <0>;
> + drive-strength = <32>;
> + };
> + };
> +
> + /omit-if-no-ref/
> + uart8_1_cfg: uart8-1-cfg {
> + uart8-1-pins {
> + pinmux = <K1_PADCONF(8, 2)>, /* uart8_txd */
> + <K1_PADCONF(9, 2)>; /* uart8_rxd */
> + bias-pull-up = <0>;
> + drive-strength = <32>;
> + };
> + };
> +
> + /omit-if-no-ref/
> + uart8_1_cts_rts_cfg: uart8-1-cts-rts-cfg {
> + uart8-1-pins {
> + pinmux = <K1_PADCONF(10, 2)>, /* uart8_cts */
> + <K1_PADCONF(11, 2)>; /* uart8_rts */
> + bias-pull-up = <0>;
> + drive-strength = <32>;
> + };
> + };
> +
> + /omit-if-no-ref/
> + uart8_2_cfg: uart8-2-cfg {
> + uart8-2-pins {
> + pinmux = <K1_PADCONF(75, 4)>, /* uart8_txd */
> + <K1_PADCONF(76, 4)>; /* uart8_rxd */
> + power-source = <3300>;
> + bias-pull-up = <0>;
> + drive-strength = <19>;
> + };
> + };
> +
> + /omit-if-no-ref/
> + uart8_2_cts_rts_cfg: uart8-2-cts-rts-cfg {
> + uart8-2-pins {
> + pinmux = <K1_PADCONF(77, 4)>, /* uart8_cts */
> + <K1_PADCONF(78, 4)>; /* uart8_rts */
> + power-source = <3300>;
> + bias-pull-up = <0>;
> + drive-strength = <19>;
> + };
> + };
> +
> + /omit-if-no-ref/
> + uart9_0_cfg: uart9-0-cfg {
> + uart9-0-pins {
> + pinmux = <K1_PADCONF(12, 2)>, /* uart9_txd */
> + <K1_PADCONF(13, 2)>; /* uart9_rxd */
> + bias-pull-up = <0>;
> + drive-strength = <32>;
> + };
> + };
> +
> + /omit-if-no-ref/
> + uart9_1_cfg: uart9-1-cfg {
> + uart9-1-pins {
> + pinmux = <K1_PADCONF(116, 3)>, /* uart9_txd */
> + <K1_PADCONF(117, 3)>; /* uart9_rxd */
> + bias-pull-up = <0>;
> + drive-strength = <32>;
> + };
> + };
> +
> + /omit-if-no-ref/
> + uart9_1_cts_rts_cfg: uart9-1-cts-rts-cfg {
> + uart9-1-pins {
> + pinmux = <K1_PADCONF(110, 3)>, /* uart9_cts */
> + <K1_PADCONF(115, 3)>; /* uart9_rts */
> + bias-pull-up = <0>;
> + drive-strength = <32>;
> + };
> + };
>
> + /omit-if-no-ref/
> + uart9_2_cfg: uart9-2-cfg {
> + uart9-2-pins {
> + pinmux = <K1_PADCONF(72, 2)>, /* uart9_txd */
> + <K1_PADCONF(73, 2)>; /* uart9_rxd */
> bias-pull-up = <0>;
> drive-strength = <32>;
> };
> --
> 2.43.0
>
>
> _______________________________________________
> linux-riscv mailing list
> linux-riscv@...ts.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-riscv
Powered by blists - more mailing lists