From: megous via linux-sunxi <linux-sunxi-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
To: linux-sunxi-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org,
Maxime Ripard
<maxime.ripard-LDxbnhwyfcJBDgjK7y7TUQ@public.gmane.org>,
Chen-Yu Tsai <wens-jdAy2FN1RRM@public.gmane.org>,
Rob Herring <robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
Cc: Icenowy Zheng <icenowy-h8G6r0blFSE@public.gmane.org>,
David Airlie <airlied-cv59FeDIM0c@public.gmane.org>,
Daniel Vetter <daniel-/w4YWyX8dFk@public.gmane.org>,
Mark Rutland <mark.rutland-5wv7dgnIgG8@public.gmane.org>,
Giuseppe Cavallaro <peppe.cavallaro-qxv4g6HH51o@public.gmane.org>,
Alexandre Torgue <alexandre.torgue-qxv4g6HH51o@public.gmane.org>,
Jose Abreu <joabreu-HKixBCOQz3hWk0Htik3J/w@public.gmane.org>,
"David S. Miller" <davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>,
Maxime Coquelin
<mcoquelin.stm32-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org,
devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-stm32-XDFAJ8BFU24N7RejjzZ/Li2xQDfSxrLKVpNB7YpNyf8@public.gmane.org,
Ondrej Jirman <megous-5qf/QAjKc83QT0dZR+AlfA@public.gmane.org>
Subject: [PATCH v5 2/6] net: stmmac: sun8i: force select external PHY when no internal one
Date: Tue, 21 May 2019 01:50:05 +0200 [thread overview]
Message-ID: <20190520235009.16734-3-megous@megous.com> (raw)
In-Reply-To: <20190520235009.16734-1-megous-5qf/QAjKc83QT0dZR+AlfA@public.gmane.org>
From: Icenowy Zheng <icenowy-h8G6r0blFSE@public.gmane.org>
The PHY selection bit also exists on SoCs without an internal PHY; if it's
set to 1 (internal PHY, default value) then the MAC will not make use of
any PHY such SoCs.
This problem appears when adapting for H6, which has no real internal PHY
(the "internal PHY" on H6 is not on-die, but on a co-packaged AC200 chip,
connected via RMII interface at GPIO bank A).
Force the PHY selection bit to 0 when the SOC doesn't have an internal PHY,
to address the problem of a wrong default value.
Signed-off-by: Icenowy Zheng <icenowy-h8G6r0blFSE@public.gmane.org>
Signed-off-by: Ondrej Jirman <megous-5qf/QAjKc83QT0dZR+AlfA@public.gmane.org>
---
drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c
index 3258dec84d55..0484c289f328 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c
@@ -907,6 +907,11 @@ static int sun8i_dwmac_set_syscon(struct stmmac_priv *priv)
* address. No need to mask it again.
*/
reg |= 1 << H3_EPHY_ADDR_SHIFT;
+ } else {
+ /* For SoCs without internal PHY the PHY selection bit should be
+ * set to 0 (external PHY).
+ */
+ reg &= ~H3_EPHY_SELECT;
}
if (!of_property_read_u32(node, "allwinner,tx-delay-ps", &val)) {
--
2.21.0
next prev parent reply other threads:[~2019-05-20 23:50 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-20 23:50 [PATCH v5 0/6] Add support for Orange Pi 3 megous
[not found] ` <20190520235009.16734-1-megous-5qf/QAjKc83QT0dZR+AlfA@public.gmane.org>
2019-05-20 23:50 ` [PATCH v5 1/6] net: stmmac: sun8i: add support for Allwinner H6 EMAC megous via linux-sunxi
2019-05-20 23:50 ` megous via linux-sunxi [this message]
[not found] ` <20190520235009.16734-3-megous-5qf/QAjKc83QT0dZR+AlfA@public.gmane.org>
2019-05-21 9:27 ` [PATCH v5 2/6] net: stmmac: sun8i: force select external PHY when no internal one Sergei Shtylyov
[not found] ` <4e031eeb-2819-a97f-73bf-af84b04aa7b2-M4DtvfQ/ZS1MRgGoP+s0PdBPR1lH4CV8@public.gmane.org>
2019-05-21 9:56 ` 'Ondřej Jirman' via linux-sunxi
2019-05-20 23:50 ` [PATCH v5 3/6] arm64: dts: allwinner: orange-pi-3: Enable ethernet megous via linux-sunxi
2019-05-20 23:50 ` [PATCH v5 4/6] dt-bindings: display: hdmi-connector: Support DDC bus enable megous via linux-sunxi
2019-05-24 21:55 ` Rob Herring
2019-05-20 23:50 ` [PATCH v5 5/6] drm: sun4i: Add support for enabling DDC I2C bus to sun8i_dw_hdmi glue megous via linux-sunxi
[not found] ` <20190520235009.16734-6-megous-5qf/QAjKc83QT0dZR+AlfA@public.gmane.org>
2019-05-21 11:46 ` Maxime Ripard
2019-05-21 12:15 ` 'Ondřej Jirman' via linux-sunxi
2019-05-23 12:27 ` Maxime Ripard
2019-05-20 23:50 ` [PATCH v5 6/6] arm64: dts: allwinner: orange-pi-3: Enable HDMI output megous via linux-sunxi
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=20190520235009.16734-3-megous@megous.com \
--to=linux-sunxi-/jypxa39uh5tlh3mbocffw@public.gmane.org \
--cc=airlied-cv59FeDIM0c@public.gmane.org \
--cc=alexandre.torgue-qxv4g6HH51o@public.gmane.org \
--cc=daniel-/w4YWyX8dFk@public.gmane.org \
--cc=davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org \
--cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
--cc=icenowy-h8G6r0blFSE@public.gmane.org \
--cc=joabreu-HKixBCOQz3hWk0Htik3J/w@public.gmane.org \
--cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-stm32-XDFAJ8BFU24N7RejjzZ/Li2xQDfSxrLKVpNB7YpNyf8@public.gmane.org \
--cc=mark.rutland-5wv7dgnIgG8@public.gmane.org \
--cc=maxime.ripard-LDxbnhwyfcJBDgjK7y7TUQ@public.gmane.org \
--cc=mcoquelin.stm32-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=megous-5qf/QAjKc83QT0dZR+AlfA@public.gmane.org \
--cc=netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=peppe.cavallaro-qxv4g6HH51o@public.gmane.org \
--cc=robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
--cc=wens-jdAy2FN1RRM@public.gmane.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