summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorThomas Schaefer <[email protected]>2025-04-28 11:59:46 +0200
committerFabio Estevam <[email protected]>2025-05-12 18:43:19 -0300
commit9373e5aecfc5baf94534e2e7cc2270a09fc349b4 (patch)
tree8909f92956de0e8d33ed49827deced4ccb714b3a /drivers
parent0780b94afd010b66e146b740e4c7c7f33a869975 (diff)
net: fsl_enetc: fix imdio register calculation
With commit cc4e8af2c552, fsl_enetc register accessors have been split to handle different register offsets on different SoCs. However, for internal MDIO register calculation, only ENETC_PM_IMDIO_BASE was fixed without adding the SoC specific MAC register offset. As a result, the network support for the Kontron SMARC-sAL28 and probably other boards based on the LS1028A CPU is broken. Add the SoC specific MAC register offset to calculation of imdio.priv to fix this. Fixes: cc4e8af2c552 ("net: fsl_enetc: Split register accessors") Signed-off-by: Thomas Schaefer <[email protected]> Signed-off-by: Heiko Thiery <[email protected]> Reviewed-by: Michael Walle <[email protected]> Reviewed-by: Vladimir Oltean <[email protected]> Tested-by: Vladimir Oltean <[email protected]> # LS1028A Tested-by: Tim Harvey <[email protected]> # imx95_19x19_evk Reviewed-by: Marek Vasut <[email protected]> Reviewed-by: Alice Guo <[email protected]>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/fsl_enetc.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/net/fsl_enetc.c b/drivers/net/fsl_enetc.c
index 52fa820f518..97cccda4519 100644
--- a/drivers/net/fsl_enetc.c
+++ b/drivers/net/fsl_enetc.c
@@ -473,13 +473,15 @@ static int enetc_init_sxgmii(struct udevice *dev)
/* Apply protocol specific configuration to MAC, serdes as needed */
static void enetc_start_pcs(struct udevice *dev)
{
+ struct enetc_data *data = (struct enetc_data *)dev_get_driver_data(dev);
struct enetc_priv *priv = dev_get_priv(dev);
/* register internal MDIO for debug purposes */
if (enetc_read_pcapr_mdio(dev)) {
priv->imdio.read = enetc_mdio_read;
priv->imdio.write = enetc_mdio_write;
- priv->imdio.priv = priv->port_regs + ENETC_PM_IMDIO_BASE;
+ priv->imdio.priv = priv->port_regs + data->reg_offset_mac +
+ ENETC_PM_IMDIO_BASE;
strlcpy(priv->imdio.name, dev->name, MDIO_NAME_LEN);
if (!miiphy_get_dev_by_name(priv->imdio.name))
mdio_register(&priv->imdio);