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
3,506 Views
Registered: ‎07-11-2018

Ethernet issues Petalinux 2018.1 (u-boot andd Kernel)

Jump to solution

Hi,

I am testing Ethernet on PL side, (Zynq 7020, 2018.1 ) when I try to read the register from PL side it gets hanged and from PS side able to read it. Should I make any changes in device tree to read the register values for u-boot and kernel device tree files. How to get conformed that Ethernet driver is enabled in u-boot and kernel using Petalinux environment.

 

If I need to debug using the source should use the source from  build/tmp folder?

 

Please suggest.

 

Thanks

Umamahesh

0 Kudos
1 Solution

Accepted Solutions
Moderator
Moderator
3,429 Views
Registered: ‎08-25-2009

Re: Ethernet issues Petalinux 2018.1 (u-boot and Kernel)

Jump to solution

Hi @umamahesh,

 

Can you use devmem to write to registers instead of modifying the driver codes to check the loopback?

I have reviewed again the threads and the issue really looks like a customer board or PHY specific issue to me.

Please note that you should keep the address at which phy is actually detected. (still getting quite confused with the phy address in your DTS)

 

If it negotiated at 10Mbps, the autoneg probably failed and fell back to the default. Common bring up issues include RX and TX delay tuning in the PHY or on board. We talk about this a little bit on our wiki page:

http://www.wiki.xilinx.com/Macb+Driver

"Don't forget to reply, kudo and accept as solution."

View solution in original post

0 Kudos
27 Replies
Moderator
Moderator
3,484 Views
Registered: ‎09-12-2007

Re: Ethernet issues Petalinux 2018.1 (u-boot andd Kernel)

Jump to solution

How are you reading the resister? Is the PL programmed correctly, are you programming from the uboot/linux, or via the FSBL (devcfg). Are you reading the correct register, this would hang the kernel otherwise.

 

You can try this in XSCT. Boot as far a uboot, then launch the XSCT (you need a JTAG cable connected and a HW_SERVER running). Then in XSCT do the following:

connect

targets -set -filter {name =~ "Cortex-A53 #0"}

stop

mrd <register you want to read>

 

Does this hang too. If so, its likely a HW issue

0 Kudos
Adventurer
Adventurer
3,469 Views
Registered: ‎07-11-2018

Re: Ethernet issues Petalinux 2018.1 (u-boot andd Kernel)

Jump to solution
md.l <addr>
0 Kudos
Adventurer
Adventurer
3,451 Views
Registered: ‎07-11-2018

Re: Ethernet issues Petalinux 2018.1 (u-boot and Kernel)

Jump to solution

Hi

 

I booted BOOT.BIN using sd card and now I am able to read PHY register values, please check the log below

 

U-Boot 2018.01 (Aug 01 2018 - 19:52:08 +0530) Xilinx Zynq ZC702

Model: Zynq ZC702 Development Board
Board: Xilinx Zynq
Silicon: v3.1
I2C:   ready
DRAM:  ECC disabled 512 MiB
MMC:   sdhci@e0100000: 0 (SD)
SF: Detected s25fl512s_256k with page size 512 Bytes, erase size 256 KiB, total 64 MiB
*** Warning - bad CRC, using default environment

In:    serial@e0000000
Out:   serial@e0000000
Err:   serial@e0000000
Model: Zynq ZC702 Development Board
Board: Xilinx Zynq
Silicon: v3.1
Net:   ZYNQ GEM: e000b000, phyaddr 3, interface rgmii-id
eth0: ethernet@e000b000
U-BOOT for xilinx-zc702-2018_1

ethernet@e000b000 Waiting for PHY auto negotiation to complete......... TIMEOUT !
Hit any key to stop autoboot:  0
Zynq>
Zynq>
Zynq>
Zynq>
Zynq>
Zynq> mii dump 3 1
1.     (7949)                 -- PHY status register --
  (8000:0000) 1.15    =     0    100BASE-T4 able
  (4000:4000) 1.14    =     1    100BASE-X  full duplex able
  (2000:2000) 1.13    =     1    100BASE-X  half duplex able
  (1000:1000) 1.12    =     1    10 Mbps    full duplex able
  (0800:0800) 1.11    =     1    10 Mbps    half duplex able
  (0400:0000) 1.10    =     0    100BASE-T2 full duplex able
  (0200:0000) 1. 9    =     0    100BASE-T2 half duplex able
  (0100:0100) 1. 8    =     1    extended status
  (0080:0000) 1. 7    =     0    (reserved)
  (0040:0040) 1. 6    =     1    MF preamble suppression
  (0020:0000) 1. 5    =     0    A/N complete
  (0010:0000) 1. 4    =     0    remote fault
  (0008:0008) 1. 3    =     1    A/N able
  (0004:0000) 1. 2    =     0    link status
  (0002:0000) 1. 1    =     0    jabber detect
  (0001:0001) 1. 0    =     1    extended capabilities

 

Zynq> mii dump 3 0
0.     (1140)                 -- PHY control register --
  (8000:0000) 0.15    =     0    reset
  (4000:0000) 0.14    =     0    loopback
  (2040:0040) 0. 6,13 =   b10    speed selection = 1000 Mbps
  (1000:1000) 0.12    =     1    A/N enable
  (0800:0000) 0.11    =     0    power-down
  (0400:0000) 0.10    =     0    isolate
  (0200:0000) 0. 9    =     0    restart A/N
  (0100:0100) 0. 8    =     1    duplex = full
  (0080:0000) 0. 7    =     0    collision test enable
  (003f:0000) 0. 5- 0 =     0    (reserved)

 

Zynq> mii dump 3 2
2.     (0022)                 -- PHY ID 1 register --
  (ffff:0022) 2.15- 0 =    34    OUI portion


Zynq> mii dump 3 3
3.     (1622)                 -- PHY ID 2 register --
  (fc00:1400) 3.15-10 =     5    OUI portion
  (03f0:0220) 3. 9- 4 =    34    manufacturer part number
  (000f:0002) 3. 3- 0 =     2    manufacturer rev. number

 

Zynq> mw.l 0x43c00048 0xabababab
Zynq> md.l 0x43c00048 1
43c00048: abababab                               ....
Zynq> md.l 0x43c00008 1
43c00008: abababab

 

I am sure if it selecting correct driver, as I don't find the u-boot source in petalinux. Also when run following

 

Zynq> mii dev      
MII devices: 'eth0'
Current device: 'eth0'

 

Current device shows eth0, please suggest if it selected proper driver. Also how could I build u-boot externally from petalinux, I cloned u-boot separately under component folder and given external path in petalinux configuration. After petalinux-build I don't see the cloned package compiled or images getting updated to current time.

 

Whether ethernet driver should be macb or gem0 driver? Please suggest, looking for immediate response.

 

Thanks

Umamahesh

0 Kudos
Moderator
Moderator
3,391 Views
Registered: ‎08-25-2009

Re: Ethernet issues Petalinux 2018.1 (u-boot and Kernel)

Jump to solution

Hi @umamahesh,

 

Can you please confirm the setup you have? Are you connecting GEM with PCS/PMA or SGMII core on PL? Or you are using AXI Ethernet subsystem core on PL? Are you connecting an on board PHY or using SFP? From the log, it looks like MACB driver is picked up. We provide macb driver for GEMs in Linux.

 

Could you please send your entire DTS file?

Have you tried in Linux if that is up and running OK?

You may also try a loopback and see if that works.

"Don't forget to reply, kudo and accept as solution."
0 Kudos
Adventurer
Adventurer
3,331 Views
Registered: ‎07-11-2018

Re: Ethernet issues Petalinux 2018.1 (u-boot and Kernel)

Jump to solution

Hi

Sorry for delay response due to system crash. I am using Enclustra Mars ZX2 board and booting from SD card.

PFA dts and hdf file for reference.

 

Linux booting also getting stuck when booting from SD card.

 

Please suggest.

 

 

Thanks

Umamahesh

0 Kudos
Moderator
Moderator
3,324 Views
Registered: ‎08-25-2009

Re: Ethernet issues Petalinux 2018.1 (u-boot and Kernel)

Jump to solution

Hi @umamahesh,

 

Can you please still let me know your board setup? From the DTS,   I see:

 

&gem0 {
 u-boot,dm-pre-reloc;
 status = "okay";
 phy-handle = <&ethernet_phy>;
 phy-mode = "rgmii-id";
 ethernet_phy: ethernet-phy@7 {
  reg = <3>;
 };

 

Do you have RGMII PHY attached to GEM0 through MIO? The PHY reg does not seem to be setup correctly, I would expect to see "reg = <7>" to match "@7"

 

"Don't forget to reply, kudo and accept as solution."
0 Kudos
Adventurer
Adventurer
3,318 Views
Registered: ‎07-11-2018

Re: Ethernet issues Petalinux 2018.1 (u-boot and Kernel)

Jump to solution

Hi

 

I missed to comment in my previous post, it is connected to GEM0 and I am supposed to use ethernet-phy@3 with reg = <3>, but the dts file generated has 7, when I rename it to @3  it gives me compilation errors. Is there any procedure to change 7 to 3 without compilation error.

 

Please suggest.

 

Thanks

Umamahesh

 

 

0 Kudos
Moderator
Moderator
3,306 Views
Registered: ‎08-25-2009

Re: Ethernet issues Petalinux 2018.1 (u-boot and Kernel)

Jump to solution

Hi @umamahesh,

 

What is the compilation error? Could you please send more details here? We should not expect to see any errors.

 

"Don't forget to reply, kudo and accept as solution."
0 Kudos
Adventurer
Adventurer
3,295 Views
Registered: ‎07-11-2018

Re: Ethernet issues Petalinux 2018.1 (u-boot and Kernel)

Jump to solution

Hi

 

Please find below log for reference. This error is after changing @7  to @3 in the dtsi file shared to you yesterday.

 

Loading cache: 100% |##########################################################################################################| Time: 0:00:05
Loaded 3418 entries from dependency cache.
Parsing recipes: 100% |########################################################################################################| Time: 0:00:24
Parsing of 2544 .bb files complete (2506 cached, 38 parsed). 3420 targets, 144 skipped, 0 masked, 0 errors.
NOTE: Resolving any missing task queue dependencies
Initialising tasks: 100% |#####################################################################################################| Time: 0:00:33
Checking sstate mirror object availability: 100% |#############################################################################| Time: 0:01:12
NOTE: Executing SetScene Tasks
NOTE: Executing RunQueue Tasks
ERROR: device-tree-xilinx+gitAUTOINC+682c126ef6-r0 do_compile: Function failed: do_compile (log file is located at /home/vestas/petalinux/test/build/tmp/work/zc702_zynq7-xilinx-linux-gnueabi/device-tree/xilinx+gitAUTOINC+682c126ef6-r0/temp/log.do_compile.23045)
ERROR: Logfile of failure stored in: /home/vestas/petalinux/test/build/tmp/work/zc702_zynq7-xilinx-linux-gnueabi/device-tree/xilinx+gitAUTOINC+682c126ef6-r0/temp/log.do_compile.23045
Log data follows:
| DEBUG: Executing shell function do_compile
| system-top.dtb: ERROR (duplicate_label): Duplicate label 'ethernet_phy' on /amba/ethernet@e000b000/ethernet-phy@3 and /amba/ethernet@e000b000/ethernet-phy@7
| ERROR: Input tree has errors, aborting (use -f to force output)
| WARNING: /home/vestas/petalinux/test/build/tmp/work/zc702_zynq7-xilinx-linux-gnueabi/device-tree/xilinx+gitAUTOINC+682c126ef6-r0/temp/run.do_compile.23045:1 exit 2 from 'dtc -I dts -O dtb -R 8 -p 0x1000 -b 0 -i /home/vestas/petalinux/test/build/../components/plnx_workspace/device-tree/device-tree -i /home/vestas/petalinux/test/build/tmp/work-shared/zc702-zynq7/kernel-source/include -i /home/vestas/petalinux/test/build/tmp/work-shared/zc702-zynq7/kernel-source/include -i /home/vestas/petalinux/test/build/tmp/work/zc702_zynq7-xilinx-linux-gnueabi/device-tree/xilinx+gitAUTOINC+682c126ef6-r0 -o ${DTS_NAME}.dtb `basename ${DTS_FILE}`.pp'
| ERROR: Function failed: do_compile (log file is located at /home/vestas/petalinux/test/build/tmp/work/zc702_zynq7-xilinx-linux-gnueabi/device-tree/xilinx+gitAUTOINC+682c126ef6-r0/temp/log.do_compile.23045)
ERROR: Task (/home/vestas/petalinux/2018.1/installation/components/yocto/source/arm/layers/meta-xilinx/meta-xilinx-bsp/recipes-bsp/device-tree/device-tree.bb:do_compile) failed with exit code '1'
NOTE: Tasks Summary: Attempted 2048 tasks of which 2040 didn't need to be rerun and 1 failed.

Summary: 1 task failed:
  /home/vestas/petalinux/2018.1/installation/components/yocto/source/arm/layers/meta-xilinx/meta-xilinx-bsp/recipes-bsp/device-tree/device-tree.bb:do_compile
Summary: There was 1 WARNING message shown.
Summary: There was 1 ERROR message shown, returning a non-zero exit code.
ERROR: Failed to build project

 

Please suggest. Is there any issues in the dtsi file shared to you even Linux is not loading completely it got stuck at

 

zynq-pinctrl 700.pinctrl:zynq pinctrl initialized

 

Thanks

Umamahesh

0 Kudos
Moderator
Moderator
3,313 Views
Registered: ‎08-25-2009

Re: Ethernet issues Petalinux 2018.1 (u-boot and Kernel)

Jump to solution

Hi @umamahesh,

 

In your message, I see:

 

| system-top.dtb: ERROR (duplicate_label): Duplicate label 'ethernet_phy' on /amba/ethernet@e000b000/ethernet-phy@3 and /amba/ethernet@e000b000/ethernet-phy@7
| ERROR: Input tree has errors, aborting (use -f to force output)

 

Can you please try with a completely clean build from scratch to see if you still see the issue?

"Don't forget to reply, kudo and accept as solution."
0 Kudos
Adventurer
Adventurer
3,305 Views
Registered: ‎07-11-2018

Re: Ethernet issues Petalinux 2018.1 (u-boot and Kernel)

Jump to solution

Yup. Even after the clean build the issue persists.

0 Kudos
Moderator
Moderator
3,285 Views
Registered: ‎08-25-2009

Re: Ethernet issues Petalinux 2018.1 (u-boot and Kernel)

Jump to solution

Hi @umamahesh,

 

Can you please try to build the device tree in isolation. Here is the wiki page for help:

http://www.wiki.xilinx.com/ZCU102+Image+creation+in+OSL+flow

 

Please clean the copponents folder in petalinux

  • rm -rf components/plnx_workspace

Make sure that there is no other dtsi files being added to the DT unknowingly in the devicetree recipe. There should just be one system-user.dtsi. It looks like somewhere there is a duplicate occurring on your end.

"Don't forget to reply, kudo and accept as solution."
0 Kudos
Adventurer
Adventurer
3,281 Views
Registered: ‎07-11-2018

Re: Ethernet issues Petalinux 2018.1 (u-boot and Kernel)

Jump to solution

Hi Nanz,

 

Thanks for the reply, before I try the procedure suggested. Please correct what I have appended in dtsi file is correct.

 

When the package is build, under project-spec/meta-user/../system-user.dtsi  contains only the following

/include/ "sÿstem-conf.dtsi"

/{

};

 

I copied the zc702.dtsi (components/plnx_workspace/device-tree/device-tree) and added uart0 similar to uart1, also changed reg<7> to reg<3> and removed other interfaces like can etc. It is right way doing, please suggest.

 

Thanks

Umamahesh

0 Kudos
Highlighted
Moderator
Moderator
3,266 Views
Registered: ‎08-25-2009

Re: Ethernet issues Petalinux 2018.1 (u-boot and Kernel)

Jump to solution

Hi  @umamahesh,

 

Do you mean you are copying zc702.dtsi into your system.dtsi file? Your steps seem to be correct. All modification should be done in system-user.dtsi file.

"Don't forget to reply, kudo and accept as solution."
0 Kudos
Adventurer
Adventurer
3,261 Views
Registered: ‎07-11-2018

Re: Ethernet issues Petalinux 2018.1 (u-boot and Kernel)

Jump to solution
Yes, by default zc702.dtsi has ethernet-phy@7 and I am trying to do what you suggested yesterday.
0 Kudos
Adventurer
Adventurer
3,209 Views
Registered: ‎07-11-2018

Re: Ethernet issues Petalinux 2018.1 (u-boot and Kernel)

Jump to solution

Hi

 

Still I face difficulties in bringing up the Ethernet interface. I made  changes in system-user.dtsi as shown

 

&gem0 {
        status = "okay";
        phy-handle = <&ethernet_phy>;
        phy-mode = "rgmii-id";
        pinctrl-names = "default";
        pinctrl-0 = <&pinctrl_gem0_default>;
        phy-reset-gpio = <&gpio0 11 0>;
        phy-reset-active-low;
        som:ethernet-phy@3 {
                reg = <3>;
                device_type = "ethernet-phy";
        };
};

 

it compiles successfully, but in the target phyaddr shows as 7, when I replace @3  to @7   then the phyaddr is detected correctly to 3.

 

I proceeded with @7 in the dtsi, once linux is booted using ethtool I made autoneg to off as link detection always no.

 

I tested with various speed 10,100,1000 half/full duplex. Only 10 Mbps half/full duplex I get link detection to yes. Further when I ping to someother PC it is failing. Any suggestions please.

 

0 Kudos
Moderator
Moderator
3,203 Views
Registered: ‎08-25-2009

Re: Ethernet issues Petalinux 2018.1 (u-boot and Kernel)

Jump to solution

Hi @umamahesh,

 

I am really confused about the phy address here. What is the address on your custom board? Why you have to proceed to with @7?

 

Can you please send me the most recent Linux bootlog file to have a look? When you do "ifconfig -a", what does it show? When you say it's running at 10Mbps, can you get the ping to work at this speed?

"Don't forget to reply, kudo and accept as solution."
0 Kudos
Adventurer
Adventurer
3,196 Views
Registered: ‎07-11-2018

Re: Ethernet issues Petalinux 2018.1 (u-boot and Kernel)

Jump to solution

Hi Nanz,

The phy address on the custom board is 3( using Enclustra Mars ZX2 board), since I am using petalinux build by default it is 7 and logs, system-user.dtsi is attached for your reference. In the current dtsi file even if I change @7 to @3 I don't get duplicate errors as indicated before. But if I change to @3  when the board boots up phy addr is detected as 7 and if I maintain @7 by default the phyaddr is detected correctly as 3, for reference please see the attached logs.

 

Currently the link status in ethtool is no for auto negotiation and for only 10Mbps full/half duplex configuration the link detection is yes and for rest of the speeds the link detection is NO.

 

Current the board is directly connected to PC and both are configured to 10 Mbps full duplex and when I do ping test there is no ICMP packets or ping test fails. PHY chip used is Micrel 9301 and the corresponding driver is detected during boot up.

I am statically setting the IP address and same static IP is configured in PC. The same tried in Windows PC for testing but ping test fails.

 

Please suggest.

 

 

 

 

0 Kudos
Moderator
Moderator
3,192 Views
Registered: ‎08-25-2009

Re: Ethernet issues Petalinux 2018.1 (u-boot and Kernel)

Jump to solution

Hi @umamahesh,

 

From the bootlog, it looks like that the generic PHY driver has been picked up.

macb e000b000.ethernet eth0: Cadence GEM rev 0x00020118 at 0xe000b000 irq 28 (00:0a:35:00:1e:53)
Generic PHY e000b000.ethernet-ffffffff:03: attached PHY driver [Generic PHY] (mii_bus:phy_addr=e000b000.ethernet-ffffffff:03, irq=POLL)

Where do you see "PHY chip used is Micrel 9301 and the corresponding driver is detected during boot up"?

Is it possible to run a GEM local loopback or at the PHY level; and check the links? For more info on register settings, you can refer to UG585 -XEMACPS_NWCTRL_LOOPEN_MASK (LOOPEN) bit.

"Don't forget to reply, kudo and accept as solution."
0 Kudos
Adventurer
Adventurer
3,121 Views
Registered: ‎07-11-2018

Re: Ethernet issues Petalinux 2018.1 (u-boot and Kernel)

Jump to solution

HI Nanz,

 

PFA log showing 9031 PHY detected. Please suggest me what I am going wrong in device tree apart from @7 to @3

0 Kudos
Adventurer
Adventurer
3,107 Views
Registered: ‎07-11-2018

Re: Ethernet issues Petalinux 2018.1 (u-boot and Kernel)

Jump to solution

Hi Nanz,

 

Please find some logs in the attached log file. The current system-user.dtsi is been used attached for your reference.

Enabled LOOPEN and PCSSEL bit in xemacps.c and PHY loopback is enabled in micrel.c attached for reference.

 

Please help on this, as it lasting for many days.

 

Please do needful.

 

0 Kudos
Moderator
Moderator
3,102 Views
Registered: ‎08-25-2009

Re: Ethernet issues Petalinux 2018.1 (u-boot and Kernel)

Jump to solution

Hi @umamahesh,

 

I do not see your latest DTSI file attached. Could you please send it again? In the log that you just attached, it seems PHY driver is picked up correctly. But what is the log file you attached earlier on with the "Generic PHY driver"?

 

To enable loopback, you can use devmem in Linux to write to registers rather than modify the driver file directly. If I understand correctly from the log, you can ping successfully with enabling loopback? So is it with MAC local loopback or PHY loopback? Is the speed again 10Mbps in loopback mode? Are you able to run 1G in loopback? What is the link partner you are connecting to? Is it running at 1Gbps? Does the link partner use auto-negotiation?

 

One additional question - have you ever had this board to work in a standalone environment before bringing in Linux?

"Don't forget to reply, kudo and accept as solution."
0 Kudos
Adventurer
Adventurer
3,098 Views
Registered: ‎07-11-2018

Re: Ethernet issues Petalinux 2018.1 (u-boot and Kernel)

Jump to solution

Hi Nanz,

 

PFA dtsi in txt format. Regards to loopback I manually enabled in the code shared to you. Only with 10Mbps Link detection is YES, for 100 or 1000 the link detection is NO. In standalone environment I tested UART and memory interfaces.

 

Loopback is enabled in both MAC and PHY level as updated in the code. The IP address set to board is 192.168.1.12  and I pinged to same IP. I directly connected the board to PC and statically set the IP to 192.168.1.15 and ping test is done, in this case the ping fails.

 

Any live meeting possible to resolve the issues.

 

Thanks

 

0 Kudos
Adventurer
Adventurer
3,092 Views
Registered: ‎07-11-2018

Re: Ethernet issues Petalinux 2018.1 (u-boot and Kernel)

Jump to solution

Hi Nanz,

 

When I build petalinux u-boot is not cloned, how to check loopback in u-boot. Even if you see the log Ethernet is getting TIMEOUT. Suggestions please

0 Kudos
Moderator
Moderator
3,430 Views
Registered: ‎08-25-2009

Re: Ethernet issues Petalinux 2018.1 (u-boot and Kernel)

Jump to solution

Hi @umamahesh,

 

Can you use devmem to write to registers instead of modifying the driver codes to check the loopback?

I have reviewed again the threads and the issue really looks like a customer board or PHY specific issue to me.

Please note that you should keep the address at which phy is actually detected. (still getting quite confused with the phy address in your DTS)

 

If it negotiated at 10Mbps, the autoneg probably failed and fell back to the default. Common bring up issues include RX and TX delay tuning in the PHY or on board. We talk about this a little bit on our wiki page:

http://www.wiki.xilinx.com/Macb+Driver

"Don't forget to reply, kudo and accept as solution."

View solution in original post

0 Kudos
Adventurer
Adventurer
3,029 Views
Registered: ‎07-11-2018

Re: Ethernet issues Petalinux 2018.1 (u-boot and Kernel)

Jump to solution

Hi Nanz,

 

Finally it was an issue in PHY connector connections which failed to ping. But in device tree still maintaining as @7  instead of @3.

 

Thanks for your support.

 

 

 

Moderator
Moderator
3,024 Views
Registered: ‎08-25-2009

Re: Ethernet issues Petalinux 2018.1 (u-boot and Kernel)

Jump to solution

Hi @umamahesh,

 

Great to hear your issue is resolved. Could you please mark your relevant post "Accepted as Solution" so it could benefit other forum users. Thank you!

"Don't forget to reply, kudo and accept as solution."
0 Kudos