UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Observer ariels1
Observer
7,315 Views
Registered: ‎07-22-2013

using phy without MDIO

Hi,

 

In our custom board we connected the second  Mac/Gem/eth1 to switch ( micrel KSZ8864RMNI ).

the switch is working in unmannaged mode,  means no MDIO is required ( nor supported).

 

when leaving the mdio in the device tree, i receive all packets coming from the switch but not able to send.

probably it  because the phydev->link is 0. becuase it get its value if able to read the status register with mdio.

this is the my dts :

 

eth1: eth@e000c000 {
compatible = "xlnx,ps7-ethernet-1.00.a";
reg = <0xe000c000 0x1000>;
interrupts = <0 45 4>;
interrupt-parent = <&gic>;
phy-mode = "mii";
xlnx,ptp-enet-clock = <111111111>;

xlnx,slcr-div0-1000Mbps = <8>;
xlnx,slcr-div0-100Mbps = <8>;
xlnx,slcr-div0-10Mbps = <8>;
xlnx,slcr-div1-1000Mbps = <1>;
xlnx,slcr-div1-100Mbps = <5>;
xlnx,slcr-div1-10Mbps = <50>;
#address-cells = <0x1>;
#size-cells = <0x0>;

phy-handle = <&phy1>;
mdio {
#address-cells = <1>;
#size-cells = <0>;
////phy1: phy@7
phy1: phy@2
{
compatible = "micrel,KSZ886X"; //KSZ8864RMNI
device_type = "ethernet-phy";
reg = <2>;
};
};
};

 

 

i tried just to take of the mdio decleration from the device tree but got error in powerup also in the eth0.

 

so, is there a way that the kernel driver won't try to work with mdio and just send and receive packets ?

 

thanks.

Ari 

0 Kudos
8 Replies
Adventurer
Adventurer
262 Views
Registered: ‎08-04-2016

Re: using phy without MDIO

Hi @ariels1 

Been a long time since you posted this question.

Do you have a solution? My problem is that I'm using KSZ9897 switch but it's not even enumerating as eth0. My question is here - https://forums.xilinx.com/t5/Embedded-Linux/ZynqMP-connected-to-ethernet-switch/m-p/969161#M33406

0 Kudos
Moderator
Moderator
237 Views
Registered: ‎09-12-2007

Re: using phy without MDIO

0 Kudos
Adventurer
Adventurer
226 Views
Registered: ‎08-04-2016

Re: using phy without MDIO

Thanks for your reply.

I am using fixed link in the device tree. I didn't know about "moca" earlier. Looks like it should be used for MAC-MAC links with no PHY in between. Now, the device tree looks like this -

&gem0 {
	status = "okay";
	phy-mode = "moca";
	phy-handle = &i2c_ksz9897;
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_gem0_default>;
	local-mac-address = [00 0a 35 00 02 90];
	fixed-link {
		speed = <1000>;
		full-duplex;
	};
};

&i2c0 {
	status = "okay";
	clock-frequency = <100000>;
	pinctrl-names = "default", "gpio";
	pinctrl-0 = <&pinctrl_i2c0_default>;
	pinctrl-1 = <&pinctrl_i2c0_gpio>;
	scl-gpios = <&gpio 14 GPIO_ACTIVE_HIGH>;
	sda-gpios = <&gpio 15 GPIO_ACTIVE_HIGH>;
	#address-cells = <1>;
	#size-cells = <0>;

	i2c_ksz9897: ksz9897@5f{
		compatible = "microchip,ksz9897";
		reg = <0x5f>;
		phy-mode = "moca";

		interrupt-parent = <&gic>;
		interrupts = <0 89 0>;
		status = "okay";
		ports {
			#address-cells = <1>;
			#size-cells = <0>;
			port@0 {
				reg = <0>;
				label = "lan1";
			};
			port@1 {
				reg = <1>;
				label = "lan2";
			};
			port@2 {
				reg = <2>;
				label = "lan3";
			};
			port@3 {
				reg = <3>;
				label = "lan4";
			};
			port@4 {
				reg = <4>;
				label = "lan5";
			};
			port@5 {
				reg = <5>;
				label = "cpu";
				ethernet = <&gem0>;
				fixed-link {
					speed = <1000>;
					full-duplex;
				};
			};
			port@6 {
				reg = <6>;
				label = "lan6";
				fixed-link {
					speed = <1000>;
					full-duplex;
				};
			};
		};
	};
};

Still, no luck. It's the same situation as before - we're able to receive all packets but cannot transmit anything.

The log from dmesg looks like this -

[    2.049359] libphy: Fixed MDIO Bus: probed
[    2.054152] tun: Universal TUN/TAP device driver, 1.6
[    2.059119] CAN device driver interface
[    2.063949] macb ff0b0000.ethernet: Not enabling partial store and forward
[    2.071175] libphy: MACB_mii_bus: probed
[    2.074933] mdio_bus ff0b0000.ethernet-ffffffff: /amba/ethernet@ff0b0000/fixed-link has invalid PHY address
[    2.084604] mdio_bus ff0b0000.ethernet-ffffffff: scan phy fixed-link at address 0
[    2.089862] PLL: shutdown
[    2.094870] mdio_bus ff0b0000.ethernet-ffffffff: scan phy fixed-link at address 1
[    2.102369] mdio_bus ff0b0000.ethernet-ffffffff: scan phy fixed-link at address 2
[    2.109857] mdio_bus ff0b0000.ethernet-ffffffff: scan phy fixed-link at address 3
[    2.117340] mdio_bus ff0b0000.ethernet-ffffffff: scan phy fixed-link at address 4
[    2.124827] mdio_bus ff0b0000.ethernet-ffffffff: scan phy fixed-link at address 5
[    2.132304] mdio_bus ff0b0000.ethernet-ffffffff: scan phy fixed-link at address 6
[    2.139789] mdio_bus ff0b0000.ethernet-ffffffff: scan phy fixed-link at address 7
[    2.147276] mdio_bus ff0b0000.ethernet-ffffffff: scan phy fixed-link at address 8
[    2.154756] mdio_bus ff0b0000.ethernet-ffffffff: scan phy fixed-link at address 9
[    2.162240] mdio_bus ff0b0000.ethernet-ffffffff: scan phy fixed-link at address 10
[    2.169815] mdio_bus ff0b0000.ethernet-ffffffff: scan phy fixed-link at address 11
[    2.177383] mdio_bus ff0b0000.ethernet-ffffffff: scan phy fixed-link at address 12
[    2.184950] mdio_bus ff0b0000.ethernet-ffffffff: scan phy fixed-link at address 13
[    2.192522] mdio_bus ff0b0000.ethernet-ffffffff: scan phy fixed-link at address 14
[    2.200089] mdio_bus ff0b0000.ethernet-ffffffff: scan phy fixed-link at address 15
[    2.207659] mdio_bus ff0b0000.ethernet-ffffffff: scan phy fixed-link at address 16
[    2.215223] mdio_bus ff0b0000.ethernet-ffffffff: scan phy fixed-link at address 17
[    2.222788] mdio_bus ff0b0000.ethernet-ffffffff: scan phy fixed-link at address 18
[    2.230354] mdio_bus ff0b0000.ethernet-ffffffff: scan phy fixed-link at address 19
[    2.237923] mdio_bus ff0b0000.ethernet-ffffffff: scan phy fixed-link at address 20
[    2.245496] mdio_bus ff0b0000.ethernet-ffffffff: scan phy fixed-link at address 21
[    2.253063] mdio_bus ff0b0000.ethernet-ffffffff: scan phy fixed-link at address 22
[    2.260630] mdio_bus ff0b0000.ethernet-ffffffff: scan phy fixed-link at address 23
[    2.268197] mdio_bus ff0b0000.ethernet-ffffffff: scan phy fixed-link at address 24
[    2.275767] mdio_bus ff0b0000.ethernet-ffffffff: scan phy fixed-link at address 25
[    2.283335] mdio_bus ff0b0000.ethernet-ffffffff: scan phy fixed-link at address 26
[    2.290907] mdio_bus ff0b0000.ethernet-ffffffff: scan phy fixed-link at address 27
[    2.298475] mdio_bus ff0b0000.ethernet-ffffffff: scan phy fixed-link at address 28
[    2.306045] mdio_bus ff0b0000.ethernet-ffffffff: scan phy fixed-link at address 29
[    2.313611] mdio_bus ff0b0000.ethernet-ffffffff: scan phy fixed-link at address 30
[    2.321179] mdio_bus ff0b0000.ethernet-ffffffff: scan phy fixed-link at address 31
[    2.328806] macb ff0b0000.ethernet eth0: Cadence GEM rev 0x50070106 at 0xff0b0000 irq 30 (00:0a:35:00:02:90)
[    2.338430] Generic PHY fixed-0:00: attached PHY driver [Generic PHY] (mii_bus:phy_addr=fixed-0:00, irq=POLL)

It's still trying to search for PHY and finally attaches a generic PHY driver.

Any idea what's missing?

0 Kudos
Moderator
Moderator
209 Views
Registered: ‎09-12-2007

Re: using phy without MDIO

Can you check your clocks? Also, if you do a ifconfig, do you see tx/rx packets sent?

0 Kudos
Adventurer
Adventurer
203 Views
Registered: ‎08-04-2016

Re: using phy without MDIO

Yes, ifconfig shows both Tx and Rx packets being sent.

I tried tcpdump and tried ping to and from the FPGA. ARP packets are being received correctly. ARP packets are also being sent (according to the kernel) but the hardware seems to be dropping them. I thought this was an MDIO issue, isn't it?

It looks like phy-mode="maco" is not doing anything. What is the correct way to establish a MAC-MAC link?

0 Kudos
Adventurer
Adventurer
193 Views
Registered: ‎08-04-2016

Re: using phy without MDIO

I probed the Tx clk and the Tx data while pinging from the FPGA. Clock is 125 MHz and there's data on the RGMII bus. It looks like there's a problem with the switch (either hardware or driver).

0 Kudos
Scholar dpaul24
Scholar
179 Views
Registered: ‎08-07-2014

Re: using phy without MDIO

@rajatrao,

Can you view ALL THE PACKETS/FRAMES you sent fron the FPGA to PC (you can have a Wireshark running on the NIC to look for incoming packets)?

--------------------------------------------------------------------------------------------------------
FPGA enthusiast!
All PMs will be ignored
--------------------------------------------------------------------------------------------------------
0 Kudos
Highlighted
Adventurer
Adventurer
164 Views
Registered: ‎08-04-2016

Re: using phy without MDIO

@dpaul24 

I have wireshark running on my PC and  tcpdump running on the FPGA. On the FPGA, I can view ALL broadcast activity on the network. But on the PC, nothing sent from the FPGA is visible. Looks like the switch isn't sending the data out. 

0 Kudos