ClearFog LX2162A 1G Ethernet not working

Hi,

I have followed the instructions here to bring up my ClearFog LX2162A board https://solidrun.atlassian.net/wiki/spaces/developer/pages/199131187/ClearFog+LX2162A+Quick+Start+Guide, and flashed the pre-built image on the SD card (lx2162a_rev2_som_clearfog_2000_650_2900_18_9_0-b6c6923.img.xz).

I’ve connected an Ethernet cable to the top-left RJ45 port of 8x 1GbE RJ-45 ports (routed to Marvell Octal PHY). The Quick-start guide says this port is connected to dpmac.16. The ls-listni suggests it is eth9 interface in Linux:
dprc.1/dpni.2 (interface: eth9, end point: dpmac.16)

When I try to bring up this interface (ifconfig eth9 up) I am getting the following error in dmesg:

[   22.712849] fsl_dpaa2_eth dpni.2 eth9: configuring for phy/sgmii link mode
[   25.786932] fsl_dpaa2_eth dpni.2 eth9: phy_set_mode_ext() = -95
[   25.792878] mdio_bus 0x0000000008c43000:00: USXGMII only supports in-band AN for now
[   25.800635] fsl_dpaa2_eth dpni.2 eth9: pcs_config failed: -EOPNOTSUPP
[   25.814114] fsl_dpaa2_eth dpni.2 eth9: Link is Up - 1Gbps/Full - flow control off
[   25.814165] IPv6: ADDRCONF(NETDEV_CHANGE): eth9: link becomes ready

I’m not sure this port is working correctly then, for example running dhclient eth9 doesn’t succeed

This appears to be a bug in the latest BSP. We are looking into it and will get back to you.

Thanks for the answer! Could you explain please what is the problem here?
It seems like dpaa2_eth driver tries to use out-of-band link configuration. Could it be fixed by adding managed = “in-band-status”; for dpmac16 in the device-tree.

Thanks

Sorry for the delay, just started looking at this. It seems like a regression from our previous BSP and I am working on bisecting what is missing. Will just need another day or two and I will get back with a patch and answer. Thanks for your patience.

1 Like

Hey jnettlet! Has there been any updates to this issue? Its a major blocker for our integration with the ClearFog LX2162A board. Is there maybe an older image which is know to be working? Thanks!

i am facing the same issue. i tried multiple images, from the pre build repo. and i ended up with the issue in each one of them.

I have the exact same issue with a brand new board when I used lx2162a_rev2_som_clearfog_2000_650_2900_18_9_0-fd60614.img. Hoping for some input on recommended image to use to get things going.

Link seems to come up, but DHCP does not complete.
‘’’
root@localhost:~# ethtool eth9
Settings for eth9:
Supported ports: [ ]
Supported link modes: 10baseT/Full
100baseT/Full
1000baseT/Full
Supported pause frame use: Symmetric Receive-only
Supports auto-negotiation: Yes
Supported FEC modes: Not reported
Advertised link modes: 10baseT/Full
100baseT/Full
1000baseT/Full
Advertised pause frame use: Symmetric Receive-only
Advertised auto-negotiation: Yes
Advertised FEC modes: Not reported
Link partner advertised link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Half 1000baseT/Full
Link partner advertised pause frame use: No
Link partner advertised auto-negotiation: Yes
Link partner advertised FEC modes: Not reported
Speed: 1000Mb/s
Duplex: Full
Auto-negotiation: on
Port: Twisted Pair
PHYAD: 9
Transceiver: external
MDI-X: off (auto)
Link detected: yes
root@localhost:~# ifconfig eth9
eth9: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet6 fe80::d263:b4ff:fe05:109c prefixlen 64 scopeid 0x20
ether d0:63:b4:05:10:9c txqueuelen 1000 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 25 bytes 5382 (5.3 KB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
‘’’

This issue with the 1G ports does not seem like it is a regression – I tried removing patch at a time and the issue does not seem to resolve. I noticed the ports seem to work from U-boot, so this would appear to be a Linux driver issue. In Linux, the port seems to be configured in SGMII mode UNTIL link-up occurs, at which time, the port seems to switch to USXGMII mode.

Do you have any feedback on when there might be a patch for this?

After much debugging, it appears the SolidRun patch to support the Marvell mv88e2580 patch is incomplete and by default tries to incorrectly switch the PHY mode from SGMII to USXGMII. The following GIT patch to the Linux kernel seems to fix the issue; though I do not have the PHY datasheet to ensure a complete implementation.

$ git diff
diff --git a/drivers/net/phy/marvell10g.c b/drivers/net/phy/marvell10g.c
index 2b8dc1984f10..a95914b65eb0 100644
--- a/drivers/net/phy/marvell10g.c
+++ b/drivers/net/phy/marvell10g.c
@@ -544,6 +544,20 @@ static int mv2110_init_interface(struct phy_device *phydev, int mactype)
        return 0;
 }
 
+static int mv2580_init_interface(struct phy_device *phydev, int mactype)
+{
+       struct mv3310_priv *priv = dev_get_drvdata(&phydev->mdio.dev);
+
+       priv->rate_match = false;
+
+       if (mactype == MV_PMA_21X0_PORT_CTRL_MACTYPE_USXGMII)
+               priv->const_interface = PHY_INTERFACE_MODE_SGMII;
+       else
+               return -EINVAL;
+
+       return 0;
+}
+
 static int mv3310_init_interface(struct phy_device *phydev, int mactype)
 {
        struct mv3310_priv *priv = dev_get_drvdata(&phydev->mdio.dev);
@@ -992,7 +1006,7 @@ static const struct mv3310_chip mv2111_type = {
 static const struct mv3310_chip mv2580_type = {
        .init_supported_interfaces = mv2580_init_supported_interfaces,
        .get_mactype = mv2110_get_mactype,
-       .init_interface = mv2110_init_interface,
+       .init_interface = mv2580_init_interface,
 
 #ifdef CONFIG_HWMON
        .hwmon_read_temp_reg = mv2110_hwmon_read_temp_reg,

After patching, I can successfully get link up and obtain a DHCP address:

root@localhost:~# ifconfig eth9 up
root@localhost:~# dhclient eth9
root@localhost:~# ifconfig eth9
eth9: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 10.50.24.119  netmask 255.255.255.0  broadcast 10.50.24.255
        inet6 fe80::d263:b4ff:fe05:109c  prefixlen 64  scopeid 0x20<link>
        ether d0:63:b4:05:10:9c  txqueuelen 1000  (Ethernet)
        RX packets 14  bytes 2034 (2.0 KB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 10  bytes 1612 (1.6 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

I have tried your patch today but it wasnt working for me. Can you explain me what you did different from my approach when you get a chance?

I have build using the docker method. Inside the build folder I have modified the source in the linux folder using your diff. I had to apply it by hand because the lines were slightly different. I finished the build process and and burned the image to a SD card.

I use the following command to build:

docker run --rm -i -t -v "$PWD":/work -e TARGET=LX2162A_SOM_CLEARFOG_18_9_0 -e CPU_REVISION=2 -e BOOTSOURCE=auto -e DDR_SPEED=2900 -e BUS_SPEED=650 -e CPU_SPEED=2000 lx2160a_build -u $(id -u) -g $(id -g) | tee log.log

When booting I dont see any interfaces anymore. The leds start blinking when I insert a RJ45 cable. I also dont have the dhclient binary anymore.

I also was using the Docker build approach. Inside the main lx2160a_build repo, I added my patch to the patches/linux directory as 0037-Improve-support-for-mv88e2580-PHY-in-SGMII-mode.patch. To get the patch installed, you would need to remove the build/linux directory to allow the repatching to complete during the rebuild.

I used the build options “-e TARGET=LX2162A_SOM_CLEARFOG_18_9_0 -e BUS_SPEED=650”, but otherwise the same as you.

To adhere to my company build requirements, I made other changes to retrieve all software from company local repositories which effectively takes a snapshot of the SolidRun repositories, but that should not make any difference. My SolidRun base for the build was:

commit fd606140bbf78d81b3be24fe4cee81025ef2c650 (origin/develop-ls-5.15.71-2.2.0, origin/HEAD, develop-ls-5.15.71-2.2.0)
Author: Josua Mayer <josua@solid-run.com>
Date:   Wed Apr 9 13:15:20 2025 +0200

    linux: add example serdes equalization parameters for internal cex6 evb

My patch probably conflicted as it looks like an update was posted to the Commits · SolidRun/lx2160a_build · GitHub branch on May 7 for this issue.

Correct, We started with lsdk-21.08 and resolved a related issue that caused error messages but did not stop the ports from receiving packets. Then moved on to ls-5.15 which in fact had a different bug.
I have tested the latest CI build with the patch and it seems to resolve the issue: SolidRun Images

Your patch was on the right track, what happened is when adding 2580 phy support I used the wrong register for reading phy mac port setting.

1 Like

I made it work! Yesterday I forgot the step during boot to flash the microSD. Now everything works. I have tested both, the official image as well as the patch.

Thank you very much for your help! Much appreciated!