diff mbox series

[v1,05/20] ARM: dts: imx6qdl: use enet_clk_ref instead of enet_out for the FEC node

Message ID 20230113142718.3038265-6-o.rempel@pengutronix.de (mailing list archive)
State Superseded
Headers show
Series ARM: imx: make Ethernet refclock configurable | expand

Checks

Context Check Description
netdev/tree_selection success Not a local patch

Commit Message

Oleksij Rempel Jan. 13, 2023, 2:27 p.m. UTC
Old imx6q machine code makes RGMII/RMII clock direction decision based on
configuration of "ptp" clock. "enet_out" is not used and make no real
sense, since we can't configure it as output or use it as clock
provider.

Instead of "enet_out" use "enet_clk_ref" which is actual selector to
choose between internal and external clock source:

FEC MAC <---------- enet_clk_ref <--------- SoC PLL
                         \
			  ^------<-> refclock PAD (bi directional)

Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
---
 arch/arm/boot/dts/imx6qdl.dtsi | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Peng Fan (OSS) Jan. 16, 2023, 1:01 a.m. UTC | #1
Hi Oleksij,

On 1/13/2023 10:27 PM, Oleksij Rempel wrote:
> Old imx6q machine code makes RGMII/RMII clock direction decision based on
> configuration of "ptp" clock. "enet_out" is not used and make no real
> sense, since we can't configure it as output or use it as clock
> provider.
> 
> Instead of "enet_out" use "enet_clk_ref" which is actual selector to
> choose between internal and external clock source:
> 
> FEC MAC <---------- enet_clk_ref <--------- SoC PLL
>                           \
> 			  ^------<-> refclock PAD (bi directional)
> 
> Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
> ---
>   arch/arm/boot/dts/imx6qdl.dtsi | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/arm/boot/dts/imx6qdl.dtsi b/arch/arm/boot/dts/imx6qdl.dtsi
> index ff1e0173b39b..71522263031a 100644
> --- a/arch/arm/boot/dts/imx6qdl.dtsi
> +++ b/arch/arm/boot/dts/imx6qdl.dtsi
> @@ -1050,8 +1050,8 @@ fec: ethernet@2188000 {
>   				clocks = <&clks IMX6QDL_CLK_ENET>,
>   					 <&clks IMX6QDL_CLK_ENET>,
>   					 <&clks IMX6QDL_CLK_ENET_REF>,
> -					 <&clks IMX6QDL_CLK_ENET_REF>;
> -				clock-names = "ipg", "ahb", "ptp", "enet_out";
> +					 <&clks IMX6QDL_CLK_ENET_REF_SEL>;
> +				clock-names = "ipg", "ahb", "ptp", "enet_clk_ref";


Please also update fec binding, otherwise there will be dtbs check error.

Thanks,
Peng.

>   				fsl,stop-mode = <&gpr 0x34 27>;
>   				status = "disabled";
>   			};
Oleksij Rempel Jan. 16, 2023, 5:26 a.m. UTC | #2
On Mon, Jan 16, 2023 at 09:01:08AM +0800, Peng Fan wrote:
> Hi Oleksij,
> 
> On 1/13/2023 10:27 PM, Oleksij Rempel wrote:
> > Old imx6q machine code makes RGMII/RMII clock direction decision based on
> > configuration of "ptp" clock. "enet_out" is not used and make no real
> > sense, since we can't configure it as output or use it as clock
> > provider.
> > 
> > Instead of "enet_out" use "enet_clk_ref" which is actual selector to
> > choose between internal and external clock source:
> > 
> > FEC MAC <---------- enet_clk_ref <--------- SoC PLL
> >                           \
> > 			  ^------<-> refclock PAD (bi directional)
> > 
> > Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
> > ---
> >   arch/arm/boot/dts/imx6qdl.dtsi | 4 ++--
> >   1 file changed, 2 insertions(+), 2 deletions(-)
> > 
> > diff --git a/arch/arm/boot/dts/imx6qdl.dtsi b/arch/arm/boot/dts/imx6qdl.dtsi
> > index ff1e0173b39b..71522263031a 100644
> > --- a/arch/arm/boot/dts/imx6qdl.dtsi
> > +++ b/arch/arm/boot/dts/imx6qdl.dtsi
> > @@ -1050,8 +1050,8 @@ fec: ethernet@2188000 {
> >   				clocks = <&clks IMX6QDL_CLK_ENET>,
> >   					 <&clks IMX6QDL_CLK_ENET>,
> >   					 <&clks IMX6QDL_CLK_ENET_REF>,
> > -					 <&clks IMX6QDL_CLK_ENET_REF>;
> > -				clock-names = "ipg", "ahb", "ptp", "enet_out";
> > +					 <&clks IMX6QDL_CLK_ENET_REF_SEL>;
> > +				clock-names = "ipg", "ahb", "ptp", "enet_clk_ref";
> 
> 
> Please also update fec binding, otherwise there will be dtbs check error.

Hm, there is no restriction on enet_clk_ref use or requirements to use
enet_out in Documentation/devicetree/bindings/net/fsl,fec.yaml

Do I missing something?

Regards,
Oleksij
Peng Fan (OSS) Jan. 17, 2023, 1:45 a.m. UTC | #3
On 1/16/2023 1:26 PM, Oleksij Rempel wrote:
> On Mon, Jan 16, 2023 at 09:01:08AM +0800, Peng Fan wrote:
>> Hi Oleksij,
>>
>> On 1/13/2023 10:27 PM, Oleksij Rempel wrote:
>>> Old imx6q machine code makes RGMII/RMII clock direction decision based on
>>> configuration of "ptp" clock. "enet_out" is not used and make no real
>>> sense, since we can't configure it as output or use it as clock
>>> provider.
>>>
>>> Instead of "enet_out" use "enet_clk_ref" which is actual selector to
>>> choose between internal and external clock source:
>>>
>>> FEC MAC <---------- enet_clk_ref <--------- SoC PLL
>>>                            \
>>> 			  ^------<-> refclock PAD (bi directional)
>>>
>>> Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
>>> ---
>>>    arch/arm/boot/dts/imx6qdl.dtsi | 4 ++--
>>>    1 file changed, 2 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/arch/arm/boot/dts/imx6qdl.dtsi b/arch/arm/boot/dts/imx6qdl.dtsi
>>> index ff1e0173b39b..71522263031a 100644
>>> --- a/arch/arm/boot/dts/imx6qdl.dtsi
>>> +++ b/arch/arm/boot/dts/imx6qdl.dtsi
>>> @@ -1050,8 +1050,8 @@ fec: ethernet@2188000 {
>>>    				clocks = <&clks IMX6QDL_CLK_ENET>,
>>>    					 <&clks IMX6QDL_CLK_ENET>,
>>>    					 <&clks IMX6QDL_CLK_ENET_REF>,
>>> -					 <&clks IMX6QDL_CLK_ENET_REF>;
>>> -				clock-names = "ipg", "ahb", "ptp", "enet_out";
>>> +					 <&clks IMX6QDL_CLK_ENET_REF_SEL>;
>>> +				clock-names = "ipg", "ahb", "ptp", "enet_clk_ref";
>>
>>
>> Please also update fec binding, otherwise there will be dtbs check error.
> 
> Hm, there is no restriction on enet_clk_ref use or requirements to use
> enet_out in Documentation/devicetree/bindings/net/fsl,fec.yaml
> 
> Do I missing something?

After check, seems using enet_out would trigger dtbs_check error, using
enet_clk_ref would not as what you did in this patch. So your patch is fine.

   clock-names:
     minItems: 2
     maxItems: 5
     items:
       enum:
         - ipg
         - ahb
         - ptp
         - enet_clk_ref
         - enet_out
         - enet_2x_txclk

Regards,
Peng.


> 
> Regards,
> Oleksij
diff mbox series

Patch

diff --git a/arch/arm/boot/dts/imx6qdl.dtsi b/arch/arm/boot/dts/imx6qdl.dtsi
index ff1e0173b39b..71522263031a 100644
--- a/arch/arm/boot/dts/imx6qdl.dtsi
+++ b/arch/arm/boot/dts/imx6qdl.dtsi
@@ -1050,8 +1050,8 @@  fec: ethernet@2188000 {
 				clocks = <&clks IMX6QDL_CLK_ENET>,
 					 <&clks IMX6QDL_CLK_ENET>,
 					 <&clks IMX6QDL_CLK_ENET_REF>,
-					 <&clks IMX6QDL_CLK_ENET_REF>;
-				clock-names = "ipg", "ahb", "ptp", "enet_out";
+					 <&clks IMX6QDL_CLK_ENET_REF_SEL>;
+				clock-names = "ipg", "ahb", "ptp", "enet_clk_ref";
 				fsl,stop-mode = <&gpr 0x34 27>;
 				status = "disabled";
 			};