diff mbox series

[net-next,2/2] dt-bindings: add mdio frequency description

Message ID 20221020094106.559266-3-andy.chiu@sifive.com (mailing list archive)
State New, archived
Headers show
Series net:axienet: Add a DT property to configure frequency of the MDIO bus | expand

Commit Message

Andy Chiu Oct. 20, 2022, 9:41 a.m. UTC
Add a property to set mdio bus frequency at runtime by DT.

Signed-off-by: Andy Chiu <andy.chiu@sifive.com>
Reviewed-by: Greentime Hu <greentime.hu@sifive.com>
---
 Documentation/devicetree/bindings/net/xilinx_axienet.txt | 3 +++
 1 file changed, 3 insertions(+)

Comments

Michal Simek Oct. 20, 2022, 10:39 a.m. UTC | #1
On 10/20/22 11:41, Andy Chiu wrote:
> CAUTION: This message has originated from an External Source. Please use proper judgment and caution when opening attachments, clicking links, or responding to this email.
> 
> 
> Add a property to set mdio bus frequency at runtime by DT.
> 
> Signed-off-by: Andy Chiu <andy.chiu@sifive.com>
> Reviewed-by: Greentime Hu <greentime.hu@sifive.com>
> ---
>   Documentation/devicetree/bindings/net/xilinx_axienet.txt | 3 +++
>   1 file changed, 3 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/net/xilinx_axienet.txt b/Documentation/devicetree/bindings/net/xilinx_axienet.txt
> index 1aa4c6006cd0..d78cf402aa2a 100644
> --- a/Documentation/devicetree/bindings/net/xilinx_axienet.txt
> +++ b/Documentation/devicetree/bindings/net/xilinx_axienet.txt
> @@ -43,6 +43,9 @@ Optional properties:
>                    support both 1000BaseX and SGMII modes. If set, the phy-mode
>                    should be set to match the mode selected on core reset (i.e.
>                    by the basex_or_sgmii core input line).
> +- xlnx,mdio-freq: Define the clock frequency of the MDIO bus. If the property
> +                 does not pressent on the DT, then the mdio driver would use
> +                 the default 2.5 MHz clock, as mentioned on 802.3 spc.

Isn't it better to specify it based on ccf description. It means &clk and used 
clock framework to find value?

Thanks,
Michal
Rob Herring (Arm) Oct. 21, 2022, 2:20 a.m. UTC | #2
On Thu, Oct 20, 2022 at 12:39:46PM +0200, Michal Simek wrote:
> 
> 
> On 10/20/22 11:41, Andy Chiu wrote:
> > CAUTION: This message has originated from an External Source. Please use proper judgment and caution when opening attachments, clicking links, or responding to this email.
> > 
> > 
> > Add a property to set mdio bus frequency at runtime by DT.
> > 
> > Signed-off-by: Andy Chiu <andy.chiu@sifive.com>
> > Reviewed-by: Greentime Hu <greentime.hu@sifive.com>
> > ---
> >   Documentation/devicetree/bindings/net/xilinx_axienet.txt | 3 +++
> >   1 file changed, 3 insertions(+)
> > 
> > diff --git a/Documentation/devicetree/bindings/net/xilinx_axienet.txt b/Documentation/devicetree/bindings/net/xilinx_axienet.txt
> > index 1aa4c6006cd0..d78cf402aa2a 100644
> > --- a/Documentation/devicetree/bindings/net/xilinx_axienet.txt
> > +++ b/Documentation/devicetree/bindings/net/xilinx_axienet.txt
> > @@ -43,6 +43,9 @@ Optional properties:
> >                    support both 1000BaseX and SGMII modes. If set, the phy-mode
> >                    should be set to match the mode selected on core reset (i.e.
> >                    by the basex_or_sgmii core input line).
> > +- xlnx,mdio-freq: Define the clock frequency of the MDIO bus. If the property
> > +                 does not pressent on the DT, then the mdio driver would use
> > +                 the default 2.5 MHz clock, as mentioned on 802.3 spc.
> 
> Isn't it better to specify it based on ccf description. It means &clk and
> used clock framework to find value?

Or use 'bus-frequency' which IIRC is defined for MDIO.

Rob
Andy Chiu Oct. 23, 2022, 3:04 p.m. UTC | #3
> > > +- xlnx,mdio-freq: Define the clock frequency of the MDIO bus. If the property
> > > +                 does not pressent on the DT, then the mdio driver would use
> > > +                 the default 2.5 MHz clock, as mentioned on 802.3 spc.
> >
> > Isn't it better to specify it based on ccf description. It means &clk and
> > used clock framework to find value?
>
Maybe I missed something, but I'd prefer using a number to define the
frequency of the bus rather than basing on the ccf description for our
use case. First, it is more straightforward because ccf requires us to
define a separate DT node and point to it. And currently we don't need
to do extra management that would benefit from using ccf. All we need
to do with the clock is to get its frequency.

> Or use 'bus-frequency' which IIRC is defined for MDIO.
>
I found that "bus-frequency" first appeared in fsl driver but was
replaced later by the standard one, which is "clock-frequency" as
defined in mdio.yaml. We will submit a v2 patch to configure
non-convention MDIO bus frequency with that DT entry.

Thanks and regards,
Andy
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/net/xilinx_axienet.txt b/Documentation/devicetree/bindings/net/xilinx_axienet.txt
index 1aa4c6006cd0..d78cf402aa2a 100644
--- a/Documentation/devicetree/bindings/net/xilinx_axienet.txt
+++ b/Documentation/devicetree/bindings/net/xilinx_axienet.txt
@@ -43,6 +43,9 @@  Optional properties:
 		  support both 1000BaseX and SGMII modes. If set, the phy-mode
 		  should be set to match the mode selected on core reset (i.e.
 		  by the basex_or_sgmii core input line).
+- xlnx,mdio-freq: Define the clock frequency of the MDIO bus. If the property
+		  does not pressent on the DT, then the mdio driver would use
+		  the default 2.5 MHz clock, as mentioned on 802.3 spc.
 - clock-names: 	  Tuple listing input clock names. Possible clocks:
 		  s_axi_lite_clk: Clock for AXI register slave interface
 		  axis_clk: AXI4-Stream clock for TXD RXD TXC and RXS interfaces