[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YRffzVgP2eBw7HRz@lunn.ch>
Date: Sat, 14 Aug 2021 17:22:53 +0200
From: Andrew Lunn <andrew@...n.ch>
To: Saravana Kannan <saravanak@...gle.com>
Cc: Rob Herring <robh+dt@...nel.org>,
Frank Rowand <frowand.list@...il.com>, kernel-team@...roid.com,
devicetree@...r.kernel.org, linux-kernel@...r.kernel.org,
netdev@...r.kernel.org
Subject: Re: [PATCH v1 2/2] of: property: fw_devlink: Add support for
"phy-handle" property
Hi Saravana
> Hi Andrew,
>
> Also there
> are so many phy related properties that my head is spinning. Is there a
> "phy" property (which is different from "phys") that treated exactly as
> "phy-handle"?
Sorry, i don't understand your question.
> + /*
> + * Device tree nodes pointed to by phy-handle never have struct devices
> + * created for them even if they have a "compatible" property. So
> + * return the parent node pointer.
> + */
We have a classic bus with devices on it. The bus master is registers
with linux using one of the mdiobus_register() calls. That then
enumerates the bus, looking at the 32 possible address on the bus,
using mdiobus_scan. It then gets a little complex, due to
history.
Originally, the only thing you could have on an MDIO bus was a
PHY. But devices on MDIO busses are more generic, and Linux gained
support for Ethernet switches on an MDIO bus, and there are a few
other sort device. So to keep the PHY API untouched, but to add these
extra devices, we added the generic struct mdio_device which
represents any sort of device on an MDIO bus. This has a struct device
embedded in it.
When we scan the bus and find a PHY, a struct phy_device is created,
which has an embedded struct mdio_device. The struct device in that is
then registered with the driver core.
So a phy-handle does point to a device, but you need to do an object
orientated style look at the base class to find it.
Andrew
Powered by blists - more mailing lists