Trenz Electronic GmbH Support Forum

Trenz Electronic Products => Trenz Electronic FPGA Modules => Topic started by: mmalone_jhuapl on September 18, 2019, 05:34:23 PM

Title: TE0729 PL Ethernet
Post by: mmalone_jhuapl on September 18, 2019, 05:34:23 PM
We are currently using the TE0729 with intentions of running a Linux environment. The reference design has been successfully flashed to the board and all Ethernet interfaces come up (GEM0 at boot, ETH1 and ETH2 manual).
We have need to only use the GEM0 and ETH1 interfaces on the PS and reserve ETH2 for applications running on the PL (the two are approximately independent). The changes are made in Vivado, imported into a Petalinux environment, and rebuilt. The resulting BOOT image loads just fine and the kernel operates as expected, and GEM0 comes up without issue. However, when we attempt to manually bring up ETH1 the kernel crashes (no debug to post for this).
Project Created with: PetaLinux 2017.1; Vivado 2017.1
The device tree we are using (modifications made in  <project_location>/project-spec/meta-user/recipes-bsp/device-tree/files/system-user.dtsi)

/include/ "system-conf.dtsi"
/ {
};

/ {
   aliases {
      ethernet0 = &gem0;
      ethernet1 = &axi_ethernetlite_0;
      serial0 = &uart0;
      serial1 = &uart1;
      spi0 = &qspi;
   };
};

/* QSPI PHY */
&qspi {
    #address-cells = <1>;
    #size-cells = <0>;
    status = "okay";
    flash0: flash@0 {
        compatible = "jedec,spi-nor";
        reg = <0x0>;
        #address-cells = <1>;
        #size-cells = <1>;
    };
};


/* ETH PHY */
&gem0 {
    phy-handle = <&phy0>;
    phy-mode = "rgmii-id";
    status = "okay";
    mdio {
        #address-cells = <1>;
        #size-cells = <0>;
        phy0: phy@0 {
            compatible = "marvell,88e1510";
            device_type = "ethernet-phy";
            reg = <0>;
        };
    };
};

/* AXI ETH PHY0 */

&axi_ethernetlite_0 { 
    local-mac-address = [00 0a 35 00 22 02]; 
    phy-handle = <&phy1>; 
    xlnx,has-mdio = <0x1>; 
    mdio { 
        #address-cells = <1>; 
        #size-cells = <0>; 
        phy1: phy@1 { 
            device_type = "ethernet-phy"; 
            reg = <1>; 
        }; 
    }; 
};


/* RTC */
&i2c0 {
    rtc@6F {        // Real Time Clock
       compatible = "isl12022";
       reg = <0x6F>;
   };
};

/* USB PHY */

/{
    usb_phy0: usb_phy@0 {
        compatible = "ulpi-phy";
        //compatible = "usb-nop-xceiv";
        #phy-cells = <0>;
        reg = <0xe0002000 0x1000>;
        view-port = <0x0170>;
        drv-vbus;
    };
};

&usb0 {
    dr_mode = "host";
    //dr_mode = "peripheral";
    usb-phy = <&usb_phy0>;
};


There are no other changes that we're made. Do you have any insight into this issue?
Title: Re: TE0729 PL Ethernet
Post by: JH on September 19, 2019, 11:22:25 AM
Hi,
your device tree looks good.
It's like on our reference design, excepted the second eth phy on pl.
Changes, we have done on our 18.2 reference design: https://wiki.trenz-electronic.de/display/PD/TE0729+Test+Board#TE0729TestBoard-DeviceTree

So if reference design works, HW is ok.

At first I would recommend to change also to 18.2. Because Xilinx has change petalinux build environment with 16.4, so 17.1 was not the best version to create your design.

Did you regenerate all files with your new Vivado Design and the exported HDF? Means also FSBL?

How did you regenerate your linux with 2 ETH only. Only import new HDF and build again? or did you run clear process before? or did you create a new project with HDF and add your device tree, kernel changes..?

br
John
Title: Re: TE0729 PL Ethernet
Post by: mmalone_jhuapl on September 19, 2019, 05:00:10 PM
Hello,

The hardware seems to be alright, I would agree. The kernel is able to probe the MDIO bus of the single PL ethernet without issue and is present when calling >"ifconfig -a" as well as >"ip link". The issue is that any configuration of the PL ethernet causes some sort of kernel panic and the system crashes entirely. My thoughts were that the phy-handle in the device tree was the issue but after trying many permutations with no results I am without a lead.

The new HDF that was generated using only two ETHs was imported into the existing reference design and the following rebuild process was implemented:
petalinux-build -x mrproper
petalinux-config --get-hw-description
petalinux-build -c fsbl
petalinux-build

We will upgrade to 2018.2 and let you know of the outcome and if the issue persists.

Thanks,
Mitch
Title: Re: TE0729 PL Ethernet
Post by: mmalone_jhuapl on September 19, 2019, 08:53:50 PM
Hello again,

Upgrading to 2018.2 fixed the issue. No changes to device tree or configs was necessary in the Petalinux project to get it up and running.
Thanks again for your reply.

Regards,
Mitch
Title: Re: TE0729 PL Ethernet
Post by: JH on September 20, 2019, 08:19:10 AM
Hello,
good to hear that it works now.
QuoteUpgrading to 2018.2 fixed the issue.
yes this can happens sometime device tree is not always interpreted in the same way during the petalinux versions. Sometimes you need also kernel patches, when you use more than one ETH, especially when you share MDIO bus.
br
John