diff mbox series

[net-next,v2,2/3] Documentation: ACPI: DSD: Document MDIO PHY

Message ID 20200701061233.31120-3-calvin.johnson@oss.nxp.com
State Changes Requested
Delegated to: David Miller
Headers show
Series [net-next,v2,1/3] net: phy: introduce find_phy_device() | expand

Commit Message

Calvin Johnson July 1, 2020, 6:12 a.m. UTC
Introduce ACPI mechanism to get PHYs registered on a MDIO bus and
provide them to be connected to MAC.

An ACPI node property "mdio-handle" is introduced to reference the
MDIO bus on which PHYs are registered with autoprobing method used
by mdiobus_register().

Signed-off-by: Calvin Johnson <calvin.johnson@oss.nxp.com>
---

Changes in v2: None

 Documentation/firmware-guide/acpi/dsd/phy.rst | 40 +++++++++++++++++++
 1 file changed, 40 insertions(+)
 create mode 100644 Documentation/firmware-guide/acpi/dsd/phy.rst

Comments

Andy Shevchenko July 1, 2020, 10:27 a.m. UTC | #1
On Wed, Jul 1, 2020 at 9:13 AM Calvin Johnson
<calvin.johnson@oss.nxp.com> wrote:
>
> Introduce ACPI mechanism to get PHYs registered on a MDIO bus and
> provide them to be connected to MAC.
>
> An ACPI node property "mdio-handle" is introduced to reference the
> MDIO bus on which PHYs are registered with autoprobing method used
> by mdiobus_register().

...

> +                    Package (2) {"mdio-handle", Package (){\_SB.MDI0}}

Reference as a package? Hmm... Is it really possible to have more than
one handle here?

...

> +                   Package (2) {"phy-channel", 2},
> +                   Package (2) {"phy-mode", "rgmii-id"},
> +                   Package (2) {"mdio-handle", Package (){\_SB.MDI0}}

And drop all these 2s. They are counted automatically by `iasl`.
Randy Dunlap July 1, 2020, 1:16 p.m. UTC | #2
On 6/30/20 11:12 PM, Calvin Johnson wrote:
> Introduce ACPI mechanism to get PHYs registered on a MDIO bus and
> provide them to be connected to MAC.
> 
> An ACPI node property "mdio-handle" is introduced to reference the
> MDIO bus on which PHYs are registered with autoprobing method used
> by mdiobus_register().
> 
> Signed-off-by: Calvin Johnson <calvin.johnson@oss.nxp.com>
> ---
> 
> Changes in v2: None
> 
>  Documentation/firmware-guide/acpi/dsd/phy.rst | 40 +++++++++++++++++++
>  1 file changed, 40 insertions(+)
>  create mode 100644 Documentation/firmware-guide/acpi/dsd/phy.rst
> 
> diff --git a/Documentation/firmware-guide/acpi/dsd/phy.rst b/Documentation/firmware-guide/acpi/dsd/phy.rst
> new file mode 100644
> index 000000000000..78dcb0cacc7e
> --- /dev/null
> +++ b/Documentation/firmware-guide/acpi/dsd/phy.rst
> @@ -0,0 +1,40 @@
> +.. SPDX-License-Identifier: GPL-2.0
> +
> +=========================
> +MDIO bus and PHYs in ACPI
> +=========================
> +
> +The PHYs on a mdiobus are probed and registered using mdiobus_register().

            on an mdiobus (?)

> +Later, for connecting these PHYs to MAC, the PHYs registered on the
> +mdiobus have to be referenced.
> +
> +For each MAC node, a property "mdio-handle" is used to reference the
> +MDIO bus on which the PHYs are registered. On getting hold of the MDIO
> +bus, use find_phy_device() to get the PHY connected to the MAC.
> +
> +
> +An example of this is show below::

                         shown

> +
> +	Scope(\_SB.MCE0.PR17) // 1G
Andrew Lunn July 1, 2020, 1:30 p.m. UTC | #3
> +An example of this is show below::
> +
> +	Scope(\_SB.MCE0.PR17) // 1G
> +	{
> +	  Name (_DSD, Package () {
> +	     ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"),
> +		 Package () {
> +		     Package (2) {"phy-channel", 1},
> +		     Package (2) {"phy-mode", "rgmii-id"},
> +		     Package (2) {"mdio-handle", Package (){\_SB.MDI0}}

Please include the MDIO device node in the example, to make it clearer
how this linking works.

It would also be good to document "phy-mode" in this file.

   Andrew
Calvin Johnson July 3, 2020, 11:35 a.m. UTC | #4
On Wed, Jul 01, 2020 at 01:27:43PM +0300, Andy Shevchenko wrote:
> On Wed, Jul 1, 2020 at 9:13 AM Calvin Johnson
> <calvin.johnson@oss.nxp.com> wrote:
> >
> > Introduce ACPI mechanism to get PHYs registered on a MDIO bus and
> > provide them to be connected to MAC.
> >
> > An ACPI node property "mdio-handle" is introduced to reference the
> > MDIO bus on which PHYs are registered with autoprobing method used
> > by mdiobus_register().
> 
> ...
> 
> > +                    Package (2) {"mdio-handle", Package (){\_SB.MDI0}}
> 
> Reference as a package? Hmm... Is it really possible to have more than
> one handle here?

I didn't get your question here. Is it becasue of the (2)? I'll remove them
as they are automatically counted.

But if it is about the reference as a package. We've other similar examples.
One of them here:
https://github.com/tianocore/edk2-platforms/blob/master/Silicon/Hisilicon/Hi1610/Hi1610AcpiTables/Dsdt/D03Hns.asl#L581

> 
> ...
> 
> > +                   Package (2) {"phy-channel", 2},
> > +                   Package (2) {"phy-mode", "rgmii-id"},
> > +                   Package (2) {"mdio-handle", Package (){\_SB.MDI0}}
> 
> And drop all these 2s. They are counted automatically by `iasl`.
> 
Thanks
Calvin
Andy Shevchenko July 4, 2020, 11:40 a.m. UTC | #5
On Fri, Jul 3, 2020 at 2:36 PM Calvin Johnson
<calvin.johnson@oss.nxp.com> wrote:
> On Wed, Jul 01, 2020 at 01:27:43PM +0300, Andy Shevchenko wrote:
> > On Wed, Jul 1, 2020 at 9:13 AM Calvin Johnson
> > <calvin.johnson@oss.nxp.com> wrote:

...

> > > +                    Package (2) {"mdio-handle", Package (){\_SB.MDI0}}
> >
> > Reference as a package? Hmm... Is it really possible to have more than
> > one handle here?
>
> I didn't get your question here.

> But if it is about the reference as a package. We've other similar examples.
> One of them here:
> https://github.com/tianocore/edk2-platforms/blob/master/Silicon/Hisilicon/Hi1610/Hi1610AcpiTables/Dsdt/D03Hns.asl#L581

Thanks for this. It's not the line I was looking for, but I found
another example that answers my question, i.o.w. you may have several
references in one property.
diff mbox series

Patch

diff --git a/Documentation/firmware-guide/acpi/dsd/phy.rst b/Documentation/firmware-guide/acpi/dsd/phy.rst
new file mode 100644
index 000000000000..78dcb0cacc7e
--- /dev/null
+++ b/Documentation/firmware-guide/acpi/dsd/phy.rst
@@ -0,0 +1,40 @@ 
+.. SPDX-License-Identifier: GPL-2.0
+
+=========================
+MDIO bus and PHYs in ACPI
+=========================
+
+The PHYs on a mdiobus are probed and registered using mdiobus_register().
+Later, for connecting these PHYs to MAC, the PHYs registered on the
+mdiobus have to be referenced.
+
+For each MAC node, a property "mdio-handle" is used to reference the
+MDIO bus on which the PHYs are registered. On getting hold of the MDIO
+bus, use find_phy_device() to get the PHY connected to the MAC.
+
+
+An example of this is show below::
+
+	Scope(\_SB.MCE0.PR17) // 1G
+	{
+	  Name (_DSD, Package () {
+	     ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"),
+		 Package () {
+		     Package (2) {"phy-channel", 1},
+		     Package (2) {"phy-mode", "rgmii-id"},
+		     Package (2) {"mdio-handle", Package (){\_SB.MDI0}}
+	      }
+	   })
+	}
+
+	Scope(\_SB.MCE0.PR18) // 1G
+	{
+	  Name (_DSD, Package () {
+	    ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"),
+		Package () {
+		    Package (2) {"phy-channel", 2},
+		    Package (2) {"phy-mode", "rgmii-id"},
+		    Package (2) {"mdio-handle", Package (){\_SB.MDI0}}
+	    }
+	  })
+	}