From: Tony Dinh <mibodhi@gmail.com>
To: Joe Hershberger <joe.hershberger@ni.com>,
Ramon Fried <rfried.dev@gmail.com>
Cc: "Stefan Roese" <sr@denx.de>, "Tom Rini" <trini@konsulko.com>,
"U-Boot Mailing List" <u-boot@lists.denx.de>,
"Marek Beh�n" <marek.behun@nic.cz>,
"Pali Roh�r" <pali@kernel.org>, "Tony Dinh" <mibodhi@gmail.com>
Subject: [PATCH] net: marvell: mvgbe: Set PHY page 0 before phy_connect
Date: Tue, 12 Apr 2022 13:18:19 -0700 [thread overview]
Message-ID: <20220412201820.10291-1-mibodhi@gmail.com> (raw)
For most Kirkwood boards, the PHY page is already set to page 0
(in register 22) before phy_connect is invoked. But some board like
the Zyxel NSA310S (which uses the network chip MV88E1318S), the PHY page
is not set to page 0. There seems to be some bad data remained in
register 22 when the uclass MVGBE about to invoke phy_connect().
This patch enables the uclass MVGBE to always set the PHY page to 0
before phy_connect.
For reference, please see this discussion:
[RFC PATCH v2] arm: kirkwood: nsa310s: Use Marvell uclass mvgbe
and PHY driver for DM Ethernet.
https://lists.denx.de/pipermail/u-boot/2022-April/480946.html
This patch has been tested with the following Kirkwood boards:
NSA310S (88F6702, network chip MV88E1318S)
Sheevaplug (88F6281, network chip MV88E1318)
Pogo V4 (88F6192, network chip 88E1116R)
GF Home(88F6281, network chip 88E1116R)
Dreamplug (88F6281, network chip MV88E1318)
Dell Kace M300 (88F6282, network chip MV88E1318) - out of tree u-boot
Signed-off-by: Tony Dinh <mibodhi@gmail.com>
---
drivers/net/mvgbe.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/net/mvgbe.c b/drivers/net/mvgbe.c
index 954bf86121..d2db1e584a 100644
--- a/drivers/net/mvgbe.c
+++ b/drivers/net/mvgbe.c
@@ -43,6 +43,7 @@ DECLARE_GLOBAL_DATA_PTR;
#define MV_PHY_ADR_REQUEST 0xee
#define MVGBE_SMI_REG (((struct mvgbe_registers *)MVGBE0_BASE)->smi)
+#define MVGBE_PGADR_REG 22
#if defined(CONFIG_PHYLIB) || defined(CONFIG_MII) || defined(CONFIG_CMD_MII)
static int smi_wait_ready(struct mvgbe_device *dmvgbe)
@@ -745,6 +746,9 @@ static struct phy_device *__mvgbe_phy_init(struct eth_device *dev,
miiphy_write(dev->name, MV_PHY_ADR_REQUEST, MV_PHY_ADR_REQUEST,
phyid);
+ /* Make sure the selected PHY page is 0 before connecting */
+ miiphy_write(dev->name, phyid, MVGBE_PGADR_REG, 0);
+
phydev = phy_connect(bus, phyid, dev, phy_interface);
if (!phydev) {
printf("phy_connect failed\n");
--
2.30.2
next reply other threads:[~2022-04-12 20:18 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-12 20:18 Tony Dinh [this message]
2022-04-19 10:29 ` [PATCH] net: marvell: mvgbe: Set PHY page 0 before phy_connect Stefan Roese
2022-04-19 20:47 ` Tony Dinh
2022-04-21 1:45 ` Tony Dinh
2022-04-21 14:26 ` Stefan Roese
2022-04-21 21:21 ` Tony Dinh
2022-04-22 6:15 ` Stefan Roese
2022-04-23 2:15 ` Tony Dinh
2022-04-25 6:00 ` Stefan Roese
2022-04-25 9:33 ` Tony Dinh
2022-04-25 11:18 ` Stefan Roese
2022-04-25 22:01 ` Tony Dinh
2022-05-02 15:43 ` Stefan Roese
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=20220412201820.10291-1-mibodhi@gmail.com \
--to=mibodhi@gmail.com \
--cc=joe.hershberger@ni.com \
--cc=marek.behun@nic.cz \
--cc=pali@kernel.org \
--cc=rfried.dev@gmail.com \
--cc=sr@denx.de \
--cc=trini@konsulko.com \
--cc=u-boot@lists.denx.de \
/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