cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
ali88z
Participant
Participant
886 Views
Registered: ‎06-14-2019

How to support 2 eth in ultrascale+ linux?

Jump to solution

There are 2 eth(ethernet@ff0c0000 and ethernet@ff0d0000) on our board, but ethernet@ff0c0000 not work properly.
If I connect cable to ethernet@ff0d0000, disconnect ethernet@ff0c0000, bootargs=earlycon console=ttyPS0,115200 clk_ignore_unused root=/dev/nfs nfsroot=210.34.22.30:/home/zjw/nfsroot/nfsroot_xlnx ip=210.34.49.200:210.34.22.30:210.34.49.1:255.255.0.0::eth1:off rw debug, uboot download kernel from network OK, linux boot is OK, eth1 ping is OK, but eth0 not work, Look at Log1 for boot log and ifconfig.
If I connect cable to ethernet@ff0c0000, disconnect ethernet@ff0d0000, change eth1 in bootargs to eth0, uboot download kernel from network OK, linux boot failed waiting for network, Look at Log2 for boot log.
Because uboot network download are OK in both conditions, I think the hardware is OK, this is a software problem.
The mac I set for gem1(ethernet@ff0c0000) doesn't apply to the system, I don't know why...

Following are settings of my project, If you have any advices or you need more informations, please tell me, thanks.

1, In petalinux-config, I select Primary Ethernet (psu_ethernet_2).

2, In project-spec/meta-user/recipes-bsp/device-tree/files/system-user.dtsi, I add:
+&gem1 {
+ local-mac-address = [00 0a 35 00 22 aa];
+};

3, device tree settings (got by command: dtc -I dtb -O dts -o a.dts system.dtb)
ethernet@ff0c0000 {
compatible = "cdns,zynqmp-gem\0cdns,gem";
status = "okay";
interrupt-parent = < 0x04 >;
interrupts = < 0x00 0x3b 0x04 0x00 0x3b 0x04 >;
reg = < 0x00 0xff0c0000 0x00 0x1000 >;
clock-names = "pclk\0hclk\0tx_clk\0rx_clk\0tsu_clk";
#address-cells = < 0x01 >;
#size-cells = < 0x00 >;
#stream-id-cells = < 0x01 >;
iommus = < 0x0d 0x875 >;
power-domains = < 0x0c 0x1e >;
clocks = < 0x03 0x1f 0x03 0x69 0x03 0x2e 0x03 0x32 0x03 0x2c >;
phy-mode = "rgmii-id";
xlnx,ptp-enet-clock = < 0x00 >;
local-mac-address = [ 00 0a 35 00 22 aa ];
};
ethernet@ff0d0000 {
compatible = "cdns,zynqmp-gem\0cdns,gem";
status = "okay";
interrupt-parent = < 0x04 >;
interrupts = < 0x00 0x3d 0x04 0x00 0x3d 0x04 >;
reg = < 0x00 0xff0d0000 0x00 0x1000 >;
clock-names = "pclk\0hclk\0tx_clk\0rx_clk\0tsu_clk";
#address-cells = < 0x01 >;
#size-cells = < 0x00 >;
#stream-id-cells = < 0x01 >;
iommus = < 0x0d 0x876 >;
power-domains = < 0x0c 0x1f >;
clocks = < 0x03 0x1f 0x03 0x6a 0x03 0x2f 0x03 0x33 0x03 0x2c >;
phy-mode = "rgmii-id";
xlnx,ptp-enet-clock = < 0x00 >;
local-mac-address = [ 00 0a 35 00 22 01 ];
};

0 Kudos
1 Solution

Accepted Solutions
ali88z
Participant
Participant
778 Views
Registered: ‎06-14-2019

In project-spec/meta-user/recipes-bsp/device-tree/files/system-user.dtsi, I add:
+&gem1 {
+ local-mac-address = [00 0a 35 00 22 aa];
+};

The other mac is defined by petalinux-config in ethernet settings.

I have solved this problem, it's because I add some sdhc confs(copied from zcu106-reva) in dtsi which maybe wrong for my board. There's some pinctrl conf in it, maybe this is the problem, still checking.

Anyway, after I delete the wrong conf of sdhc, ifconfig shows eth0 and eth1 have same ip and mac. But I can change ip and mac of eth0 and ping is OK on both port. Don't know why the macs are same...

View solution in original post

0 Kudos
3 Replies
watari
Professor
Professor
825 Views
Registered: ‎06-16-2013

Hi @ali88z 

 

How do you define mac address ?

Since two ethernet use same mac address, it was occured.

Would you make sure it ?

 

Best regards,

 

0 Kudos
ali88z
Participant
Participant
779 Views
Registered: ‎06-14-2019

In project-spec/meta-user/recipes-bsp/device-tree/files/system-user.dtsi, I add:
+&gem1 {
+ local-mac-address = [00 0a 35 00 22 aa];
+};

The other mac is defined by petalinux-config in ethernet settings.

I have solved this problem, it's because I add some sdhc confs(copied from zcu106-reva) in dtsi which maybe wrong for my board. There's some pinctrl conf in it, maybe this is the problem, still checking.

Anyway, after I delete the wrong conf of sdhc, ifconfig shows eth0 and eth1 have same ip and mac. But I can change ip and mac of eth0 and ping is OK on both port. Don't know why the macs are same...

View solution in original post

0 Kudos
shirilt
Xilinx Employee
Xilinx Employee
762 Views
Registered: ‎05-15-2018

Hi @ali88z 

When using multiple ethernet interfaces, it is recommended that you force u-boot and linux to read the MAC address from on-board EEPROM, rather than that defined in the environment (using the device-tree or the petalinux-config menu). The reason for this is that, if the two ports have conflicting MAC addresses, it will lead to issues when the DHCP server tries to assign them an IP address.

To avoid the issue of the same MAC address (and a resulting conflict in the assigned IP address), I would suggest that you let u-boot read unique MAC address stored in the EEPROM. This will ensure that they get assigned unique IPs by the DHCP server as well, without the need of manually changing these addresses for one of the adapters on boot-up (as is required currently in your case).

---------------------------------------------------------------------------
Don’t forget to Reply, Kudo, and Accept as Solution.
---------------------------------------------------------------------------