From: alice.guo@oss.nxp.com
To: Marek Vasut <marex@nabladev.com>,
Tim Harvey <tharvey@gateworks.com>, Ye Li <ye.li@nxp.com>,
u-boot@lists.denx.de, "NXP i.MX U-Boot Team" <uboot-imx@nxp.com>
Cc: Jerome Forissier <jerome.forissier@arm.com>,
Tom Rini <trini@konsulko.com>,
Thomas Schaefer <thomas.schaefer@kontron.com>,
Michael Walle <mwalle@kernel.org>,
Clark Wang <xiaoning.wang@nxp.com>,
Christian Marangi <ansuelsmth@gmail.com>,
Simon Glass <sjg@chromium.org>,
Quentin Schulz <quentin.schulz@cherry.de>,
Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>,
Robert Marko <robert.marko@sartura.hr>, Yao Zi <me@ziyao.cc>,
Heiko Thiery <heiko.thiery@gmail.com>,
Marek Vasut <marek.vasut+renesas@mailbox.org>,
Peng Fan <peng.fan@nxp.com>, Jacky Bai <ping.bai@nxp.com>,
Andrew Goodbody <andrew.goodbody@linaro.org>,
Stefano Babic <sbabic@nabladev.com>,
Fabio Estevam <festevam@gmail.com>,
Alice Guo <alice.guo@nxp.com>
Subject: [PATCH v1 1/3] net: fsl_enetc: fix the duplex setting on the iMX platform
Date: Fri, 03 Apr 2026 17:41:26 +0800 [thread overview]
Message-ID: <20260403-enetc-v1-1-e42ae28ae3fe@nxp.com> (raw)
In-Reply-To: <20260403-enetc-v1-0-e42ae28ae3fe@nxp.com>
From: Clark Wang <xiaoning.wang@nxp.com>
The iMX and LS platforms use different bits in the same register to
set duplex, but their logics are opposite.
The current settings will result in unexpected configurations in
RGMII mode.
Fixes: e6df2f5e22c6 ("net: fsl_enetc: Update enetc driver to support i.MX95")
Signed-off-by: Clark Wang <xiaoning.wang@nxp.com>
Signed-off-by: Alice Guo <alice.guo@nxp.com>
---
drivers/net/fsl_enetc.c | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/drivers/net/fsl_enetc.c b/drivers/net/fsl_enetc.c
index a4ba27904bc..766aea035d3 100644
--- a/drivers/net/fsl_enetc.c
+++ b/drivers/net/fsl_enetc.c
@@ -17,6 +17,7 @@
#include <asm/io.h>
#include <pci.h>
#include <miiphy.h>
+#include <linux/bitfield.h>
#include <linux/bug.h>
#include <linux/delay.h>
#include <linux/build_bug.h>
@@ -388,7 +389,7 @@ static int enetc_init_sgmii(struct udevice *dev)
/* set up MAC for RGMII */
static void enetc_init_rgmii(struct udevice *dev, struct phy_device *phydev)
{
- u32 old_val, val, dpx = 0;
+ u32 old_val, val = 0;
old_val = val = enetc_read_mac_port(dev, ENETC_PM_IF_MODE);
@@ -408,15 +409,14 @@ static void enetc_init_rgmii(struct udevice *dev, struct phy_device *phydev)
val |= ENETC_PM_IFM_SSP_10;
}
- if (enetc_is_imx95(dev))
- dpx = ENETC_PM_IFM_FULL_DPX_IMX;
+ if (enetc_is_imx95(dev))
+ val = u32_replace_bits(val,
+ phydev->duplex == DUPLEX_FULL ? 0 : 1,
+ ENETC_PM_IFM_FULL_DPX_IMX);
else if (enetc_is_ls1028a(dev))
- dpx = ENETC_PM_IFM_FULL_DPX_LS;
-
- if (phydev->duplex == DUPLEX_FULL)
- val |= dpx;
- else
- val &= ~dpx;
+ val = u32_replace_bits(val,
+ phydev->duplex == DUPLEX_FULL ? 1 : 0,
+ ENETC_PM_IFM_FULL_DPX_LS);
if (val == old_val)
return;
--
2.43.0
next prev parent reply other threads:[~2026-04-03 11:01 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-03 9:41 [PATCH 0/3] Enable ENETC on i.MX952 EVK alice.guo
2026-04-03 9:41 ` alice.guo [this message]
2026-04-03 9:41 ` [PATCH v1 2/3] net: fsl_enetc: Add support for i.MX952 alice.guo
2026-04-03 9:41 ` [PATCH v1 3/3] imx952_evk: Enable ENETC0 alice.guo
2026-04-04 11:38 ` Fabio Estevam
2026-04-07 7:16 ` 回复: [EXT] " Alice Guo
2026-04-07 11:56 ` Fabio Estevam
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=20260403-enetc-v1-1-e42ae28ae3fe@nxp.com \
--to=alice.guo@oss.nxp.com \
--cc=alice.guo@nxp.com \
--cc=andrew.goodbody@linaro.org \
--cc=ansuelsmth@gmail.com \
--cc=festevam@gmail.com \
--cc=heiko.thiery@gmail.com \
--cc=jerome.forissier@arm.com \
--cc=marek.vasut+renesas@mailbox.org \
--cc=marex@nabladev.com \
--cc=me@ziyao.cc \
--cc=mikhail.kshevetskiy@iopsys.eu \
--cc=mwalle@kernel.org \
--cc=peng.fan@nxp.com \
--cc=ping.bai@nxp.com \
--cc=quentin.schulz@cherry.de \
--cc=robert.marko@sartura.hr \
--cc=sbabic@nabladev.com \
--cc=sjg@chromium.org \
--cc=tharvey@gateworks.com \
--cc=thomas.schaefer@kontron.com \
--cc=trini@konsulko.com \
--cc=u-boot@lists.denx.de \
--cc=uboot-imx@nxp.com \
--cc=xiaoning.wang@nxp.com \
--cc=ye.li@nxp.com \
/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