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: 
Adventurer
Adventurer
4,784 Views
Registered: ‎10-17-2016

GEM3 on ZCU102 Rev1.0 can't connect to phy

I would like to use the GEM3 on my ZCU102 board. Since I upgraded to Petalinux 2017.2, I could not get linux to use the ethernet on GEM3:

u-boot can use the ethernet fine, pinging works, DHCP works:

U-Boot 2017.01 (Aug 17 2017 - 08:18:24 +0200) Xilinx ZynqMP ZCU102 rev1.0

I2C:   Error, wrong i2c adapter 0 max 0 possible
Error, wrong i2c adapter 0 max 0 possible
ready
DRAM:  4 GiB
EL Level:       EL2
Chip ID:        xczu9eg
MMC:   sdhci@ff170000: 0 (SD)
SF: Detected n25q512a with page size 512 Bytes, erase size 128 KiB, total 128 MiB
*** Warning - bad CRC, using default environment

Error, wrong i2c adapter 0 max 0 possible
Error, wrong i2c adapter 0 max 0 possible
In:    serial
Out:   serial
Err:   serial
Bootmode: LVL_SHFT_SD_MODE1
Net:   ZYNQ GEM: ff0e0000, phyaddr c, interface rgmii-id
eth0: ethernet@ff0e0000
U-BOOT for xfft17

ethernet@ff0e0000 Waiting for PHY auto negotiation to complete....... done
BOOTP broadcast 1
BOOTP broadcast 2
BOOTP broadcast 3
BOOTP broadcast 4
BOOTP broadcast 5
DHCP client bound to address 192.168.4.32 (3769 ms)


U-boot says the phy address is 0xC and that's exactly what I put in `system-user.dtsi`, resulting in the following plnxaarch64_system.dts

		ethernet@ff0e0000 {
			compatible = "cdns,zynqmp-gem";
			status = "okay";
			interrupt-parent = <0x4>;
			interrupts = <0x0 0x3f 0x4 0x0 0x3f 0x4>;
			reg = <0x0 0xff0e0000 0x0 0x1000>;
			clock-names = "pclk", "hclk", "tx_clk", "rx_clk";
			#address-cells = <0x1>;
			#size-cells = <0x0>;
			#stream-id-cells = <0x1>;
			iommus = <0x7 0x877>;
			power-domains = <0xf>;
			clocks = <0x3 0x1f 0x3 0x34 0x3 0x30 0x3 0x34>;
			phy-mode = "rgmii-id";
			xlnx,ptp-enet-clock = <0x0>;
			phy-handle = <0x10>;

			phy@c {
				compatible = "88e1118r";
				device_type = "ethernet-phy";
				reg = <0xc>;
				ti,rx-internal-delay = <0x8>;
				ti,tx-internal-delay = <0xa>;
				ti,fifo-depth = <0x1>;
				linux,phandle = <0x10>;
				phandle = <0x10>;
			};
		};


Still, during kernel boot, kernel says it can't find the phy:

[    0.218081] iommu: Adding device fd500000.dma to group 0
[    0.218233] iommu: Adding device fd510000.dma to group 1
[    0.218378] iommu: Adding device fd520000.dma to group 2
[    0.218520] iommu: Adding device fd530000.dma to group 3
[    0.218665] iommu: Adding device fd540000.dma to group 4
[    0.218809] iommu: Adding device fd550000.dma to group 5
[    0.218950] iommu: Adding device fd560000.dma to group 6
[    0.219092] iommu: Adding device fd570000.dma to group 7
[    0.219381] iommu: Adding device ffa80000.dma to group 8
[    0.219523] iommu: Adding device ffa90000.dma to group 9
[    0.219666] iommu: Adding device ffaa0000.dma to group 10
[    0.219809] iommu: Adding device ffab0000.dma to group 11
[    0.219954] iommu: Adding device ffac0000.dma to group 12
[    0.220099] iommu: Adding device ffad0000.dma to group 13
[    0.220242] iommu: Adding device ffae0000.dma to group 14
[    0.220387] iommu: Adding device ffaf0000.dma to group 15
[    0.220639] iommu: Adding device ff0e0000.ethernet to group 16
[    0.221210] iommu: Adding device ff0f0000.spi to group 17
[    0.221663] iommu: Adding device ff170000.sdhci to group 18

...
[    2.807643] libphy: MACB_mii_bus: probed
[    2.811508] mdio_bus ff0e0000.etherne:0c: mdio_device_register
[    2.821245] macb ff0e0000.ethernet eth0: no PHY found

Any ideas how to fix this?

Tags (3)
0 Kudos
7 Replies
Moderator
Moderator
4,780 Views
Registered: ‎08-25-2009

Re: GEM3 on ZCU102 Rev1.0 can't connect to phy

This seems fine. But I believe the phy-mode needs to be "sgmii" instead? Have you tried this?

"Don't forget to reply, kudo and accept as solution."
0 Kudos
Adventurer
Adventurer
4,750 Views
Registered: ‎10-17-2016

Re: GEM3 on ZCU102 Rev1.0 can't connect to phy

The phy-mode is set to `rgmii-id` automatically by Petalinux and it also matches the mode that u-boot uses.

I have tried changing it to sgmii by overwriting it in system-user.dtsi, but I did not succeed.

0 Kudos
Highlighted
Explorer
Explorer
4,733 Views
Registered: ‎03-09-2017

Re: GEM3 on ZCU102 Rev1.0 can't connect to phy

Can you share the system-user.dtsi file of yours?

0 Kudos
Adventurer
Adventurer
4,728 Views
Registered: ‎10-17-2016

Re: GEM3 on ZCU102 Rev1.0 can't connect to phy

Sure, please see the attached file..

0 Kudos
Adventurer
Adventurer
4,724 Views
Registered: ‎10-17-2016

Re: GEM3 on ZCU102 Rev1.0 can't connect to phy

When trying to set the phy-mode to sgmii:

&gem3 {
    phy-handle = <&phy0>;
    phy-mode = "sgmii";
    phy0: phy@c {
        compatible = "88e1118r";
        device_type = "ethernet-phy";
        reg = <0xc>;
        ti,rx-internal-delay = <0x8>;
        ti,tx-internal-delay = <0xa>;
        ti,fifo-depth = <0x1>;
    };
};

&smmu {
    status = "okay";
};
0 Kudos
Moderator
Moderator
4,705 Views
Registered: ‎09-12-2007

Re: GEM3 on ZCU102 Rev1.0 can't connect to phy

Can you use the BSP for the ZCU102 in Petalinux:

petalinux-create -t project -s <path/to/bsp>

https://www.xilinx.com/support/download/index.html/content/xilinx/en/downloadNav/embedded-design-tools.html
0 Kudos
Adventurer
Adventurer
4,672 Views
Registered: ‎10-17-2016

Re: GEM3 on ZCU102 Rev1.0 can't connect to phy

The BSP works, I can use ethernet with that image.

 

I have now adopted the changes to the device tree, it now looks like this:

ethernet@ff0e0000 {
    compatible = "cdns,zynqmp-gem";
    status = "okay";
    interrupt-parent = <0x4>;
    interrupts = <0x0 0x3f 0x4 0x0 0x3f 0x4>;
    reg = <0x0 0xff0e0000 0x0 0x1000>;
    clock-names = "pclk", "hclk", "tx_clk", "rx_clk";
    #address-cells = <0x1>;
    #size-cells = <0x0>;
    #stream-id-cells = <0x1>;
    iommus = <0x7 0x877>;
    power-domains = <0xf>;
    clocks = <0x3 0x1f 0x3 0x34 0x3 0x30 0x3 0x34>;
    phy-mode = "rgmii-id";
    xlnx,ptp-enet-clock = <0x0>;
    phy-handle = <0x10>;
    pinctrl-names = "default";
    local-mac-address = [00 0a 35 00 13 77];

    phy@c {
        reg = <0xc>;
        ti,rx-internal-delay = <0x8>;
        ti,tx-internal-delay = <0xa>;
        ti,fifo-depth = <0x1>;
        ti,rxctrl-strap-worka;
        linux,phandle = <0x10>;
        phandle = <0x10>;
    };
};

The PHY seems to work now, but here's the next error message...

INIT: Entering runlevel: 5
Configuring network interfaces... [    4.285131] macb ff0e0000.ethernet eth0: Unable to allocate DMA memory (error -12)
ifconfig: SIOCSIFFLAGS: Cannot allocate memory


Any ideas?

0 Kudos