On board SFP with ZCU111 and PYNQ

Hi folks,
this is my setup:

- Ubuntu 18.04 in Virtual Box
- Petalinux 2022.1
- Vivado 2022.1
- Repository for RFSoC-PYNQ V3.0
- Xilinx ZCU111 board

I’would like to recreate this Xilinx project (PL eth 1G) but it’s not clear to me if it possible the same implementation under PYNQ.

Up to now i’m able to generate the embedded board image from Vivado project under petalinux, in this case after the boot i have booth ethernet link eth0 and eth1 up and running, where eth1 is the SFP0 on board with the optical transceiver module 1000base X.

If i try the same think with the repository of the source code and build scripts for the RFSoC-PYNQ from GitHub RFsoc, with the same Vivado hardware project used before the second ethernet link eth1 is not visible:

I’m not really a Petalinux expert, please can someone help me understand where i’m going wrong?

Hi @Federico,

Have you modified the device tree accordingly to include this?

Mario

Hi @marioruiz ,
thanks for replying. Honestly i have a lot of confusion about the device tree.

This is the last version of my DT, i used the DT generator from .xsa file:

/include/ “system-conf.dtsi”
/ {
amba_pl@0 {
data_source_top0:data_source_top@a0000000 {
compatible = “xlnx,data-source-top-1.0”;
reg = <0x0 0xa0000000 0x0 0x10000>;
};
};
};

&i2c1 {
i2c-mux@74 { /* u26 /
i2c@5 {
#address-cells = <1>;
#size-cells = <0>;
reg = <5>;
sc18is603@2f { /
sc18is602 - u93 /
/
Part name is sc18is602 - using sc18is603 to match ZCU111 system-user.dtsi */
compatible = “nxp,sc18is602b”;
reg = <0x2f>;
#address-cells = <0x1>;
#size-cells = <0x0>;
lmxC@0 {
compatible = “ti,lmx2594”;
reg = <0x0>;
spi-max-frequency = <400000>;
num_bytes = <4>;
};
lmk@1 {
compatible = “ti,lmk04208”;
reg = <0x1>;
spi-max-frequency = <400000>;
num_bytes = <4>;
};
lmxB@2 {
compatible = “ti,lmx2594”;
reg = <0x2>;
spi-max-frequency = <400000>;
num_bytes = <4>;
};
lmxA@3 {
compatible = “ti,lmx2594”;
reg = <0x3>;
spi-max-frequency = <400000>;
num_bytes = <4>;
};
};
};
};
};

axi_dma_0: dma@a0000000 {
#dma-cells = <1>;
clock-names = “s_axi_lite_aclk”, “m_axi_sg_aclk”, “m_axi_mm2s_aclk”, “m_axi_s2mm_aclk”;
clocks = <&zynqmp_clk 71>, <&zynqmp_clk 71>, <&zynqmp_clk 71>, <&zynqmp_clk 71>;
compatible = “xlnx,eth-dma”;
interrupt-names = “mm2s_introut”, “s2mm_introut”;
interrupt-parent = <&gic>;
interrupts = <0 89 4 0 90 4>;
reg = <0x0 0xa0000000 0x0 0x10000>;
xlnx,addrwidth = /bits/ 8 <0x20>;
xlnx,include-dre ;
xlnx,num-queues = /bits/ 16 <0x1>;
};
axi_ethernet_0: ethernet@a0040000 {
axistream-connected = <&axi_dma_0>;
axistream-control-connected = <&axi_dma_0>;
clock-frequency = <100000000>;
clock-names = “s_axi_lite_clk”, “axis_clk”, “ref_clk”;
clocks = <&zynqmp_clk 71>, <&zynqmp_clk 71>, <&zynqmp_clk 72>;
compatible = “xlnx,axi-ethernet-7.2”, “xlnx,axi-ethernet-1.00.a”;
device_type = “network”;
interrupt-names = “interrupt”, “mm2s_introut”, “s2mm_introut”;
interrupt-parent = <&gic>;
interrupts = <0 91 4 0 89 4 0 90 4>;
local-mac-address = [00 0a 35 00 00 00];
phy-handle = <&axi_ethernet_0phy2>;
phy-mode = “1000base-x”;
reg = <0x0 0xa0040000 0x0 0x40000>;
xlnx = <0x0>;
xlnx,axiliteclkrate = <0x0>;
xlnx,axisclkrate = <0x0>;
xlnx,channel-ids = <0x1>;
xlnx,clockselection = <0x0>;
xlnx,enableasyncsgmii = <0x0>;
xlnx,gt-type = <0x0>;
xlnx,gtinex = <0x0>;
xlnx,gtlocation = <0x0>;
xlnx,gtrefclksrc = <0x0>;
xlnx,include-dre ;
xlnx,instantiatebitslice0 = <0x0>;
xlnx,num-queues = /bits/ 16 <0x1>;
xlnx,phy-type = <0x5>;
xlnx,phyaddr = <0x2>;
xlnx,phyrst-board-interface-dummy-port = <0x0>;
xlnx,rable = <0x0>;
xlnx,rxcsum = <0x2>;
xlnx,rxlane0-placement = <0x0>;
xlnx,rxlane1-placement = <0x0>;
xlnx,rxmem = <0x8000>;
xlnx,rxnibblebitslice0used = <0x0>;
xlnx,tx-in-upper-nibble = <0x1>;
xlnx,txcsum = <0x2>;
xlnx,txlane0-placement = <0x0>;
xlnx,txlane1-placement = <0x0>;
xlnx,versal-gt-board-flow = <0x0>;
zclock-names = “NULL”;
zclocks = “NULL”;
axi_ethernet_0_mdio: mdio {
#address-cells = <1>;
#size-cells = <0>;
axi_ethernet_0phy2: phy@2 {
device_type = “ethernet-phy”;
reg = <2>;
};
};
};

Federico

Did you include these changes as part of the user device tree?

What you’re trying to achieve is possible, but it will require work to debug and put everything in place.

Yes, is in the first part of the dtsi file.

In that case, I would suggest you decompile the final system.dtb and check if these nodes were assigned correctly, clock names match, interrupt numbers match and so on.

Ok, i will try but will be not easy. Here attached two decompiled dtb file, PYNQ.system.txt generated from RF-PYNQ repository (not working), and PETALINUX_system.txt generated only with Petalinux (working).

Clearly there are several differences.

PETALINUX_system.txt (58.7 KB)
PYNQ_system.txt (57.1 KB)

Thanks,
Federico

The most important part is that the amba_pl@0, dma@a0000000 and ethernet@a0040000 nodes are missing from the PYNQ device tree.

You need to add these nodes as part of the user configuration.

Just an update…
If i try to add missing nodes with dtsi user file the compilation stop because those nodes are already present:

ERROR (duplicate_label): /amba_pl@0/ethernet@a0040000: Duplicate label ‘axi_ethernet_0’ on /amba_pl@0/ethernet@a0040000 and /fragment@2/overlay/ethernet@a0040000

I can see also from pl.dtsi (generated in /petalinux_project/components/plnx_workspace/device-tree/device-tree) that nodes are present:

fragment@2 {
	target = <&amba>;
	overlay2: __overlay__ {
		#address-cells = <2>;
		#size-cells = <2>;
		axi_dma_0: dma@a0000000 {
			#dma-cells = <1>;
			clock-names = "s_axi_lite_aclk", "m_axi_sg_aclk", "m_axi_mm2s_aclk", "m_axi_s2mm_aclk";
			clocks = <&zynqmp_clk 71>, <&zynqmp_clk 71>, <&zynqmp_clk 71>, <&zynqmp_clk 71>;
			compatible = "xlnx,eth-dma";
			interrupt-names = "mm2s_introut", "s2mm_introut";
			interrupt-parent = <&gic>;
			interrupts = <0 89 4 0 90 4>;
			reg = <0x0 0xa0000000 0x0 0x10000>;
			xlnx,addrwidth = /bits/ 8 <0x20>;
			xlnx,include-dre ;
			xlnx,num-queues = /bits/ 16 <0x1>;
		};
		axi_ethernet_0: ethernet@a0040000 {
			axistream-connected = <&axi_dma_0>;
			axistream-control-connected = <&axi_dma_0>;
			clock-frequency = <100000000>;
			clock-names = "s_axi_lite_clk", "axis_clk", "ref_clk";
			clocks = <&zynqmp_clk 71>, <&zynqmp_clk 71>, <&zynqmp_clk 72>;
			compatible = "xlnx,axi-ethernet-7.2", "xlnx,axi-ethernet-1.00.a";
			device_type = "network";
			interrupt-names = "interrupt", "mm2s_introut", "s2mm_introut";
			interrupt-parent = <&gic>;
			interrupts = <0 91 4 0 89 4 0 90 4>;
			local-mac-address = [00 0a 35 00 00 00];
			phy-handle = <&axi_ethernet_0phy2>;
			phy-mode = "1000base-x";
			reg = <0x0 0xa0040000 0x0 0x40000>;
			xlnx = <0x0>;
			xlnx,axiliteclkrate = <0x0>;
			xlnx,axisclkrate = <0x0>;
			xlnx,channel-ids = <0x1>;
			xlnx,clockselection = <0x0>;
			xlnx,enableasyncsgmii = <0x0>;
			xlnx,gt-type = <0x0>;
			xlnx,gtinex = <0x0>;
			xlnx,gtlocation = <0x0>;
			xlnx,gtrefclksrc = <0x0>;
			xlnx,include-dre ;
			xlnx,instantiatebitslice0 = <0x0>;
			xlnx,num-queues = /bits/ 16 <0x1>;
			xlnx,phy-type = <0x5>;
			xlnx,phyaddr = <0x2>;
			xlnx,phyrst-board-interface-dummy-port = <0x0>;
			xlnx,rable = <0x0>;
			xlnx,rxcsum = <0x2>;
			xlnx,rxlane0-placement = <0x0>;
			xlnx,rxlane1-placement = <0x0>;
			xlnx,rxmem = <0x8000>;
			xlnx,rxnibblebitslice0used = <0x0>;
			xlnx,tx-in-upper-nibble = <0x1>;
			xlnx,txcsum = <0x2>;
			xlnx,txlane0-placement = <0x0>;
			xlnx,txlane1-placement = <0x0>;
			xlnx,versal-gt-board-flow = <0x0>;
			zclock-names = "NULL";
			zclocks = "NULL";
			axi_ethernet_0_mdio: mdio {
				#address-cells = <1>;
				#size-cells = <0>;
				axi_ethernet_0phy2: phy@2 {
					device_type = "ethernet-phy";
					reg = <2>;
				};
			};
		};
	};

But for some unknown reason in the compiled device tree .dtb segments disappear.

I tried also to disable FPGA manager, in this case during the boot the ethernet link to the SFP module became up but the boot stop at: Loading kernel…

I’m in a real frustrating situation. Any suggestions will be appreciate…

Federico