All of lore.kernel.org
 help / color / mirror / Atom feed
From: Calvin Johnson <calvin.johnson@oss.nxp.com>
To: Jeremy Linton <jeremy.linton@arm.com>,
	"linux.cj@gmail.com" <linux.cj@gmail.com>,
	Jon Nettleton <jon@solid-run.com>,
	"linux@armlinux.org.uk" <linux@armlinux.org.uk>,
	Makarand Pawagi <makarand.pawagi@nxp.com>,
	Cristi Sovaiala <cristian.sovaiala@nxp.com>,
	Laurentiu Tudor <laurentiu.tudor@nxp.com>,
	Ioana Ciornei <ioana.ciornei@nxp.com>,
	Varun Sethi <V.Sethi@nxp.com>,
	Pankaj Bansal <pankaj.bansal@nxp.com>,
	"Rajesh V. Bikkina" <rajesh.bikkina@nxp.com>,
	Leo Li <leoyang.li@nxp.com>
Cc: linux-acpi@vger.kernel.org
Subject: Re: [EXT] Re: [PATCH v1 1/7] mdio_bus: Introduce fwnode MDIO helpers
Date: Tue, 25 Feb 2020 15:42:40 +0530	[thread overview]
Message-ID: <20200225101240.GA8966@lsv03152.swis.in-blr01.nxp.com> (raw)
In-Reply-To: <AM0PR04MB56366808BA5C841E4E7BC86E931C0@AM0PR04MB5636.eurprd04.prod.outlook.com>

On Fri, Feb 07, 2020 at 09:42:56AM +0000, Calvin Johnson (OSS) wrote:
Hi Jeremy,

 
> > -----Original Message-----
> > From: Jeremy Linton <jeremy.linton@arm.com>
> > Sent: Wednesday, February 5, 2020 7:48 PM
> 
> <snip>
> 
> > > +static int fwnode_mdio_parse_addr(struct device *dev,
> > > +                               const struct fwnode_handle *fwnode) {
> > > +     u32 addr;
> > > +     int ret;
> > > +
> > > +     ret = fwnode_property_read_u32(fwnode, "reg", &addr);
> > > +     if (ret < 0) {
> > > +             dev_err(dev, "PHY node has no 'reg' property\n");
> > > +             return ret;
> > > +     }
> > > +
> > > +     /* A PHY must have a reg property in the range [0-31] */
> > > +     if (addr < 0 || addr >= PHY_MAX_ADDR) {
> > > +             dev_err(dev, "PHY address %i is invalid\n", addr);
> > > +             return -EINVAL;
> > > +     }
> > > +
> > > +     return addr;
> > > +}
> > 
> > Almost assuredly this is wrong, the _ADR method exists to identify a device
> > on its parent bus. The DT reg property shouldn't be used like this in an ACPI
> > enviroment.

In the ACPI environment, can we use _ADR to get the PHY device address
from the DSDT? Is there any function to get this value?
acpi_ut_evaluate_numeric_object is called from inside drivers/acpi/acpica.
However, I don't see any other driver outside drivers/acpi using _ADR to get
the address.

> > 
> > Further, there are a number of other dt bindings in this set that seem
> > inappropriate in common/shared ACPI code paths. That is because AFAIK the
> > _DSD methods are there to provide device implementation specific
> > behaviors, not as standardized methods for a generic classes of devices.
> > Its vaguly the equivlant of the "vendor,xxxx" properties in DT.
> > 
> > This has been a discussion point on/off for a while with any attempt to
> > publicly specify/standardize for all OS vendors what they might find encoded
> > in a DSD property. The few year old "WORK_IN_PROGRESS" link on the uefi
> > page has a few suggested ones
> > 
> > https://uefi.org/sites/default/files/resources/nic-request-v2.pdf

Having this as part of spec would be helpful.
Do you know who can help get this nic-request integrated into spec?

> > 
> > Anyway, the use of phy-handle with a reference to the phy device on a
> > shared MDIO is a techically workable solution to the problem brought up in
> > the RPI/ACPI thread as well. OTOH, it suffers from the use of DSD and at a
> > minimum should probably be added to the document linked above if its
> > found to be the best way to handle this. Although, in the common case of a
> > mdio bus, matching acpi described devices with their discovered
> > counterparts (note the device() defintion in the spec
> > 19.6.30) only to define DSD refrences is a bit overkill.
> > 
> > Put another way, while seemingly not nessiary if a bus can be probed, a
> > nic/device->mdio->phy can be described in the normal ACPI heirarchy with
> > only appropriatly nested CRS and ADR resources. Its the shared nature of the
> > MDIO bus that causes problems.

Were you able to take a look at the shared DSDT tables? Is this the ACPI hierarchy
with nested CRS and ADR resources which you mentioned above?

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

Thanks
Calvin

  reply	other threads:[~2020-02-25 10:12 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-31 15:34 [PATCH v1 0/7] ACPI support for xgmac_mdio and dpaa2-mac drivers Calvin Johnson
2020-01-31 15:34 ` [PATCH v1 1/7] mdio_bus: Introduce fwnode MDIO helpers Calvin Johnson
2020-01-31 16:28   ` Andrew Lunn
2020-02-05  7:11     ` [EXT] " Calvin Johnson (OSS)
2020-02-03  9:49   ` kbuild test robot
2020-02-03  9:49     ` kbuild test robot
2020-02-05 14:17   ` Jeremy Linton
2020-02-07  9:42     ` [EXT] " Calvin Johnson (OSS)
2020-02-25 10:12       ` Calvin Johnson [this message]
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
2020-01-31 15:34 ` [PATCH v1 2/7] mdio_bus: modify fwnode phy related functions Calvin Johnson
2020-01-31 15:34 ` [PATCH v1 3/7] net/fsl: add ACPI support for mdio bus Calvin Johnson
2020-01-31 16:08   ` Andy Shevchenko
2020-02-04  7:18     ` Calvin Johnson (OSS)
2020-02-04 11:17       ` Andy Shevchenko
2020-02-03  3:44   ` Florian Fainelli
2020-02-04 18:46     ` Calvin Johnson
2020-01-31 15:34 ` [PATCH v1 4/7] device property: fwnode_get_phy_mode: Change API to solve int/unit warnings Calvin Johnson
2020-01-31 15:55   ` Andy Shevchenko
2020-02-03  9:13     ` Calvin Johnson (OSS)
2020-02-03  9:22       ` Andy Shevchenko
2020-02-03  2:32   ` kbuild test robot
2020-02-03  2:32     ` kbuild test robot
2020-02-03  8:41   ` kbuild test robot
2020-02-03  8:41     ` kbuild test robot
2020-01-31 15:34 ` [PATCH v1 5/7] device property: Introduce fwnode_phy_is_fixed_link() Calvin Johnson
2020-01-31 15:57   ` Andy Shevchenko
2020-02-03  9:21     ` Calvin Johnson (OSS)
2020-01-31 15:34 ` [PATCH v1 6/7] net: phylink: Introduce phylink_fwnode_phy_connect() Calvin Johnson
2020-02-03 18:21   ` kbuild test robot
2020-02-03 18:21     ` kbuild test robot
2020-02-03 18:41   ` Russell King - ARM Linux admin
2020-02-03 18:43     ` Russell King - ARM Linux admin
2020-02-05 11:33     ` [EXT] " Calvin Johnson (OSS)
2020-01-31 15:34 ` [PATCH v1 7/7] dpaa2-eth: Add ACPI support for DPAA2 MAC driver Calvin Johnson
2020-02-03 18:02 ` [PATCH v1 0/7] ACPI support for xgmac_mdio and dpaa2-mac drivers Florian Fainelli
2020-02-05  8:31   ` [EXT] " Calvin Johnson (OSS)

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=20200225101240.GA8966@lsv03152.swis.in-blr01.nxp.com \
    --to=calvin.johnson@oss.nxp.com \
    --cc=V.Sethi@nxp.com \
    --cc=cristian.sovaiala@nxp.com \
    --cc=ioana.ciornei@nxp.com \
    --cc=jeremy.linton@arm.com \
    --cc=jon@solid-run.com \
    --cc=laurentiu.tudor@nxp.com \
    --cc=leoyang.li@nxp.com \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux.cj@gmail.com \
    --cc=linux@armlinux.org.uk \
    --cc=makarand.pawagi@nxp.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.