linux-acpi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Calvin Johnson <calvin.johnson@oss.nxp.com>
To: Andrew Lunn <andrew@lunn.ch>
Cc: Jeremy Linton <jeremy.linton@arm.com>,
	linux.cj@gmail.com, Jon Nettleton <jon@solid-run.com>,
	linux@armlinux.org.uk, Makarand Pawagi <makarand.pawagi@nxp.com>,
	cristian.sovaiala@nxp.com, laurentiu.tudor@nxp.com,
	ioana.ciornei@nxp.com, V.Sethi@nxp.com, pankaj.bansal@nxp.com,
	"Rajesh V . Bikkina" <rajesh.bikkina@nxp.com>,
	Marcin Wojtas <mw@semihalf.com>,
	"David S. Miller" <davem@davemloft.net>,
	Florian Fainelli <f.fainelli@gmail.com>,
	Heiner Kallweit <hkallweit1@gmail.com>,
	linux-kernel@vger.kernel.org, netdev@vger.kernel.org,
	linux-acpi@vger.kernel.org
Subject: Re: [PATCH v1 1/7] mdio_bus: Introduce fwnode MDIO helpers
Date: Wed, 18 Mar 2020 11:33:47 +0530	[thread overview]
Message-ID: <20200318060347.GA21824@lsv03152.swis.in-blr01.nxp.com> (raw)
In-Reply-To: <20200317140426.GR24270@lunn.ch>

Hi Andrew,

On Tue, Mar 17, 2020 at 03:04:26PM +0100, Andrew Lunn wrote:
> On Tue, Mar 17, 2020 at 05:06:50PM +0530, Calvin Johnson wrote:
> > Hi,
> > 
> > On Fri, Jan 31, 2020 at 09:04:34PM +0530, Calvin Johnson wrote:
> > 
> > <snip>
> > 
> > > +/**
> > > + * fwnode_mdiobus_child_is_phy - Return true if the child is a PHY node.
> > > + * It must either:
> > > + * o Compatible string of "ethernet-phy-ieee802.3-c45"
> > > + * o Compatible string of "ethernet-phy-ieee802.3-c22"
> > > + * Checking "compatible" property is done, in order to follow the DT binding.
> > > + */
> > > +static bool fwnode_mdiobus_child_is_phy(struct fwnode_handle *child)
> > > +{
> > > +	int ret;
> > > +
> > > +	ret = fwnode_property_match_string(child, "compatible",
> > > +					   "ethernet-phy-ieee802.3-c45");
> > > +	if (!ret)
> > > +		return true;
> > > +
> > > +	ret = fwnode_property_match_string(child, "compatible",
> > > +					   "ethernet-phy-ieee802.3-c22");
> > > +	if (!ret)
> > > +		return true;
> > > +
> > > +	if (!fwnode_property_present(child, "compatible"))
> > > +		return true;
> > > +
> > > +	return false;
> > > +}
> > 
> > Can we use _CID in ACPI to get the compatible string? Is there any other method
> > to handle this kind of situation where we would like to pass C45 or C22 info to
> > the mdiobus driver?
> 
> Hi Calvin
> 
> Is there any defacto standardised way to stuff this device tree
> property into ACPI? It is one of the key properties, so either there
> is one standard way, or lots of variants because nobody can be
> bothered to go to the ACPI standardisation body and get it formalised.

_DSD package is used to stuff this kind of DT property. IMO, this is not the
standard way as C22 and C45 are key properties for MDIO.

Eg usage of _DSD:
https://source.codeaurora.org/external/qoriq/qoriq-components/edk2-platforms/tree/Platform/NXP/LX2160aRdbPkg/AcpiTables/Dsdt/Mdio.asl?h=LX2160_UEFI_ACPI_EAR1

      Name (_DSD, Package () {
        ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"),
          Package () {
            Package () {"reg", 5},
            Package () {"phy-addr", 5},
            Package () {"compatible", "ethernet-phy-ieee802.3-c45"}
        }
      })

Ideally, MDIO bus should be part of the ACPI spec.
Maybe this property can be included in:
https://uefi.org/sites/default/files/resources/nic-request-v2.pdf

I'm still looking for a better approach than _DSD till ACPI spec defines it.

Regards
Calvin

      reply	other threads:[~2020-03-18  6:04 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20200131153440.20870-1-calvin.johnson@nxp.com>
     [not found] ` <fcda49b6-7a45-cd86-e33e-f8dea07c0684@gmail.com>
2020-02-05  8:31   ` [EXT] Re: [PATCH v1 0/7] ACPI support for xgmac_mdio and dpaa2-mac drivers Calvin Johnson (OSS)
     [not found] ` <20200131153440.20870-7-calvin.johnson@nxp.com>
     [not found]   ` <20200203184121.GR25745@shell.armlinux.org.uk>
2020-02-05 11:33     ` [EXT] Re: [PATCH v1 6/7] net: phylink: Introduce phylink_fwnode_phy_connect() Calvin Johnson (OSS)
     [not found] ` <20200131153440.20870-2-calvin.johnson@nxp.com>
     [not found]   ` <20200131162814.GB17185@lunn.ch>
2020-02-05  7:11     ` [EXT] Re: [PATCH v1 1/7] mdio_bus: Introduce fwnode MDIO helpers Calvin Johnson (OSS)
     [not found]   ` <371ff9b4-4de6-7a03-90f8-a1eae4d5402d@arm.com>
2020-02-07  9:42     ` Calvin Johnson (OSS)
2020-02-25 10:12       ` Calvin Johnson
2020-02-25 20:42         ` Jeremy Linton
2020-03-17 11:36   ` Calvin Johnson
2020-03-17 14:04     ` Andrew Lunn
2020-03-18  6:03       ` Calvin Johnson [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200318060347.GA21824@lsv03152.swis.in-blr01.nxp.com \
    --to=calvin.johnson@oss.nxp.com \
    --cc=V.Sethi@nxp.com \
    --cc=andrew@lunn.ch \
    --cc=cristian.sovaiala@nxp.com \
    --cc=davem@davemloft.net \
    --cc=f.fainelli@gmail.com \
    --cc=hkallweit1@gmail.com \
    --cc=ioana.ciornei@nxp.com \
    --cc=jeremy.linton@arm.com \
    --cc=jon@solid-run.com \
    --cc=laurentiu.tudor@nxp.com \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux.cj@gmail.com \
    --cc=linux@armlinux.org.uk \
    --cc=makarand.pawagi@nxp.com \
    --cc=mw@semihalf.com \
    --cc=netdev@vger.kernel.org \
    --cc=pankaj.bansal@nxp.com \
    --cc=rajesh.bikkina@nxp.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).