Jump to content
  • 0

Petalinux support for Zybo Z710/Z720 with HDMI output petalinux >=2020.1


tkuraku

Question

My main goal is to be able to display a GUI from an up-to-date petalinux on the Zybo Z7 board.

 

Are there plans to provide an updated petalinux BSP and hardware design for the Zybo Z7 boards? There are BSPs for 2017.4, https://digilent.com/reference/software/petalinux/start and HDL design here, https://github.com/Digilent/Zybo-Z7-10-base-linux.

in the petalinux 2017.4 there are two drivers in the digilent source tree that make the HDMI display work. clk-dglnt-dynclk.c and digilent_encoder.c. Attached here.

 

as well as some device tree entries:

 

&amba_pl {
	encoder_0: digilent_encoder {
		compatible = "digilent,drm-encoder";
		digilent,fmax = <150000>;
		digilent,edid-i2c = <&i2c0>;
	};

	xilinx_drm {
		compatible = "xlnx,drm";
		xlnx,vtc = <&v_tc_out>;
		xlnx,connector-type = "HDMIA";
		xlnx,encoder-slave = <&encoder_0>;
		clocks = <&axi_dynclk_0>;
		planes {
			xlnx,pixel-format = "rgb888";
			plane0 {
				dmas = <&axi_vdma_1 0>;
				dma-names = "dma0";
			};
		};
	};
};
&axi_dynclk_0 {
	compatible = "digilent,axi-dynclk";
	#clock-cells = <0>;
	clocks = <&clkc 15>;
};
&axi_vdma_1 {
	dma-ranges = <0x00000000 0x00000000 0x40000000>;
};
&v_tc_out {
	compatible = "xlnx,v-tc-5.01.a";
};

 

and two kernel configurations options, enable `CONFIG_COMMON_CLK_AXI_CLKGEN` in the kernel configuration and set the CONFIG_CMA_SIZE_MBYTES kernel parameter to 128.

I found these through looking through the 2017.4 BSP. These additions allow the hdmi output to work with a vanilla petalinux 2017.4 project using the xilinx kernel/u-boot sources.

I tried upgrading the HDL design to 2020.1 and 2021.1 and I am not able to get the HDMI display to work with petalinux. It seems there are two issues, one is that I had to modify the two drivers to compile with the newer kernel and may have broken something (though I don't think so), and two that the v_tc_out device tree node that is auto generated from the hardware file in petalinux is significantly different. The relevant file is components/plnx_workspace/device-tree/device-tree-generation/pl.dtsi.

I would really like to get this functionality working on an up to date tool chain. Any help or support from Digilent would be appreciated.

 

Thank you

clk-dglnt-dynclk.c digilent_encoder.c

Link to comment
Share on other sites

5 answers to this question

Recommended Posts

  • 0

@thinkthinkthink, thanks for your help on this. It I tried to built the petalinux project from your link. I wasn't able to get a frame buffer device to show a GUI like was done on the 2017.4 version. It seemed that the project-spec/meta-user/recipes-kernel/linux/linux-xlnx/0001-drm-xilinx-Add-encoder-for-Digilent-boards-new.patch is not set to be applied by default. Is this still a work in progress then?

Link to comment
Share on other sites

  • 0

hii,

i am trying display a GUI from an up-to-date petalinux on the Zybo Z7 board(z7-20)

can you give advise on device tree, while it shows error while generating petalinux image.

i used:

https://digilent.com/reference/programmable-logic/zybo-z7/demos/hdmi

device tree error:

NOTE: Executing Tasks
ERROR: device-tree-xilinx-v2022.2+gitAUTOINC+24d29888d0-r0 do_compile: Error executing a python function in exec_func_python() autogenerated:

The stack trace of python calls that resulted in this exception/failure was:
File: 'exec_func_python() autogenerated', lineno: 2, function: <module>
     0001:
 *** 0002:devicetree_do_compile(d)
     0003:
File: '/home/sqm/Downloads/hdmi_testing/hdmi_image/image_hdmi/components/yocto/layers/core/meta/classes/devicetree.bbclass', lineno: 131, function: devicetree_do_compile
     0127:            if not(os.path.isfile(dtspath)) or not(dts.endswith(".dts") or devicetree_source_is_overlay(dtspath)):
     0128:                continue # skip non-.dts files and non-overlay files
     0129:        except:
     0130:            continue # skip if can't determine if overlay
 *** 0131:        devicetree_compile(dtspath, includes, d)
     0132:}
     0133:
     0134:devicetree_do_install() {
     0135:    for DTB_FILE in `ls *.dtb *.dtbo`; do
File: '/home/sqm/Downloads/hdmi_testing/hdmi_image/image_hdmi/components/yocto/layers/core/meta/classes/devicetree.bbclass', lineno: 119, function: devicetree_compile
     0115:        dtcargs += ["-i", i]
     0116:    dtcargs += ["-o", "{0}.{1}".format(dtname, "dtbo" if isoverlay else "dtb")]
     0117:    dtcargs += ["-I", "dts", "-O", "dtb", "{0}.pp".format(dts)]
     0118:    bb.note("Running {0}".format(" ".join(dtcargs)))
 *** 0119:    subprocess.run(dtcargs, check = True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
     0120:
     0121:python devicetree_do_compile() {
     0122:    includes = expand_includes("DT_INCLUDE", d)
     0123:    listpath = d.getVar("DT_FILES_PATH")
File: '/tools/Xilinx/PetaLinux_22.2/components/yocto/buildtools/sysroots/x86_64-petalinux-linux/usr/lib/python3.9/subprocess.py', lineno: 528, function: run
     0524:            # We don't call process.wait() as .__exit__ does that for us.
     0525:            raise
     0526:        retcode = process.poll()
     0527:        if check and retcode:
 *** 0528:            raise CalledProcessError(retcode, process.args,
     0529:                                     output=stdout, stderr=stderr)
     0530:    return CompletedProcess(process.args, retcode, stdout, stderr)
     0531:
     0532:
Exception: subprocess.CalledProcessError: Command '['dtc', '-@', '-p', '0x1000', '-@', '-i', '/home/sqm/Downloads/hdmi_testing/hdmi_image/image_hdmi/project-spec/configs/../../components/plnx_workspace/device-tree/device-tree', '-i', '/home/sqm/Downloads/hdmi_testing/hdmi_image/image_hdmi/build/tmp/work/zynq_generic-xilinx-linux-gnueabi/device-tree/xilinx-v2022.2+gitAUTOINC+24d29888d0-r0/git/device_tree/data/kernel_dtsi/2022.2/BOARD/', '-i', '/home/sqm/Downloads/hdmi_testing/hdmi_image/image_hdmi/build/tmp/work-shared/zynq-generic/kernel-source/arch/arm/boot/dts', '-i', '/home/sqm/Downloads/hdmi_testing/hdmi_image/image_hdmi/build/tmp/work-shared/zynq-generic/kernel-source/scripts/dtc/include-prefixes', '-i', '/home/sqm/Downloads/hdmi_testing/hdmi_image/image_hdmi/build/tmp/work/zynq_generic-xilinx-linux-gnueabi/device-tree/xilinx-v2022.2+gitAUTOINC+24d29888d0-r0', '-o', 'system-top.dtb', '-I', 'dts', '-O', 'dtb', 'system-top.dts.pp']' returned non-zero exit status 1.

Subprocess output:
Error: /home/sqm/Downloads/hdmi_testing/hdmi_image/image_hdmi/build/tmp/work/zynq_generic-xilinx-linux-gnueabi/device-tree/xilinx-v2022.2+gitAUTOINC+24d29888d0-r0/system-user.dtsi:118.18-33 syntax error
FATAL ERROR: Unable to parse input tree

ERROR: Logfile of failure stored in: /home/sqm/Downloads/hdmi_testing/hdmi_image/image_hdmi/build/tmp/work/zynq_generic-xilinx-linux-gnueabi/device-tree/xilinx-v2022.2+gitAUTOINC+24d29888d0-r0/temp/log.do_compile.3603681
ERROR: Task (/home/sqm/Downloads/hdmi_testing/hdmi_image/image_hdmi/components/yocto/layers/meta-xilinx/meta-xilinx-core/recipes-bsp/device-tree/device-tree.bb:do_compile) failed with exit code '1'
 

why this error are coming.

if you have standard device tree. please share it.

 

Link to comment
Share on other sites

  • 0

You have a syntax error in your device tree:

Quote

device-tree/xilinx-v2022.2+gitAUTOINC+24d29888d0-r0/system-user.dtsi:118.18-33 syntax error

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...