cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
colombini_luca
Explorer
Explorer
680 Views
Registered: ‎11-05-2008

PS GTR Eyetest not working

Jump to solution

I am trying to replicate UG936 Lab10 on a ZCU102.

The result I get after generating the FSBL with XCST flow and Vivado 2018.2 is the following:

colombini_luca_0-1614341894651.png

 

A USB Pen is connected on J96 USB connector via a WHIZZ USB3-USB2A adapter.

Lane 2 is not properly working (no link rx det) and obviously Scan is not working.

What could be the problem?

Is anyone able to reproduce this?

Is there any update available or in preview for UG926 Lab 10 on Vivado 2020.2 ?

 

 

0 Kudos
1 Solution

Accepted Solutions
shx
Visitor
Visitor
490 Views
Registered: ‎08-07-2020

Hi   @colombini_luca 

I found an elegant method to get IBERT working on our custom hardware, under linux, while booting on sd card (or any other medium, really), and even though I struggled quite a lot, in the end it is very simple !

The key was to understand that enabling IBERT GTR in Vivado was doing one big thing : load a R5 firmware and update the target tree after the communication was established.

It turns out this firmware file is in your Vivado installation: 

 

<VIVADO_DIR>/2020.1/data/xicom/gtr_config/gtr_ibert.elf

 

 

So what you have to do is :

  • Configure your linux device tree to add a remoteproc node in order to be able to start the R5
  • Create a new petalinux application project
  • in this project, export the elf file in /lib/firmware
  • after boot, start the R5 with this firmware

 

Here is the DT node I added in  project-spec/meta-user/recipes-bsp/device-tree/files/system-user.dtsi :

 

/ {
	reserved-memory {
		#address-cells = <2>;
		#size-cells = <2>;
		ranges;
		rproc_0_dma: rproc@3ed40000 {
			no-map;
			compatible = "shared-dma-pool";
			reg = <0x0 0x3ed40000 0x0 0x100000>;
		};
		rproc_0_reserved: rproc@3ed00000 {
			no-map;
			reg = <0x0 0x3ed00000 0x0 0x40000>;
		};
	};
	zynqmp-rpu {
		compatible = "xlnx,zynqmp-r5-remoteproc-1.0";
		#address-cells = <2>;
		#size-cells = <2>;
		ranges;
		core_conf = "split";
		r5_0: r5@0 {
			#address-cells = <2>;
			#size-cells = <2>;
			ranges;
			memory-region = <&rproc_0_reserved>, <&rproc_0_dma>;
			pnode-id = <0x7>;
			mboxes = <&ipi_mailbox_rpu0 0>, <&ipi_mailbox_rpu0 1>;
			mbox-names = "tx", "rx";
			tcm_0_a: tcm_0@0 {
				reg = <0x0 0xFFE00000 0x0 0x10000>;
				pnode-id = <0xf>;
			};
			tcm_0_b: tcm_0@1 {
				reg = <0x0 0xFFE20000 0x0 0x10000>;
				pnode-id = <0x10>;
			};
		};
	};
 
    zynqmp_ipi1 {
        compatible = "xlnx,zynqmp-ipi-mailbox";
        interrupt-parent = <&gic>;
        interrupts = <0 29 4>;
        xlnx,ipi-id = <7>;
        #address-cells = <1>;
        #size-cells = <1>;
        ranges;
 
        // APU<->RPU0 IPI mailbox controller
        ipi_mailbox_rpu0: mailbox@ff990600 {
            reg = <0xff990600 0x20>,
                  <0xff990620 0x20>,
                  <0xff9900c0 0x20>,
                  <0xff9900e0 0x20>;
            reg-names = "local_request_region",
                    "local_response_region",
                    "remote_request_region",
                    "remote_response_region";
            #mbox-cells = <1>;
            xlnx,ipi-id = <1>;
        };
    };
 
};

 

Then, I created the IBERT component :

 

petalinux-create -t apps -n ibert

 

 

Here is the recipe to export firmware    project-spec/meta-user/recipes-apps/ibert/ibert.bb :

 

#
# This file is the ibert recipe.
#

SUMMARY = "Simple ibert application"
SECTION = "PETALINUX/apps"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"

SRC_URI = "file://gtr_ibert.elf \
		  "

S = "${WORKDIR}"

do_install() {
	     install -d ${D}/lib/firmware
	     install -m 0755 ${S}/gtr_ibert.elf ${D}/lib/firmware/gtr_ibert.elf
}
INSANE_SKIP_${PN} = "already-stripped"
INSANE_SKIP_${PN} =+ "arch"

FILES_${PN} = "${base_libdir}/firmware/gtr_ibert.elf" 

 

Add the newly created "ibert" app to your rootfs by adding to your  project-spec/meta-user/conf/user-rootfsconfig :

 

CONFIG_ibert

 

 

And in  project-spec/configs/rootfs_config :

 

CONFIG_ibert =y

 

 

Then, to start the firmware, either type or add to as startup script those commands :

 

echo gtr_ibert.elf > /sys/class/remoteproc/remoteproc0/firmware
echo start > /sys/class/remoteproc/remoteproc0/state

 

 

After this, in Vivado hardware manager: 

  • right click on the arm_dap_1 node 
  • select "Configure IBERT GTR"
  • select the stardard FSBL generated by petalinux  in images/linux/zynqmp_fsbl.elf 
  • do not click on reset checkbox. 

Your GTR lanes should appear in the target tree.

Note that the link status should be updated by hand (right click on the link -> Update)

Note also that if your target is disconnected (upon a reboot for example), you can refresh the arm_dap node and you will get your GTR lanes back.

As GTR serial links are not created automatically, add them by hand.

For the serial link(s) you want, you can add a scan (in the following example a full eye diagram)

-> you can now generate eye diagrams on your running linux target ! <-

IMPORTANT : For subsequent scans, make sure to reset the Rx by clicking in the scan "Reset Rx" otherwise even with a broken link, you will keep on using old data (and this will not be notified to you in the UI...)

SGMII link up and eye diagramSGMII link up and eye diagram

I hope this will help you and maybe some other readers too.

Best regards,

Steven

View solution in original post

Tags (4)
8 Replies
shx
Visitor
Visitor
573 Views
Registered: ‎08-07-2020

Hi @colombini_luca ,
I struggled as you probably did to replicate this lab using 2020.1 and I came up with something running on a ZCU106.

Using 2020.1 tools, I had to create the platform project in Vitis 'by hand', create an application project from FSBL template running on A53, patch it the same way the tcl script targetting SDK does it (the USB part), change the preprocessor directives so that ZCU102 conditional code is exerced for ZCU106 (not sure this was mandatory, btw), and build the FSBL elf.

I set boot jumper to 1111 (all ON) because loading IBERT after booting U-boot/pêtalinux from SD card fails, unfortunately, and this is what I'm looking at at the moment as I'd like to be able to run scans with a target running linux.

Make sure you tick the 'force reset' box while loading IBERT firmware in hardware manager, and do not hesitate to force a link refresh (right click on link ->refresh) to see if your link is in U0 state (I successully run a scan even though the UI had not updated the link state : see the attached capture)

regarding the USB3 device : I just used a USB3 hub without any connected USB3 peripheral.

I feel like the GTR IBERT feature is nice but really lacks documentation, and I wonder why this lab 10 was removed in recent versions of the tools...

I hope this helps someone, if not you !

Best regards,

Steven

 

Forced refresh on link statusForced refresh on link statusEye obtained with just a USB3 hub plugged on USB connectorEye obtained with just a USB3 hub plugged on USB connectorZCU106 USB3 connector and jumper settingsZCU106 USB3 connector and jumper settings

shx
Visitor
Visitor
564 Views
Registered: ‎08-07-2020
colombini_luca
Explorer
Explorer
555 Views
Registered: ‎11-05-2008

Hi @shx ,

  Thanks for all of your replies.

   I am already aware of the new UG936 release.

   I totally agree that PS GTR eye test documentaion must be improved a lot.

   I am still struggling to make it work on our custom board. 

   I have introduced our custom settings by defining another constant to include only our custom board initialization code.

   But after my modification I do see on the serial terminal this message:

colombini_luca_0-1615370723055.png

 

  

I am trying to understand...

Luca

0 Kudos
colombini_luca
Explorer
Explorer
551 Views
Registered: ‎11-05-2008

@shx What is the boot jumper to 1111 for?

It is not documented AFAIK...

 

 

 

0 Kudos
shx
Visitor
Visitor
491 Views
Registered: ‎08-07-2020

Hi   @colombini_luca 

I found an elegant method to get IBERT working on our custom hardware, under linux, while booting on sd card (or any other medium, really), and even though I struggled quite a lot, in the end it is very simple !

The key was to understand that enabling IBERT GTR in Vivado was doing one big thing : load a R5 firmware and update the target tree after the communication was established.

It turns out this firmware file is in your Vivado installation: 

 

<VIVADO_DIR>/2020.1/data/xicom/gtr_config/gtr_ibert.elf

 

 

So what you have to do is :

  • Configure your linux device tree to add a remoteproc node in order to be able to start the R5
  • Create a new petalinux application project
  • in this project, export the elf file in /lib/firmware
  • after boot, start the R5 with this firmware

 

Here is the DT node I added in  project-spec/meta-user/recipes-bsp/device-tree/files/system-user.dtsi :

 

/ {
	reserved-memory {
		#address-cells = <2>;
		#size-cells = <2>;
		ranges;
		rproc_0_dma: rproc@3ed40000 {
			no-map;
			compatible = "shared-dma-pool";
			reg = <0x0 0x3ed40000 0x0 0x100000>;
		};
		rproc_0_reserved: rproc@3ed00000 {
			no-map;
			reg = <0x0 0x3ed00000 0x0 0x40000>;
		};
	};
	zynqmp-rpu {
		compatible = "xlnx,zynqmp-r5-remoteproc-1.0";
		#address-cells = <2>;
		#size-cells = <2>;
		ranges;
		core_conf = "split";
		r5_0: r5@0 {
			#address-cells = <2>;
			#size-cells = <2>;
			ranges;
			memory-region = <&rproc_0_reserved>, <&rproc_0_dma>;
			pnode-id = <0x7>;
			mboxes = <&ipi_mailbox_rpu0 0>, <&ipi_mailbox_rpu0 1>;
			mbox-names = "tx", "rx";
			tcm_0_a: tcm_0@0 {
				reg = <0x0 0xFFE00000 0x0 0x10000>;
				pnode-id = <0xf>;
			};
			tcm_0_b: tcm_0@1 {
				reg = <0x0 0xFFE20000 0x0 0x10000>;
				pnode-id = <0x10>;
			};
		};
	};
 
    zynqmp_ipi1 {
        compatible = "xlnx,zynqmp-ipi-mailbox";
        interrupt-parent = <&gic>;
        interrupts = <0 29 4>;
        xlnx,ipi-id = <7>;
        #address-cells = <1>;
        #size-cells = <1>;
        ranges;
 
        // APU<->RPU0 IPI mailbox controller
        ipi_mailbox_rpu0: mailbox@ff990600 {
            reg = <0xff990600 0x20>,
                  <0xff990620 0x20>,
                  <0xff9900c0 0x20>,
                  <0xff9900e0 0x20>;
            reg-names = "local_request_region",
                    "local_response_region",
                    "remote_request_region",
                    "remote_response_region";
            #mbox-cells = <1>;
            xlnx,ipi-id = <1>;
        };
    };
 
};

 

Then, I created the IBERT component :

 

petalinux-create -t apps -n ibert

 

 

Here is the recipe to export firmware    project-spec/meta-user/recipes-apps/ibert/ibert.bb :

 

#
# This file is the ibert recipe.
#

SUMMARY = "Simple ibert application"
SECTION = "PETALINUX/apps"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"

SRC_URI = "file://gtr_ibert.elf \
		  "

S = "${WORKDIR}"

do_install() {
	     install -d ${D}/lib/firmware
	     install -m 0755 ${S}/gtr_ibert.elf ${D}/lib/firmware/gtr_ibert.elf
}
INSANE_SKIP_${PN} = "already-stripped"
INSANE_SKIP_${PN} =+ "arch"

FILES_${PN} = "${base_libdir}/firmware/gtr_ibert.elf" 

 

Add the newly created "ibert" app to your rootfs by adding to your  project-spec/meta-user/conf/user-rootfsconfig :

 

CONFIG_ibert

 

 

And in  project-spec/configs/rootfs_config :

 

CONFIG_ibert =y

 

 

Then, to start the firmware, either type or add to as startup script those commands :

 

echo gtr_ibert.elf > /sys/class/remoteproc/remoteproc0/firmware
echo start > /sys/class/remoteproc/remoteproc0/state

 

 

After this, in Vivado hardware manager: 

  • right click on the arm_dap_1 node 
  • select "Configure IBERT GTR"
  • select the stardard FSBL generated by petalinux  in images/linux/zynqmp_fsbl.elf 
  • do not click on reset checkbox. 

Your GTR lanes should appear in the target tree.

Note that the link status should be updated by hand (right click on the link -> Update)

Note also that if your target is disconnected (upon a reboot for example), you can refresh the arm_dap node and you will get your GTR lanes back.

As GTR serial links are not created automatically, add them by hand.

For the serial link(s) you want, you can add a scan (in the following example a full eye diagram)

-> you can now generate eye diagrams on your running linux target ! <-

IMPORTANT : For subsequent scans, make sure to reset the Rx by clicking in the scan "Reset Rx" otherwise even with a broken link, you will keep on using old data (and this will not be notified to you in the UI...)

SGMII link up and eye diagramSGMII link up and eye diagram

I hope this will help you and maybe some other readers too.

Best regards,

Steven

View solution in original post

Tags (4)
colombini_luca
Explorer
Explorer
466 Views
Registered: ‎11-05-2008

Thank you @shx for sharing this solution! 

I think it will help a lot and a lot of people struggling with this kind of test.

I will verify it ASAP.

Luca

0 Kudos
colombini_luca
Explorer
Explorer
313 Views
Registered: ‎11-05-2008

Hi @shx ,

  I have tested your solution.

  It works just fine!

  The only trick I had to make is to perform the following write to enable USB3 to work properly:

   devmem 0xfe20c704 32 0x80000000

 

   Otherwise, the link, as set by default by fsbl/kernel/boot is not performing well.

    In my case I have seen the USB state to switch between u0 and u2 state continuously, while ping was performing fine on the link both ways.

    IMHO Your solution would deserve a place in a dedicated application note or user guide dedicated to PS GTR eye tests.

Thanks,

Luca

 

 

 

0 Kudos
colombini_luca
Explorer
Explorer
294 Views
Registered: ‎11-05-2008

Follow-up:

I am using Petalinux 2019.2, but I didn't have Vivado 2020.1 installed.

So I first tried to use gtr_ibert.elf from Vivado 2018.2 folder: no success. An error regarding target architecture appears when loading code to R5.

Instead, when using gtr_ibert.btr from Vivado 2020.2 folder, everything goes just fine.

0 Kudos