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 wama104
Observer
421 Views
Registered: ‎05-09-2018

Two separated device trees for u-boot and petalinux-kernel

Hello,

I have a customed board with has 4 ethernets and all 4 ethernets share one mdio bus. To use more then one ethernet with one mdio bus xilinx provides an patch "0001-net-macb-Add-MDIO-driver-for-accessing-multiple-PHY-.patch" which I have applied to the linux kernel und I can use all 4 ethernets under linux using this system-user.dtsi device tree
/include/ "system-conf.dtsi"
/ {


 mdio: mdio@ff0d0000 {
  compatible = "cdns,macb-mdio";
  reg = <0x0 0xff0d0000 0x0 0x1000>;
  status = "okay";
  clock-names = "pclk", "hclk", "tx_clk", "rx_clk";
  clocks = <0x03 0x1f 0x03 0x31 0x03 0x2d 0x03 0x31 0x03 0x2c>;

 


  #address-cells = <1>;
  #size-cells = <0>;
  phy0: ethernet-phy@5 {
   reg = <0x5>;
   ti,rx-internal-delay = <0x8>;
   ti,tx-internal-delay = <0x4>;
   ti,fifo-depth = <0x1>;
  };
  phy1: ethernet-phy@6 {
   reg = <0x6>;
   ti,rx-internal-delay = <0x4>;
   ti,tx-internal-delay = <0x4>;
   ti,fifo-depth = <0x1>;
  };
  phy2: ethernet-phy@9 {
   reg = <0x9>;
   ti,rx-internal-delay = <0x4>;
   ti,tx-internal-delay = <0x4>;
   ti,fifo-depth = <0x1>;
  };
  phy3: ethernet-phy@a {
   reg = <0xa>;
   ti,rx-internal-delay = <0x8>;
   ti,tx-internal-delay = <0x4>;
   ti,fifo-depth = <0x1>;
  };
  gmiitorgmii1: ethernet-phy@1 {
   compatible = "xlnx,gmii-to-rgmii-1.0";
   reg = <1>;
   phy-handle = <&phy3>;
  };
  gmiitorgmii2: ethernet-phy@2 {
   compatible = "xlnx,gmii-to-rgmii-1.0";
   reg = <2>;
   phy-handle = <&phy2>;
  };
 };

};

&gem0 {
        status = "okay";
        phy-mode = "rgmii-id";
        phy-handle = <&phy3>;
};


&gem1 {
        status = "okay";
        phy-mode = "rgmii-id";
        phy-handle = <&phy2>;
};


&gem2 {
        status = "okay";
        phy-mode = "rgmii-id";
        phy-handle = <&phy0>;
};

&gem3 {
        status = "okay";
        phy-mode = "rgmii-id";
        phy-handle = <&phy1>;
};


Now I'm going to try to boot the kernel over TFTP but it does not work. No Ehtnert port was detectect. I found out, that U-Boot use the same device tree as the Petalinux kernel does but U-boot can not handel the device-tree entries for the "0001-net-macb-Add-MDIO-driver-for-accessing-multiple-PHY-.patch" patch in the system-user.dtsi file.

So my question is:
Is there any possibility to have a separated device tree for U-Boot and another device tree for petalinux.
Which petalinux config options have to be selectect und where are the device trees are located?

Thank a lot
Marco

0 Kudos
3 Replies
Moderator
Moderator
326 Views
Registered: ‎12-04-2016

Re: Two separated device trees for u-boot and petalinux-kernel

Hi Marco

In petalinux, we have a seperate recipes for linux kernel and uboot. You don't normally see any conflicts.

Alternatively, you can let petalinux to point to external uboot and linux kernel source codes for your requirements. More details on its usage on page 105 of UG1144

https://www.xilinx.com/support/documentation/sw_manuals/xilinx2018_3/ug1144-petalinux-tools-reference-guide.pdf

 

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

Re: Two separated device trees for u-boot and petalinux-kernel

Issue here is that the common mdio is not supportedin uboot, but it is in lINUX.

You can try create the u-boot image seperately:

 

https://xilinx-wiki.atlassian.net/wiki/spaces/A/pages/18841722/ZCU102+Image+creation+in+OSL+flow

Build u-boot

Here, you can pick a defconfig that matches your configuration, or create a custom one.

You can update the devicetree here with just one GEM node :

u-boot-xlnx\arch\arm\dts

Oncethis builds, you can add this to the images/linux folder in Petalinux, and use the petalinux-package command to create the BOOT.BIN

You can use u-boot to boot the kernel (with the common mdio support) either from the SD card/QSPI, or over TFTP

 

0 Kudos
Scholar mrbietola
Scholar
67 Views
Registered: ‎05-31-2012

Re: Two separated device trees for u-boot and petalinux-kernel

 u-boot doesn't support multiple phy on 1 mdio also in 2019.2?

i'm using the macb driver for linux and everything is ok, but in u-boot i can't use ethernet even if all the phy are correctly detected, i can read the registers.

I found an old patch for u-boot but i don't know the device tree is expecting and the functions are different now.

Could you help me?

0 Kudos