• 0
Kampi

Ethernet for Zybo Linux

Question

Hello,

my ethernet for my Zybo doesn´t work with Linux. I use this linaro as my rootfs. Additional I follow these instructions to create my Design with all necessary files. My Linux boots up, but I got the message "no phy found".

I´ve update my device tree with this:

ZyboEthernet.dtsi

&gem0 
{
	#address-cells = <1>;
	#size-cells = <0>;
 	clock-names = "ref_clk", "aper_clk";
	clocks = <&clkc 13>, <&clkc 30>;
	compatible = "cdns,zynq-gem", "cdns,gem";
	interrupt-parent = <&intc>;
	interrupts = <0 22 4>;
	local-mac-address = [00 0a 35 00 00 00];
	phy-handle = <&phy0>;
	phy-mode = "rgmii-id";
	status = "okay";
	reg = <0xe000b000 0x1000>;
	xlnx,eth-mode = <0x1>;
	xlnx,has-mdio = <0x1>;
	xlnx,ptp-enet-clock = <111111115>;
	mdio {
		#address-cells = <1>;
		#size-cells = <0>;
		phy0: phy@1 {
			compatible = "realtek,RTL8211E";
			device_type = "ethernet-phy";
			reg = <1>;
			};
		};
};

Bootargs.dts

/include/ "system-top.dts"
/include/ "ZyboEthernet.dtsi"
/ {
	chosen {
		bootargs = "console=ttyPS0,115200n8 consoleblank=0 root=/dev/mmcblk0p2 rw rootwait earlyprintk";
		linux,stdout-path = "&uart1";
	};
};

How can I get my ethernet running?

Thank you for help!

Share this post


Link to post
Share on other sites

14 answers to this question

Recommended Posts

  • 0

Hello, 

thank you for your answer. Please take a look at "Ethernet.png" for my ethernet settings. I use the same as in this thread.

But I don´t have any ethernet interface when I use the "ip link show" command after booting linux.

root@linaro-developer:~# ip link show
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT                                                                                                                                                                                                                                   group default qlen 1
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: sit0@NONE: <NOARP> mtu 1480 qdisc noop state DOWN mode DEFAULT group default                                                                                                                                                                                                                                   qlen 1
    link/sit 0.0.0.0 brd 0.0.0.0
root@linaro-developer:~#

Should I make that MDIO-Port external?

Ethernet.png

BlockDesign.png

Share this post


Link to post
Share on other sites
  • 0

Hello, 

 

I connect MDIO to MIO 52 and 53 now.
IP link doesn´t show any interface

root@linaro-developer:~# ip link show
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: sit0@NONE: <NOARP> mtu 1480 qdisc noop state DOWN mode DEFAULT group default qlen 1
    link/sit 0.0.0.0 brd 0.0.0.0
root@linaro-developer:~#

And I get this messages:

Failed to start Raise network interfaces.
See 'systemctl status networking.service' for details.
[  OK  ] Reached target Network.

root@linaro-developer:~# systemctl status networking.service
● networking.service - Raise network interfaces
   Loaded: loaded (/lib/systemd/system/networking.service; enabled; vendor prese
  Drop-In: /run/systemd/generator/networking.service.d
           └─50-insserv.conf-$network.conf
   Active: failed (Result: exit-code) since Sat 2016-05-21 22:31:35 UTC; 1min 28
     Docs: man:interfaces(5)
 Main PID: 1787 (code=exited, status=1/FAILURE)

May 21 22:31:34 linaro-developer ifup[1787]: Cannot find device "eth0"
May 21 22:31:34 linaro-developer ifup[1787]: Failed to bring up eth0.
May 21 22:31:34 linaro-developer ntpdate[1907]: Can't find host 0.debian.pool.nt
May 21 22:31:34 linaro-developer ntpdate[1907]: Can't find host 1.debian.pool.nt
May 21 22:31:34 linaro-developer ntpdate[1907]: Can't find host 2.debian.pool.nt
May 21 22:31:34 linaro-developer ntpdate[1907]: Can't find host 3.debian.pool.nt
May 21 22:31:34 linaro-developer ntpdate[1907]: no servers can be used, exiting
May 21 22:31:35 linaro-developer systemd[1]: Failed to start Raise network inter
May 21 22:31:35 linaro-developer systemd[1]: networking.service: Failed with res
lines 1-17/17 (END)
root@linaro-developer:~# dmesg | grep ethernet
[    0.808309] macb e000b000.ethernet: failed to get macb_clk (4294967294)
[    0.813579] macb: probe of e000b000.ethernet failed with error -2

 

Share this post


Link to post
Share on other sites
  • 0

@Kampi

 

try to change your device fragment to this: 

&gem0 {
  phy-handle = <&ethernet_phy>;
  /* phy-reset-gpio = <&axi_gpio_eth 0 0>;
  phy-reset-active-low;
  phy-reset-duration = <10>; */
  ethernet_phy: ethernet-phy@1 { /* rtl8211e-vl */
  reg = <1>;
  device_type = "ethernet-phy";
  };
  };

 

and let me know if this helps.

 

This is linked from the Digilent Petalinux project for Zybo Z7-20, which is found here: https://github.com/Digilent/Petalinux-Zybo-Z7-20

Edited by morsucci

Share this post


Link to post
Share on other sites
  • 0

Hello,

thank you. The ethernet interface is working now, but I can´t ping the zybo from my PC. IP-address etc. should be ok, because I can ping another device if I plug the LAN-cable from the zybo into another device.

Is there anything else which can do "problems" and block my ping?

Share this post


Link to post
Share on other sites
  • 0

Hello,

the settings for my Zybo:

root@linaro-developer:~# ifconfig
eth0      Link encap:Ethernet  HWaddr 00:0a:35:00:01:22
          inet addr:192.168.178.160  Bcast:192.168.178.255  Mask:255.255.255.0
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
          Interrupt:146 Base address:0xb000

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:3054 errors:0 dropped:0 overruns:0 frame:0
          TX packets:3054 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1
          RX bytes:290010 (283.2 KiB)  TX bytes:290010 (283.2 KiB)

root@linaro-developer:~#

Please see the screenshots for my settings:

 

Netzwerk.png

Share this post


Link to post
Share on other sites
  • 0

Hi @Kampi,

I am not seeing anything that would cause a ping to not work. I would suggest using something like wireshark to see whats happening.

thank you,

Jon

Share this post


Link to post
Share on other sites
  • 0

Hello,

yes I think I have to test it with wireshark (will do it this week). The connection between Switch and PC works, because I have my raspberry pi connected with that switch and I can ping it (maybe I use an uplink port of that switch? Just an idea, i,ve got in this moment).

Share this post


Link to post
Share on other sites
  • 0

That problem is probably caused by using your own kernel build with the linaro rootfs, which was built for a specific kernel. You should be able to work around it by building any kernel modules you need while building your kernel (mark them as "m" in the Kconfig menu). Then you can manually install them into the correct /lib/modules/ folder. I'm not sure how to make the modules.dep.bin, but you may need to make one of those too. That will fix modprobe on your system, and hopefully iptables (if you build in whatever module iptables needs).

But I'm not convinced for certain that is your problem. Are you plugging ethernet directly from the board to the computer? Maybe try using a router or switch to connect the two devices. Also, are you using DHCP to assign an address to the board?

It is also possible that you broke something in the Vivado block diagram when you were changing the Zynq Ethernet and MDIO settings. Those should be set to match what gets set when you "run block automation" on a newly inserted Zynq PS IP core (Assuming you have vivado-boards installed and your project targets the Zybo board). If you are communicating successfully with other devices, it is likely this is not the problem.

Share this post


Link to post
Share on other sites
  • 0

Sorry for the late answer. I got my ethernet running now. I think my Yocto image was the key of the problem. With the Xilinx ramdisk example, the ethernet works well, so I create a new Yocto image today and now my ethernet works very with my new SD-Card image.

Thank you for help. If someone else needs a working image for the Zybo, please check my git project

https://github.com/Kampi/Zybo-Linux

There you will find all the necessary files.

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now