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