Dual CPSW with fixed-link?

Alright here’s an interesting one. I can’t seem to get my AM3352 talking to a Marvell switch via DSA or otherwise and I’m completely stumped. The switch is an 88E6071 wired up to RGMII2 and MDIO. It’s using address space 0x10-0x1F and the phy is address 0.

I’ve tried setting it up a million different ways but since I don’t really need DSA, just need a “dumb” switch this is the most basic:

(using sdk 6.1.46 kernel)

&davinci_mdio_sw {
	pinctrl-names = "default";
	pinctrl-0 = <&davinci_mdio_default>;
	//status = "okay";
	bus-speed = <100000>;
	
	ethphy0: ethernet-phy@0 {
		reg = <0>;
	};
};

&cpsw_port1 {
	phy-handle = <&ethphy0>;
	phy-mode = "rgmii-id";
	ti,dual-emac-pvid = <1>;
};

&cpsw_port2 {
	phy-mode = "rgmii-id";
	ti,dual-emac-pvid = <2>;

	fixed-link {
        speed = <100>;
        full-duplex;
    };
};

eth0 shows up, loads the proper PHY driver and is all happy. eth1 shows up, says the link is up but I can’t get an IP or seemingly get it to do anything.

doing ifconfig eth1 down/up gives me:

debian@arm:~$ sudo ifconfig eth1 down
[ 1892.884530] cpsw-switch 4a100000.switch eth1: Link is Down
debian@arm:~$ sudo ifconfig eth1 up
[ 1900.470543] cpsw-switch 4a100000.switch: starting ndev. mode: dual_mac
[ 1900.490068] Generic PHY fixed-0:00: attached PHY driver (mii_bus:phy_addr=fixed-0:00, irq=POLL)
[ 1900.498953] cpsw-switch 4a100000.switch eth1: Link is Up - 100Mbps/Full - flow control off
[ 1900.524258] IPv6: ADDRCONF(NETDEV_CHANGE): eth1: link becomes ready

It really looks like it’s trying to work, I have a feeling I’m missing something silly not being much a linux networking guy.

Any thoughts?

Got it to where I think it should be working. I verified via MDIO to the switch is up and is forwarding internally.

Got my dts boiled down to:

&mac_sw {
	pinctrl-names = "default";
	pinctrl-0 = <&cpsw_default>;
	//slaves = <2>;
	status = "okay";
};

&davinci_mdio_sw {
	pinctrl-names = "default";
	pinctrl-0 = <&davinci_mdio_default>;
	//status = "okay";
	
	ethphy0: ethernet-phy@0 {
		reg = <0>;
	};

	ethphy1: ethernet-phy@1d {
		reg = <0x1d>;
	};
};

&cpsw_port1 {
	phy-handle = <&ethphy0>;
	phy-mode = "rgmii-id";
	ti,dual-emac-pvid = <1>;
};

&cpsw_port2 {
	phy-handle = <&ethphy1>;
	phy-mode = "rgmii-id";
	ti,dual-emac-pvid = <2>;
};

Which yields:

[    0.471190] davinci_mdio 4a101000.mdio: phy[29]: device 4a101000.mdio:1d, driver unknown
[   32.366151] Generic PHY 4a101000.mdio:1d: attached PHY driver (mii_bus:phy_addr=4a101000.mdio:1d, irq=POLL)

The other PHY is working perfect:

[    0.471177] davinci_mdio 4a101000.mdio: phy[0]: device 4a101000.mdio:00, driver Marvell 88E1510
[   32.110022] Marvell 88E1510 4a101000.mdio:00: attached PHY driver (mii_bus:phy_addr=4a101000.mdio:00, irq=POLL)

But it still just doesn’t appear to be linking:

3: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DEFAULT group default qlen 1000
    link/ether 08:04:b4:da:47:75 brd ff:ff:ff:ff:ff:ff
4: eth1: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN mode DEFAULT group default qlen 1000
    link/ether 08:04:b4:da:47:77 brd ff:ff:ff:ff:ff:ff

mii-tool:

debian@arm:~$ sudo mii-tool -v eth0
eth0: negotiated 1000baseT-FD flow-control, link ok
  product info: vendor 00:0a:c2 or 00:50:43, model 29 rev 1
  basic mode:   autonegotiation enabled
  basic status: autonegotiation complete, link ok
  capabilities: 1000baseT-HD 1000baseT-FD 100baseTx-FD 100baseTx-HD 10baseT-FD 10baseT-HD
  advertising:  1000baseT-HD 1000baseT-FD 100baseTx-FD 100baseTx-HD 10baseT-FD 10baseT-HD
  link partner: 1000baseT-FD 100baseTx-FD 100baseTx-HD 10baseT-FD 10baseT-HD flow-control
debian@arm:~$ sudo mii-tool -v eth1
eth1: no link
  product info: vendor fc:03:80 or 3f:c0:01, model 49 rev 5
  basic mode:   autonegotiation enabled
  basic status: no link
  capabilities:
  advertising:  10baseT-FD 10baseT-HD

Also verified the schematic again with a Marvell FAE, went through pin assignments and dts pinmux and everyone agrees the hardware looks good. The RCLK is dead on 25MHz.

Alright, reverted to fixed-link mode in the dts and things are looking up and it appears I get traffic in both directions but can’t for the life of me get a DHCP IP address, and can’t seem to figure out a static solution enough to even ping anything.

Any ideas why it won’t get a DHCP address?

&mac_sw {
	pinctrl-names = "default";
	pinctrl-0 = <&cpsw_default>;
	slaves = <2>;
	status = "okay";
};

&davinci_mdio_sw {
	pinctrl-names = "default";
	pinctrl-0 = <&davinci_mdio_default>;
	//status = "okay";
	
	ethphy0: ethernet-phy@0 {
		reg = <0>;
	};

	/*ethphy1: ethernet-phy@1d {
		reg = <0x1d>;
	};*/
};

&cpsw_port1 {
	phy-handle = <&ethphy0>;
	phy-mode = "rgmii-id";
	ti,dual-emac-pvid = <1>;
};

&cpsw_port2 {
	//phy-handle = <&ethphy1>;
	phy-mode = "rgmii";
	ti,dual-emac-pvid = <2>;

	fixed-link {
	      speed = <100>;
	      full-duplex;
	};
};
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.100.138  netmask 255.255.255.0  broadcast 192.168.100.255
        inet6 fe80::313c:9e17:ee4e:79d4  prefixlen 64  scopeid 0x20<link>
        ether 08:04:b4:da:3f:cb  txqueuelen 1000  (Ethernet)
        RX packets 113  bytes 7713 (7.5 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 1435  bytes 87988 (85.9 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

eth1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 10.10.10.200  netmask 255.255.254.0  broadcast 0.0.0.0
        ether 08:04:b4:da:3f:cd  txqueuelen 1000  (Ethernet)
        RX packets 3955  bytes 328294 (320.5 KiB)
        RX errors 0  dropped 5  overruns 0  frame 0
        TX packets 249  bytes 40722 (39.7 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

debian@arm:~$ sudo mii-tool -v eth1
eth1: no autonegotiation, 100baseTx-FD, link ok
  product info: vendor 00:00:00 or 00:00:00, model 0 rev 0
  basic mode:   autonegotiation enabled
  basic status: autonegotiation complete, link ok
  capabilities: 100baseTx-FD
  advertising:  1000baseT-HD 1000baseT-FD 100baseT4 100baseTx-FD 100baseTx-HD 10baseT-FD 10baseT-HD flow-control
  link partner: 100baseTx-FD

Nevermind, hardware issue. For the record, the AM335x does work just fine in fixed-link mode with the 88E6071 set to NOCPU mode.

1 Like