2024-01-18 09:45:43

by Chintan Vankar

[permalink] [raw]
Subject: [PATCH v2 1/5] arm64: dts: ti: k3-j784s4-main: Convert serdes_ln_ctrl node into reg-mux

This removes a dependency on the parent node being a syscon node.
Convert from mmio-mux to reg-mux adjusting node name and properties
as needed.

Signed-off-by: Chintan Vankar <[email protected]>
---
arch/arm64/boot/dts/ti/k3-j784s4-main.dtsi | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/arch/arm64/boot/dts/ti/k3-j784s4-main.dtsi b/arch/arm64/boot/dts/ti/k3-j784s4-main.dtsi
index f2b720ed1e4f..56c8eaad6324 100644
--- a/arch/arm64/boot/dts/ti/k3-j784s4-main.dtsi
+++ b/arch/arm64/boot/dts/ti/k3-j784s4-main.dtsi
@@ -52,12 +52,12 @@ serdes_ln_ctrl: mux-controller@4080 {
compatible = "reg-mux";
reg = <0x00004080 0x30>;
#mux-control-cells = <1>;
- mux-reg-masks = <0x4080 0x3>, <0x4084 0x3>, /* SERDES0 lane0/1 select */
- <0x4088 0x3>, <0x408c 0x3>, /* SERDES0 lane2/3 select */
- <0x4090 0x3>, <0x4094 0x3>, /* SERDES1 lane0/1 select */
- <0x4098 0x3>, <0x409c 0x3>, /* SERDES1 lane2/3 select */
- <0x40a0 0x3>, <0x40a4 0x3>, /* SERDES2 lane0/1 select */
- <0x40a8 0x3>, <0x40ac 0x3>; /* SERDES2 lane2/3 select */
+ mux-reg-masks = <0x0 0x3>, <0x4 0x3>, /* SERDES0 lane0/1 select */
+ <0x8 0x3>, <0xc 0x3>, /* SERDES0 lane2/3 select */
+ <0x10 0x3>, <0x14 0x3>, /* SERDES1 lane0/1 select */
+ <0x18 0x3>, <0x1c 0x3>, /* SERDES1 lane2/3 select */
+ <0x20 0x3>, <0x24 0x3>, /* SERDES2 lane0/1 select */
+ <0x28 0x3>, <0x2c 0x3>; /* SERDES2 lane2/3 select */
idle-states = <J784S4_SERDES0_LANE0_PCIE1_LANE0>,
<J784S4_SERDES0_LANE1_PCIE1_LANE1>,
<J784S4_SERDES0_LANE2_IP3_UNUSED>,
--
2.34.1



2024-01-18 16:18:31

by Andrew Davis

[permalink] [raw]
Subject: Re: [PATCH v2 1/5] arm64: dts: ti: k3-j784s4-main: Convert serdes_ln_ctrl node into reg-mux

On 1/18/24 3:44 AM, Chintan Vankar wrote:
> This removes a dependency on the parent node being a syscon node.
> Convert from mmio-mux to reg-mux adjusting node name and properties
> as needed.
>
> Signed-off-by: Chintan Vankar <[email protected]>
> ---
> arch/arm64/boot/dts/ti/k3-j784s4-main.dtsi | 12 ++++++------
> 1 file changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/arch/arm64/boot/dts/ti/k3-j784s4-main.dtsi b/arch/arm64/boot/dts/ti/k3-j784s4-main.dtsi
> index f2b720ed1e4f..56c8eaad6324 100644
> --- a/arch/arm64/boot/dts/ti/k3-j784s4-main.dtsi
> +++ b/arch/arm64/boot/dts/ti/k3-j784s4-main.dtsi
> @@ -52,12 +52,12 @@ serdes_ln_ctrl: mux-controller@4080 {
> compatible = "reg-mux";

Seems this was already a "reg-mux", so the commit message is a bit
off, you are not converting from "mmio-mux" here.

Thinking about this, if this was already a "reg-mux" then this node
was likely broken by my reg-mux update as it doubles the offset (reg
is offset 0x4080 which adds to the already offset in masks). I did
check for this before sending my patch, but seems this one node
was added after I sent it, but before it was taken. Re-checking
this is the only instance of this issue, and this patch fixes the
issue.

So you should reword the commit message to include that this is
actually a fix and add:

Fixes: 2765149273f4 ("mux: mmio: use reg property when parent device is not a syscon")

looks good to me otherwise:

Acked-by: Andrew Davis <[email protected]>

> reg = <0x00004080 0x30>;
> #mux-control-cells = <1>;
> - mux-reg-masks = <0x4080 0x3>, <0x4084 0x3>, /* SERDES0 lane0/1 select */
> - <0x4088 0x3>, <0x408c 0x3>, /* SERDES0 lane2/3 select */
> - <0x4090 0x3>, <0x4094 0x3>, /* SERDES1 lane0/1 select */
> - <0x4098 0x3>, <0x409c 0x3>, /* SERDES1 lane2/3 select */
> - <0x40a0 0x3>, <0x40a4 0x3>, /* SERDES2 lane0/1 select */
> - <0x40a8 0x3>, <0x40ac 0x3>; /* SERDES2 lane2/3 select */
> + mux-reg-masks = <0x0 0x3>, <0x4 0x3>, /* SERDES0 lane0/1 select */
> + <0x8 0x3>, <0xc 0x3>, /* SERDES0 lane2/3 select */
> + <0x10 0x3>, <0x14 0x3>, /* SERDES1 lane0/1 select */
> + <0x18 0x3>, <0x1c 0x3>, /* SERDES1 lane2/3 select */
> + <0x20 0x3>, <0x24 0x3>, /* SERDES2 lane0/1 select */
> + <0x28 0x3>, <0x2c 0x3>; /* SERDES2 lane2/3 select */
> idle-states = <J784S4_SERDES0_LANE0_PCIE1_LANE0>,
> <J784S4_SERDES0_LANE1_PCIE1_LANE1>,
> <J784S4_SERDES0_LANE2_IP3_UNUSED>,