Linux-ACPI Archive on lore.kernel.org
 help / color / Atom feed
From: Jon Nettleton <jon@solid-run.com>
To: Jeremy Linton <jeremy.linton@arm.com>
Cc: Florian Fainelli <f.fainelli@gmail.com>,
	Dan Callaghan <dan.callaghan@opengear.com>,
	Andrew Lunn <andrew@lunn.ch>,
	Calvin Johnson <calvin.johnson@oss.nxp.com>,
	Russell King <linux@armlinux.org.uk>,
	Cristi Sovaiala <cristian.sovaiala@nxp.com>,
	Ioana Ciornei <ioana.ciornei@nxp.com>,
	Andy Shevchenko <andy.shevchenko@gmail.com>,
	Madalin Bucur <madalin.bucur@oss.nxp.com>,
	netdev <netdev@vger.kernel.org>, "linux.cj" <linux.cj@gmail.com>,
	linux-acpi <linux-acpi@vger.kernel.org>
Subject: Re: [net-next PATCH v7 1/6] Documentation: ACPI: DSD: Document MDIO PHY
Date: Wed, 29 Jul 2020 10:43:34 +0200
Message-ID: <CABdtJHvcaR_J86at-eMYPmNXEno8_CwUkSpLmF4HHba_AQ4A2Q@mail.gmail.com> (raw)
In-Reply-To: <f046fa8b-6bac-22c3-0d9f-9afb20877fc9@arm.com>

On Wed, Jul 29, 2020 at 4:53 AM Jeremy Linton <jeremy.linton@arm.com> wrote:
>
> Hi,
>
> On 7/28/20 7:39 PM, Florian Fainelli wrote:
> > On 7/28/2020 3:30 PM, Jeremy Linton wrote:
> >> Hi,
> >>
> >> On 7/28/20 3:06 AM, Dan Callaghan wrote:
> >>> Excerpts from Andrew Lunn's message of 2020-07-24 21:14:36 +02:00:
> >>>> Now i could be wrong, but are Ethernet switches something you expect
> >>>> to see on ACPI/SBSA platforms? Or is this a legitimate use of the
> >>>> escape hatch?
> >>>
> >>> As an extra data point: right now I am working on an x86 embedded
> >>> appliance (ACPI not Device Tree) with 3x integrated Marvell switches.
> >>> I have been watching this patch series with great interest, because
> >>> right now there is no way for me to configure a complex switch topology
> >>> in DSA without Device Tree.
> >>
> >> DSA though, the switch is hung off a normal MAC/MDIO, right? (ignoring
> >> whether that NIC/MAC is actually hug off PCIe for the moment).
> >
> > There is no specific bus, we have memory mapped, MDIO, SPI, I2C swiches
> > all supported within the driver framework right now.
> >
> >>
> >> It just has a bunch of phy devices strung out on that single MAC/MDIO.
> >
> > It has a number of built-in PHYs that typically appear on a MDIO bus,
> > whether that bus is the switch's internal MDIO bus, or another MDIO bus
> > (which could be provided with just two GPIOs) depends on how the switch
> > is connected to its management host.
> >
> > When the switch is interfaced via MDIO the switch also typically has a
> > MDIO interface called the pseudo-PHY which is how you can actually tap
> > into the control interface of the switch, as opposed to reading its
> > internal PHYs from the MDIO bus.
> >
> >> So in ACPI land it would still have a relationship similar to the one
> >> Andrew pointed out with his DT example where the eth0->mdio->phy are all
> >> contained in their physical parent. The phy in that case associated with
> >> the parent adapter would be the first direct decedent of the mdio, the
> >> switch itself could then be represented with another device, with a
> >> further string of device/phys representing the devices. (I dislike
> >> drawing acsii art, but if this isn't clear I will, its also worthwhile
> >> to look at the dpaa2 docs for how the mac/phys work on this device for
> >> contrast.).
> >
> > The eth0->mdio->phy relationship you describe is the simple case that
> > you are well aware of which is say what we have on the Raspberry Pi 4
> > with GENET and the external Broadcom PHY.
> >
> > For an Ethernet switch connected to an Ethernet MAC, we have 4 different
> > types of objects:
> >
> > - the Ethernet MAC which sits on its specific bus
> >
> > - the Ethernet switch which also sits on its specific bus
> >
> > - the built-in PHYs of the Ethernet switch which sit on whatever
> > bus/interface the switch provides to make them accessible
> >
> > - the specific bus controller that provides access to the Ethernet switch
> >
> > and this is a simplification that does not take into account Physical
> > Coding Sublayer devices, pure MDIO devices (with no foot in the Ethernet
> > land such as PCIe, USB3 or SATA PHYs), SFP, SFF and other pluggable modules.
>
> Which is why I've stayed away from much of the switch discussion. There
> are a lot of edge cases to fall into, because for whatever reason
> networking seems to be unique in all this non-enumerable customization
> vs many other areas of the system. Storage, being an example i'm more
> familiar with which has very similar problems yet, somehow has managed
> to avoid much of this, despite having run on fabrics significantly more
> complex than basic ethernet (including running on a wide range of hot
> pluggable GBIC/SFP/QSFP/etc media layers).
>
> ACPI's "problem" here is that its strongly influenced by the "Plug and
> Play" revolution of the 1990's where the industry went from having
> humans describing hardware using machine readable languages, to hardware
> which was enumerable using standard protocols. ACPI's device
> descriptions are there as a crutch for the remaining non plug an play
> hardware in the system.
>
> So at a basic level, if your describing hardware in ACPI rather than
> abstracting it, that is a problem.
>
This is also my first run with ACPI and this discussion needs to be
brought back to the powers that be regarding sorting this out.  This
is where I see it from an Armada and Layerscape perspective.  This
isn't a silver bullet fix but the small things I think that need to be
done to move this forward.

From Microsoft's documentation.

Device dependencies

Typically, there are hardware dependencies between devices on a
particular platform. Windows requires that all such dependencies be
described so that it can ensure that all devices function correctly as
things change dynamically in the system (device power is removed,
drivers are stopped and started, and so on). In ACPI, dependencies
between devices are described in the following ways:

1) Namespace hierarchy. Any device that is a child device (listed as a
device within the namespace of another device) is dependent on the
parent device. For example, a USB HSIC device is dependent on the port
(parent) and controller (grandparent) it is connected to. Similarly, a
GPU device listed within the namespace of a system memory-management
unit (MMU) device is dependent on the MMU device.

2) Resource connections. Devices connected to GPIO or SPB controllers
are dependent on those controllers. This type of dependency is
described by the inclusion of Connection Resources in the device's
_CRS.

3) OpRegion dependencies. For ASL control methods that use OpRegions
to perform I/O, dependencies are not implicitly known by the operating
system because they are only determined during control method
evaluation. This issue is particularly applicable to GeneralPurposeIO
and GenericSerialBus OpRegions in which Plug and Play drivers provide
access to the region. To mitigate this issue, ACPI defines the
OpRegion Dependency (_DEP) object. _DEP should be used in any device
namespace in which an OpRegion (HW resource) is referenced by a
control method, and neither 1 nor 2 above already applies for the
referenced OpRegion's connection resource. For more information, see
section 6.5.8, "_DEP (Operation Region Dependencies)", of the ACPI 5.0
specification.

We can forget about 3 because even though _DEP would solve many of our
problems, and Intel has kind of used it for some of their
architectures, according to the ACPI spec it should not be used this
way.

1) can be achievable on some platforms like the LX2160a.  We have the
mcbin firmware which is the bus (the ACPI spec does allow you to
define a platform defined bus), which has MACs as the children, which
then can have phy's or SFP modules as their children.  This works okay
for enumeration and parenting but how do they talk?

This is where 2) comes into play.  The big problem is that MDIO isn't
designated as a SPB
(https://docs.microsoft.com/en-us/windows-hardware/drivers/bringup/simple-peripheral-bus--spb-)
We have GPIO, I2C, SPI, UART, MIPI and a couple of others.  While not
a silver bullet I think getting MDIO added to the spec would be the
next step forward to being able to implement this in Linux with
phylink / phylib in a sane manner.  Currently SFP definitions are
using the SPB to designate the various GPIO and I2C interfaces that
are needed to probe devices and handle interrupts.

The other alternatives is the ACPI maintainers agree on the _DSD
method (would be quickest and should be easy to migrate to SBP if MDIO
were adopter), or nothing is done at all (which I know seems to be a
popular opinion).

-Jon

  parent reply index

Thread overview: 49+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-15  9:03 [net-next PATCH v7 0/6] ACPI support for dpaa2 MAC driver Calvin Johnson
2020-07-15  9:03 ` [net-next PATCH v7 1/6] Documentation: ACPI: DSD: Document MDIO PHY Calvin Johnson
2020-07-16  3:04   ` Florian Fainelli
2020-07-16  3:11     ` Andrew Lunn
2020-07-23 23:26   ` Jeremy Linton
2020-07-24 13:39     ` Andrew Lunn
2020-07-24 17:26       ` Jeremy Linton
2020-07-24 17:39         ` Florian Fainelli
2020-07-24 19:20           ` Andrew Lunn
2020-07-24 20:12             ` Andy Shevchenko
2020-07-24 20:13               ` Florian Fainelli
2020-07-24 20:20                 ` Andy Shevchenko
2020-07-25  7:36                   ` Calvin Johnson
2020-07-25 10:48                     ` Andy Shevchenko
2020-07-24 21:06               ` Russell King - ARM Linux admin
2020-07-27 17:03             ` Sudeep Holla
2020-07-24 19:14         ` Andrew Lunn
2020-07-27 17:21           ` Sudeep Holla
2020-07-28 20:34             ` Andrew Lunn
2020-07-28 20:59               ` Russell King - ARM Linux admin
2020-07-28 21:26                 ` Andy Shevchenko
2020-07-29 16:00               ` Rafael J. Wysocki
2020-07-31 15:08                 ` Andrew Lunn
2020-07-27 17:32           ` Jon Nettleton
     [not found]           ` <1595922651-sup-5323@galangal.danc.bne.opengear.com>
2020-07-28 20:45             ` Andrew Lunn
2020-07-28 20:56               ` Florian Fainelli
2020-07-28 21:28                 ` Andy Shevchenko
2020-07-28 21:40                   ` Florian Fainelli
2020-07-31 15:14                   ` Andrew Lunn
2020-09-25 13:22                     ` Grant Likely
2020-07-28 22:30             ` Jeremy Linton
2020-07-29  0:39               ` Florian Fainelli
2020-07-29  2:53                 ` Jeremy Linton
2020-07-29  3:16                   ` Florian Fainelli
2020-07-29  8:43                   ` Jon Nettleton [this message]
2020-07-29  9:39                     ` Calvin Johnson
2020-09-25 13:34   ` Grant Likely
2020-09-26  4:30     ` Calvin Johnson
2020-07-15  9:03 ` [net-next PATCH v7 2/6] net: phy: introduce device_mdiobus_register() Calvin Johnson
2020-07-16  3:05   ` Florian Fainelli
2020-07-15  9:03 ` [net-next PATCH v7 3/6] net/fsl: use device_mdiobus_register() Calvin Johnson
2020-07-16  3:05   ` Florian Fainelli
2020-07-15  9:03 ` [net-next PATCH v7 4/6] net: phy: introduce phy_find_by_mdio_handle() Calvin Johnson
2020-07-16  3:06   ` Florian Fainelli
2020-07-15  9:03 ` [net-next PATCH v7 5/6] phylink: introduce phylink_fwnode_phy_connect() Calvin Johnson
2020-07-15  9:04 ` [net-next PATCH v7 6/6] net: dpaa2-mac: Add ACPI support for DPAA2 MAC driver Calvin Johnson
2020-09-25 13:39 ` [net-next PATCH v7 0/6] ACPI support for dpaa2 " Grant Likely
2020-09-26  4:34   ` Calvin Johnson
2020-07-25 14:23 Calvin Johnson
2020-07-25 14:23 ` [net-next PATCH v7 1/6] Documentation: ACPI: DSD: Document MDIO PHY Calvin Johnson

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=CABdtJHvcaR_J86at-eMYPmNXEno8_CwUkSpLmF4HHba_AQ4A2Q@mail.gmail.com \
    --to=jon@solid-run.com \
    --cc=andrew@lunn.ch \
    --cc=andy.shevchenko@gmail.com \
    --cc=calvin.johnson@oss.nxp.com \
    --cc=cristian.sovaiala@nxp.com \
    --cc=dan.callaghan@opengear.com \
    --cc=f.fainelli@gmail.com \
    --cc=ioana.ciornei@nxp.com \
    --cc=jeremy.linton@arm.com \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux.cj@gmail.com \
    --cc=linux@armlinux.org.uk \
    --cc=madalin.bucur@oss.nxp.com \
    --cc=netdev@vger.kernel.org \
    /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

Linux-ACPI Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-acpi/0 linux-acpi/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-acpi linux-acpi/ https://lore.kernel.org/linux-acpi \
		linux-acpi@vger.kernel.org
	public-inbox-index linux-acpi

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-acpi


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git