cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Highlighted
Visitor
Visitor
741 Views
Registered: ‎05-16-2018

linux-xlnx 2020.1 Fixed Phy issue

been trying to get a Marvel 88mv6176 DSA switch working with the 2020.1 kernel.  I had it working with the older kernels but I needed to move to a newer kernel.

The switch would load find the phys then unload so I removed the switch from the device tree to confirm that the macb driver worked correctly with fixed-phy mode but this seams to be a problem as it still looks for a phy device and fails.

The debug is in the attached macbprobe-debug.txt aand fails in this if statment as far as I can tell

if (!phydev)
{
printk( KERN_ALERT "RW: if (!phydev)" );
return -ENODEV;
}

 

device tree fragment for fixed-link only, switch parts removed for test:

&gem0 {
local-mac-address = [00 0a 35 00 1e 53];
phy-mode = "rgmii-id";
fixed-link {
speed = <100>;
full-duplex;
};
mdio1: mdio {
};
};

 

I have left the mdio in as that will be needed when I put the switch back

The RW: below is extra debugging I added to the kernel.

NOTE: the macb: probe of e000b000.ethernet rejects match -19  line


bus: 'platform': add driver xilinx_spi
bus: 'platform': add driver zynq-qspi
bus: 'platform': add driver mdio-mux-gpio
bus: 'platform': add driver mdio-mux-multiplexer
bus: 'platform': add driver mdio-gpio
Registering platform device 'Fixed MDIO bus.0'. Parent at platform
device: 'Fixed MDIO bus.0': device_add
bus: 'platform': add device Fixed MDIO bus.0
device: 'fixed-0': device_add
libphy: Fixed MDIO Bus: probed
bus: 'mdio_bus': add driver Marvell 88E1101
bus: 'mdio_bus': add driver Marvell 88E1112
bus: 'mdio_bus': add driver Marvell 88E1111
bus: 'mdio_bus': add driver Marvell 88E1118
bus: 'mdio_bus': add driver Marvell 88E1121R
bus: 'mdio_bus': add driver Marvell 88E1318S
bus: 'mdio_bus': add driver Marvell 88E1145
bus: 'mdio_bus': add driver Marvell 88E1149R
bus: 'mdio_bus': add driver Marvell 88E1240
bus: 'mdio_bus': add driver Marvell 88E1116R
bus: 'mdio_bus': add driver Marvell 88E1510
bus: 'mdio_bus': add driver Marvell 88E1540
bus: 'mdio_bus': add driver Marvell 88E1545
bus: 'mdio_bus': add driver Marvell 88E3016
bus: 'mdio_bus': add driver Marvell 88E6390
bus: 'mdio_bus': add driver Xilinx PCS/PMA PHY
bus: 'mdio_bus': add driver xgmiitorgmii
tun: Universal TUN/TAP device driver, 1.6
device: 'tun': device_add
bus: 'mdio_bus': add driver mv88e6060
bus: 'mdio_bus': add driver mv88e6085
bus: 'platform': add driver macb
bus: 'platform': driver_probe_device: matched device e000b000.ethernet with driver macb
bus: 'platform': really_probe: probing driver macb with device e000b000.ethernet
macb e000b000.ethernet: no pinctrl handle
macb e000b000.ethernet: Cadence caps 0xa0000109
macb e000b000.ethernet: invalid hw address, using random
device: 'eth0': device_add
RW: static int macb_mii_init(struct macb *bp)
device: 'e000b000.ethernet-ffffffff': device_add
libphy: MACB_mii_bus: probed
RW: static int macb_mii_probe(struct net_device *dev)
RW: of_phy_is_fixed_link(np)
RW: if (bp->phy_node)
RW: of_phy_connect(...): if (!phy)
RW: if (!phydev)
macb: probe of e000b000.ethernet rejects match -19
bus: 'platform': add driver orion-mdio
bus: 'platform': add driver xilinx_emaclite
bus: 'platform': add driver xilinx_axienet
device class 'uio': registering
bus: 'platform': add driver uio_pdrv_genirq
bus: 'platform': add driver uio_dmem_genirq

 

Once the kernel sees the error from trying th setup the fixed link it seams to give up.

if the switch part of the device tree is added it correctly scans the phys in the switch then hits the same error line as above and then unloads the switch and phys etc.

Has anyone seen this or can you spot something I'm doing wrong?

Thanks

Ricky

0 Kudos
6 Replies
Highlighted
Visitor
Visitor
715 Views
Registered: ‎05-16-2018

if I remove the following from the device tree the fixed link stays and the ethernet driver is happy but I need the mdio bus for the Marvel DSA switch so does anyone know how to get both fixed-link and a DSA switch to work together on 2020.1?

mdio1: mdio {
};
0 Kudos
Highlighted
Moderator
Moderator
671 Views
Registered: ‎09-12-2007

If you are using a fixed link node, then you should not have an MDIO node. Have a look at the devicetree bindings for fixed link here:

https://xilinx-wiki.atlassian.net/wiki/spaces/A/pages/18841740/Macb+Driver

0 Kudos
Highlighted
592 Views
Registered: ‎10-28-2019

Hi rickyw

I am currently facing the same issue.

I have a fixed-link in GEM1 but I also need to define a mdio node within the GEM1 node. As you said, with a prev. version (in my case 2019.1 Kernel 4.19) it worked well.
But now with 2020.1 and Kernel 5.4 it is not working anymore.

When I'm adding the mdio node to the GEM1 with fixed-link, no (e.g.) eth1 net device has been created.

Have you found a solution for our problem?

Thank your very much

Best regards

Frank

0 Kudos
Highlighted
Visitor
Visitor
359 Views
Registered: ‎02-13-2020

Hi All,

I am working with the same configuration and failing too.

Any update ?

 

Regards,

RonenT.

0 Kudos
Highlighted
292 Views
Registered: ‎05-28-2018

Hi All.
I tried making a patch for v2020.1.
please try it.

patch:

Index: drivers/net/ethernet/cadence/macb_main.c
===================================================================
--- drivers/net/ethernet/cadence/macb_main.c	(revision 1106)
+++ drivers/net/ethernet/cadence/macb_main.c	(working copy)
@@ -512,6 +512,10 @@
 
 	if (np) {
 		if (of_phy_is_fixed_link(np)) {
+			if (of_phy_register_fixed_link(np) < 0) {
+				netdev_err(dev, "broken fixed-link specification %pOF\n", np);
+				return -ENODEV;
+			}
 			bp->phy_node = of_node_get(np);
 		} else {
 			bp->phy_node = of_parse_phandle(np, "phy-handle", 0);


device-tree sample:

&gem0 {
    phy-handle = <&gem0_phy>;
    phy-mode = "moca";
    gem0_phy: fixed-link {
        speed = <1000>;
        full-duplex;
    };
};

 

boot-log
===========
libphy: MACB_mii_bus: probed
Generic PHY fixed-0:00: attached PHY driver [Generic PHY] (mii_bus:phy_addr=fixed-0:00, irq=POLL)
macb e000b000.ethernet eth0: Cadence GEM rev 0x00020118 at 0xe000b000 irq 27 (a6:b2:d5:6d:3a:aa)
===========

Regard.

Highlighted
Visitor
Visitor
259 Views
Registered: ‎02-13-2020

Hi,

I tried the patch and it worked for me (needed some changes in the device-tree).

 

Thank you.

0 Kudos