From: Corentin Labbe <clabbe.montjoie@gmail.com>
To: robh+dt@kernel.org, mark.rutland@arm.com,
maxime.ripard@free-electrons.com, wens@csie.org,
linux@armlinux.org.uk, peppe.cavallaro@st.com,
alexandre.torgue@st.com, andrew@lunn.ch, f.fainelli@gmail.com
Cc: icenowy@aosc.io, netdev@vger.kernel.org,
devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org,
Corentin Labbe <clabbe.montjoie@gmail.com>
Subject: [PATCH v4 0/5] net: stmmac: Detect PHY location with phy-is-integrated
Date: Sat, 26 Aug 2017 09:33:06 +0200 [thread overview]
Message-ID: <20170826073311.25612-1-clabbe.montjoie@gmail.com> (raw)
Hello
The current way to find if the PHY is internal is to compare DT phy-mode
and emac_variant/internal_phy.
But it will negate a possible future SoC where an external PHY use the
same phy mode than the integrated one.
This patchs series adds a new way to find if the PHY is integrated, via
the phy-is-integrated DT property.
Since it exists both integrated and external ethernet-phy@1, they are merged in
the final DTB and so share all properties.
For avoiding this, and better represent the reality, we use a MDIO mux.
The first try was to create a new MDIO mux "mdio-mux-syscon".
mdio-mux-syscon working the same way than mdio-mux-mmioreg with the exception
that the register is used via syscon/regmap.
But this solution does not work for two reason:
- changing the MDIO selection need the reset of MAC which cannot be done by the
mdio-mux-syscon driver
- There were driver loading order problem:
- mdio-mux-syscon needing that stmmac register the parent MDIO
- stmmac needing that child MDIO was registered just after registering parent MDIO
So we cannot use any external MDIO-mux.
The final solution was to represent a mdio-mux but let the MAC handle all things.
The only hack that comes with this solution is that we add a patch
"net: stmmac: Register parent MDIO in case of fake mdio-mux"
because we have ino other way to know which MDIO node to register.
Note that sun8i-v3s-emac have also an integrated PHY, but since it lacks
any external PHY support it is not necessary to add MDIO mux to it.
All patchs should go via the net tree with exception of DT patchs which should
go via the sunxi tree
Note that this serie will need backporting the patch
"Documentation: net: phy: Add phy-is-integrated binding" which is in net-next
Regards
Changes since v3:
- Added a patch for handling fixed-link
- Updated documentation
Changes since v2:
- Add a MDIO mux for creating distinction between integrated and external MDIO.
- phy-is-integrated is not set in dtsi.
Changes since v1:
- Dropped phy-is-integrated documentation patch since another same patch was already merged
- Moved phy-is-integrated from SoC dtsi to final board DT.
Corentin Labbe (5):
net: stmmac: Handle possible fixed-link with need_mdio_ids
ARM: dts: sunxi: h3/h5: represent the mdio switch used by
sun8i-h3-emac
dt-bindings: net: dwmac-sun8i: update documentation about integrated
PHY
net: stmmac: dwmac-sun8i: choose internal PHY via phy-is-integrated
net: stmmac: Register parent MDIO in case of fake mdio-mux
.../devicetree/bindings/net/dwmac-sun8i.txt | 117 ++++++++++++++++++++-
arch/arm/boot/dts/sunxi-h3-h5.dtsi | 22 +++-
drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c | 16 +--
.../net/ethernet/stmicro/stmmac/stmmac_platform.c | 13 ++-
4 files changed, 152 insertions(+), 16 deletions(-)
--
2.13.5
next reply other threads:[~2017-08-26 7:35 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-26 7:33 Corentin Labbe [this message]
2017-08-26 7:33 ` [PATCH v4 1/5] net: stmmac: Handle possible fixed-link with need_mdio_ids Corentin Labbe
2017-08-26 7:33 ` [PATCH v4 2/5] ARM: dts: sunxi: h3/h5: represent the mdio switch used by sun8i-h3-emac Corentin Labbe
2017-08-26 7:33 ` [PATCH v4 3/5] dt-bindings: net: dwmac-sun8i: update documentation about integrated PHY Corentin Labbe
2017-08-26 7:33 ` [PATCH v4 4/5] net: stmmac: dwmac-sun8i: choose internal PHY via phy-is-integrated Corentin Labbe
2017-08-26 21:20 ` Andrew Lunn
2017-08-29 8:34 ` Corentin Labbe
2017-08-29 14:06 ` Andrew Lunn
2017-08-31 20:18 ` Rob Herring
2017-08-31 20:59 ` Andrew Lunn
2017-09-01 14:04 ` Rob Herring
2017-08-26 7:33 ` [PATCH v4 5/5] net: stmmac: Register parent MDIO in case of fake mdio-mux Corentin Labbe
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=20170826073311.25612-1-clabbe.montjoie@gmail.com \
--to=clabbe.montjoie@gmail.com \
--cc=alexandre.torgue@st.com \
--cc=andrew@lunn.ch \
--cc=devicetree@vger.kernel.org \
--cc=f.fainelli@gmail.com \
--cc=icenowy@aosc.io \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=mark.rutland@arm.com \
--cc=maxime.ripard@free-electrons.com \
--cc=netdev@vger.kernel.org \
--cc=peppe.cavallaro@st.com \
--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
all inboxes | Powered by JetHome®