From: Andrew Lunn <andrew@lunn.ch>
To: "Jernej Škrabec" <jernej.skrabec@siol.net>
Cc: robh+dt@kernel.org, f.fainelli@gmail.com,
Heiner Kallweit <hkallweit1@gmail.com>,
devicetree@vger.kernel.org, netdev@vger.kernel.org,
linux@armlinux.org.uk, mripard@kernel.org,
linux-kernel@vger.kernel.org, wens@csie.org,
lee.jones@linaro.org, davem@davemloft.net,
linux-arm-kernel@lists.infradead.org
Subject: Re: [RFC PATCH 2/4] net: phy: Add support for AC200 EPHY
Date: Fri, 17 Apr 2020 19:01:38 +0200 [thread overview]
Message-ID: <20200417170138.GD785713@lunn.ch> (raw)
In-Reply-To: <6176364.4vTCxPXJkl@jernej-laptop>
> > You could use PHY_ID_MATCH_MODEL() here.
>
> Hm... This doesn't work with dynamically allocated memory, right?
I would suggest we get the right structure first, then figure out
details like this.
Depending on when the device will respond to MDIO, we might be able to
make this a normal PHY driver. It then probes in the normal way, and
all the horrible dependencies you talked about, module loading order,
etc all go away.
There were 3 things you talked about to make the PHY usable:
1) Clock
2) Reset
3) Must be enabled and configured through I2C
We already have the concept of a PHY device having a reset controller
as a property. e.g. Documentation/devicetree/bindings/net/ethernet-phy.yaml
resets = <&rst 8>;
So if the MFD exports a reset controller, we can control that from the
PHY core. If the MFD has not probed yet, the reset core code will
return EPROBE_DEFFER, and the PHY probe will get differed until late.
That solves a lot of probe order issues.
The clock can be handled in two different ways, depending on if the
clock needs to be ticking to read the PHY ID registers. If it does
need to be ticking, we add support for a clks property in just the
same way we have support for the reset property. The PHY core will
clk_enable_prepare() the clock before probing the PHY. If the clock is
not needed for probing, the PHY driver can enable the clock as needed.
The last part, Must be enabled and configured through I2C, we need to
look at the details. It could be the reset controller also enabled the
PHY. If that is enough that the PHY then probes, the PHY driver can
then configure the PHY as needed via i2c.
Andrew
next prev parent reply other threads:[~2020-04-17 17:01 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-16 18:57 [RFC PATCH 0/4] net: mfd: AC200 Ethernet PHY Jernej Skrabec
2020-04-16 18:57 ` [RFC PATCH 1/4] mfd: Add support for AC200 Jernej Skrabec
2020-04-24 8:05 ` Lee Jones
2020-04-16 18:57 ` [RFC PATCH 2/4] net: phy: Add support for AC200 EPHY Jernej Skrabec
2020-04-16 19:18 ` Florian Fainelli
2020-04-17 15:01 ` Jernej Škrabec
2020-04-16 20:18 ` Heiner Kallweit
2020-04-17 16:03 ` Jernej Škrabec
2020-04-17 16:29 ` Heiner Kallweit
2020-04-17 17:15 ` Jernej Škrabec
2020-04-17 16:15 ` Jernej Škrabec
2020-04-17 16:16 ` Heiner Kallweit
2020-04-17 17:01 ` Andrew Lunn [this message]
2020-04-16 18:57 ` [RFC PATCH 3/4] arm64: dts: allwinner: h6: Add AC200 EPHY related nodes Jernej Skrabec
2020-04-16 18:57 ` [RFC PATCH 4/4] arm64: dts: allwinner: h6: tanix-tx6: Enable ethernet Jernej Skrabec
2020-04-16 21:54 ` [RFC PATCH 0/4] net: mfd: AC200 Ethernet PHY Andrew Lunn
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=20200417170138.GD785713@lunn.ch \
--to=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=devicetree@vger.kernel.org \
--cc=f.fainelli@gmail.com \
--cc=hkallweit1@gmail.com \
--cc=jernej.skrabec@siol.net \
--cc=lee.jones@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=mripard@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=robh+dt@kernel.org \
--cc=wens@csie.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
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).