Ethernet (gem3) device tree config issue during bring up of kria k26c SOM on a custom carrier card

We got a Kria SOM board from digikey and are trying to do a board bring up with a custom carrier board (build based on Xilinx recommendation).
My aim is to boot from the SD card (currently controlled by a jumper pin on the carrier card) and
bring up a simple Linux on the k26c SOM as a starting point and then add my custom application.

Hardware design:
I started with creating my own hardware platform using Vivado 2021.2.
I have made sure that the MIO mapping are correct based on the schematic.

SD card - MIO 46-51
GEM (ethernet) - MIO 64-77

Please find images below.


I am able to generate a bit file, export the bitfile and generate an .xsa

Petalinux build:

Then I build the petalinux project (using petalinux 2021.2 version) based on the .xsa. Please find the steps below.
petalinux-create --type project --template zynqMP --name $PROJECT
petalinux-config -p $PROJECT --silentconfig --get-hw-description=my_project.xsa

modify the device tree to include the ethernet (gem) TI DP83867 and sdcard.

Please find below the system-user.dtsi

/include/ "system-conf.dtsi"
 #include <dt-bindings/input/input.h>
 #include <dt-bindings/gpio/gpio.h>
 #include <dt-bindings/pinctrl/pinctrl-zynqmp.h>
 #include <dt-bindings/phy/phy.h>
/ {
};
 
&gem3 { /* required by spec */
    status = "okay";
    pinctrl-names = "default";
    pinctrl-0 = <&pinctrl_gem3_default>;
    phy-handle = <&phy0>;
    phy-mode = "rgmii-id";
 
    mdio: mdio {
        #address-cells = <1>;
        #size-cells = <0>;
 
        phy0: ethernet-phy@1 {
            #phy-cells = <1>;
            reg = <1>;
            compatible = "ethernet-phy-id2000.a231";
            ti,rx-internal-delay = <0x8>;
            ti,tx-internal-delay = <0xa>;
            ti,fifo-depth = <0x01>;
            ti,dp83867-rxctrl-strap-quirk;
            reset-assert-us = <100>;
            reset-deassert-us = <280>;
            reset-gpios = <&gpio 38 1>;
        };
    };
};
 
&pinctrl0 { /* required by spec */
   status = "okay";
 
    pinctrl_gem3_default: gem3-default {
        conf {
            groups = "ethernet3_0_grp";
            slew-rate = <0x1>;
            power-source = <0x1>;
        };
 
        conf-rx {
            pins = "MIO70", "MIO72", "MIO74";
            bias-high-impedance;
            low-power-disable;
        };
 
        conf-bootstrap {
            pins = "MIO71", "MIO73", "MIO75";
            bias-disable;
            low-power-disable;
        };
 
        conf-tx {
            pins = "MIO64", "MIO65", "MIO66",
                "MIO67", "MIO68", "MIO69";
            bias-disable;
            low-power-enable;
        };
 
        conf-mdio {
            groups = "mdio3_0_grp";
            slew-rate = <0x1>;
            power-source = <0x1>;
            bias-disable;
        };
 
        mux-mdio {
            function = "mdio3";
            groups = "mdio3_0_grp";
        };
 
        mux {
            function = "ethernet3";
            groups = "ethernet3_0_grp";
        };
    };
};
 
&sdhci0 {
   no-1-8-v;
   //disable-wp;
};
 
&sdhci1 {
   status = "okay";
   no-1-8-v;
   disable-wp;
   broken-cd;
};
 
&i2c0 {
  eeprom: eeprom@50 {
     compatible = "atmel,24c08";
     reg = <0x50>;
  };

cp system-user.dtsi $PROJECT/project-spec/meta-user/recipes-bsp/device-tree/files/system-user.dtsi
cp system-user.dtsi $PROJECT/project-spec/meta-user/recipes-bsp/uboot-device-tree/files/system-user.dtsi

petalinux-build -p $PROJECT

I copied the resulting BOOT.BIN, image.ub and boot.scr into the SD card and try to start the board and below is what I observe.

 Xilinx Zynq MP First Stage Boot Loader
Release 2021.2   Oct 13 2021  -  07:15:53
NOTICE:  BL31: v2.4(release):xlnx_rebase_v2.4_2021.1_update1-23-g9188496b9
NOTICE:  BL31: Built : 07:41:24, Oct 13 2021


U-Boot 2021.01 (Oct 12 2021 - 09:28:42 +0000)

CPU:   ZynqMP
Silicon: v3
Board: Xilinx ZynqMP
DRAM:  4 GiB
PMUFW:  v1.1
EL Level:       EL2
Chip ID:        xck26
NAND:  0 MiB
MMC:   mmc@ff170000: 0
Loading Environment from FAT... *** Warning - bad CRC, using default environment

In:    serial
Out:   serial
Err:   serial
Bootmode: SD_MODE1
Reset reason:   EXTERNAL
Net:
**ZYNQ GEM: ff0e0000, mdio bus ff0e0000, phyaddr 1, interface rgmii-id**
**Could not get PHY for eth0: addr 1**
No ethernet found.

As you can see the last few lines indicate that it couldn’t get the PHY correctly.

ZYNQ GEM: ff0e0000, mdio bus ff0e0000, phyaddr 1, interface rgmii-id
Could not get PHY for eth0: addr 1
I am interested to know how to configure the phy correctly.

As of now, I am able to get the eth0 interface up, but unable to ping another machine in the subnet.
The ping just hangs

root@k26c_bringup:~# ping 192.168.16.1
PING 192.168.16.1 (192.168.16.1): 56 data bytes
^C
--- 192.168.16.1 ping statistics ---
57 packets transmitted, 0 packets received, 100% packet loss

Full log can be found below
k26som_build_log.txt (24.3 KB)

Any help will be greatly appreciated.

Quickly looking at your boot log… ( I don’t have the board on front of me… ) the build date of October looks suspect… it doesn’t appear that your u-boot changes where actually applied, built, nor even booted with.

Regards,

Hi @RobertCNelson, Thanks for your reply. Can you please clarify why the build date of October is of importance/relevance here? I have been configuring the u-boot with some parameters and they do appear to work as I expect. So, when your refer to u-boot changes are you referring specifically to the device tree changes or something else?

Thanks, Neels

Hi @neels , maybe I’m making an assumption? Reading your post, you modified the device tree for the phy? In which case u boot should have a more recent build date. Since u boot integrates the device tree into it’s build. In which case the October build date would be missing your modification…

Regards,

Hi @RobertCNelson,
Thanks for the clarification. Yes, I have made modification to the device tree of the K26 SOM to get the phy working. I am using Petalinux 2021.2 and I presume this version of petalinux uses U-boot 2021.01 (Oct 12 2021 - 09:28:42 +0000) version. I am not building U-boot from scratch, I am just using the u-boot provided the petalinux version 2021.2.

I also have a KV260 starter kit, whose carrier board uses exactly the same Phy and the same device tree modification. It uses an earlier/older version of U-boot (U-Boot 2020.01 (Apr 22 2021 - 17:47:18 +0000)) and the phy works fine in this case. Please find below the boot log for kv260 starter kit.

kv260_starter_kit_build_log.txt (11.7 KB)

This the reason why I am a confused if the changes I have made to the device tree (copied from linux-xlnx/zynqmp-sck-kv-g-revB.dts at master · Xilinx/linux-xlnx (github.com)) is indeed connected to a u-boot version. If this was the case then, I am surprised how the starter kit that is using an older version of the U-boot is working with the same device tree changes.

Are you suggesting, I should upgrade to the latest U-boot (so latest petalinux version 2022.1) ?

Thanks again for your help,
Neels

Hello,

Did you manage to boot Linux on k26 som with your custom carrier board?

I am currently working on solving the similar problem.

I have a question regarding modifying system-user.dtsi file. I have not done that in my project because I have checked system.dts (which decompiled system.dtb which was generated by petalinux tools) and I’ve seen that both ethernet and usb0 (which I need for booting linux) are enabled (status = “okay”).

Regardless, I cannot detect usb in the u-boot console.

Do you maybe know what is causing this problem?

Best regards!

Do you have usb enabled in u-boot? What port from the SOM are you using?

Regards,

Hello,

In schematic of the board, USB0 on zynqUltrascale+ is connected to the SD card slot on the board.

I have run command petalinux-config -c u-boot and confirmed that USB is enabled.

Since I’m using template zynqMP to make petalinux project I am not sure if I need to modify system-user.dtsi to somehow enable u-boot to “see” SD card. Based on the dts file generated by petalinux, usb0 peripheral is enabaled but again, I’m not sure what kind of information I should add in addition to that file.

Best regards!

What usb function are you trying to use?

Gadget driver?
CDC ethernet?
usb flash drive?

Or something else, as u-boot as a base “usb” enable, but you also need to enable the feature you want to use…

Regards,

Hi, In my case with regards to the ethernet controller, the phy address wasn’t correct. The phy address was based on strap configuration of the resistors which was different between kria carrier board and the custom carrier board. Changing the phy configuration solved the issue.

Besides looking at the status = “okay”, I would also suggest you look into other configuration that are crucial for the design to work. I would look at reference device tree configuration for usb from Xilinx, trenz and enclustra github to get a good understanding of what needs to be done. Also keep the PCB deisgner in the loop and suggest him review his design/layout with the reference design. Let me know it goes. Happy to help further if required.

Hello,

Thank you very much for responding!

I have a question regarding configuring system-user.dtsi: I saw in your original post that you copied your system-user.dts into two folders:
1.cp system-user.dtsi $PROJECT/project-spec/meta-user/recipes-bsp/device-tree/files/system-user.dtsi
2.cp system-user.dtsi $PROJECT/project-spec/meta-user/recipes-bsp/uboot-device-tree/files/system-user.dtsi

I have tried doing the same, but for me (I’m using PetaLinux 2022.2) there is no second folder. There is something similar on the following path:
$PROJECT/project-spec/meta-user/recipes-bsp/meta-xilinx-tools/uboot-device-tree/files/system-user.dtsi

I haven’t been able to find if that folder is version specific or not.

Also, is there a reason for copying the system-user.dtsi file on those two locations?

Thank you in advance!

Hi,
Sure you are welcome.
From memory, I copied the system-user.dtsi to two places because there was a device tree required for uboot and one for the general linux system.
Moreover, my build was using Vivado 2021.2 and petalinux 2021.2 toolchain.
So you will have to check what things have changed in petalinux between 2021.2 and 2022.2 toolchain.

HTH

Hello again,

Are you, by any chance, using USB5744 hub on your board. That seems to be the problem for me as I can’t reset it.

Best regards

Sorry for the delay, I am not using the USB5744 hub on my board.