Commit 9a30ac26 authored by Josua Mayer's avatar Josua Mayer

linux: clearfog-itx: fix standalone rj45 ethernet port

The hack for configuring MAC XIF_MODE register pending mc firmware
support differentiates between some 10gbps and some 1gbps modes.
Add rgmii modes to avoid fall-through when using the wired phy.
Signed-off-by: default avatarJosua Mayer <josua@solid-run.com>
parent 33e76e06
From bb4f8ce57e43f2ab099fd3e3ccbeaf1ff9c2ad30 Mon Sep 17 00:00:00 2001
From: Josua Mayer <josua@solid-run.com>
Date: Tue, 31 May 2022 14:46:21 +0300
Subject: [PATCH] dpaa2-eth: configure MAC XIF_MODE register appropriately for
rgmii modes
The hack for configuring MAC XIF_MODE register pending mc firmware
support differentiates between some 10gbps and some 1gbps modes.
Add rgmii modes to avoid fall-through when using a wired 1gbps phy.
Fixes: dpaa2-eth: configure the MAC XIF_MODE register on protocol change
Signed-off-by: Josua Mayer <josua@solid-run.com>
---
drivers/net/ethernet/freescale/dpaa2/dpaa2-mac.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/freescale/dpaa2/dpaa2-mac.c b/drivers/net/ethernet/freescale/dpaa2/dpaa2-mac.c
index 6a5f754c8c61..c46d29e28582 100644
--- a/drivers/net/ethernet/freescale/dpaa2/dpaa2-mac.c
+++ b/drivers/net/ethernet/freescale/dpaa2/dpaa2-mac.c
@@ -165,7 +165,7 @@ static void dpaa2_mac_config(struct phylink_config *config, unsigned int mode,
{
struct dpaa2_mac *mac = phylink_to_dpaa2_mac(config);
struct dpmac_link_state *dpmac_state = &mac->state;
- u32 if_mode, orig, tmp;
+ u32 if_mode = 0, orig, tmp;
int err;
if (state->an_enabled)
@@ -184,11 +184,14 @@ static void dpaa2_mac_config(struct phylink_config *config, unsigned int mode,
case PHY_INTERFACE_MODE_USXGMII:
if_mode = 0x1;
break;
+ case PHY_INTERFACE_MODE_RGMII:
+ case PHY_INTERFACE_MODE_RGMII_ID:
case PHY_INTERFACE_MODE_SGMII:
case PHY_INTERFACE_MODE_1000BASEX:
if_mode = 0x3;
break;
default:
+ netdev_err(mac->net_dev, "%s: unhandled link mode %i, expect rx/tx errors!\n", __func__, state->interface);
break;
}
--
2.35.3
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment