This article will discuss the steps needed to download and compile a Bootable (SD) Linux Image for the ZCU102 using the OSL flow.
The recommended flow for building a Linux system is to use the Petalinux tools. However, this article offers an alternative for users that want full visibility into the Image.
This assumes that the users has downloaded Vitis 2020.1 (used to by the devcetree generator).
Some steps are duplicated. For example, the cross_compile steps. This is intentional to allow the users to build each image in isolation.
However, users must use the same tag, as there are dependencies between pmufw and atf for example.The rootFS is downloaded from the released images from here.
NOTE: If building on an Ubuntu (or derivative machine), ensure that the default shell has been changed from Dash to Bash. Compiling in Dash may result in syntax errors within the Makefile that will prevent the code from compiling.
Note: If users want to debug (ie use the symbols) the ATF in Vitis, then set the DEBUG=1. This will place the ATF in DDR at 0x1000
Note: If users want to debug (ie use the symbols) the u-boot in Vitis, then use the u-boot (renamed u-boot.elf) in the boot image.
proc gen_dtb {hdf} { open_hw_design $hdf set_repo_path ./repo create_sw_design device-tree -os device_tree -proc psu_cortexa53_0 generate_target -dir my_dts } |
&gem3 { status = "okay"; local-mac-address = [00 0a 35 00 02 90]; phy-mode = "rgmii-id"; phy-handle = <&phy0>; phy0: phy@c { reg = <0xc>; ti,rx-internal-delay = <0x8>; ti,tx-internal-delay = <0xa>; ti,fifo-depth = <0x1>; }; }; |
Users can also add the dtsi here to my_dts directory, and include this into the DT structure. For a quick guide on Devicetree debugging, see the wiki here
Note: For the 2018.3 release version onward, the 'include' syntax in device-tree files changed from /include/ to the 'C' style #include. Depending on which version of the device-tree-compiler (dtc) is being used, this may cause parsing errors when the .dts file is read. To fix this, all instances of #include need to be replaced with /include/.
the_ROM_image: { [fsbl_config] a53_x64 [bootloader, destination_cpu=a53-0] embedded/lib/sw_apps/zynqmp_fsbl/src/fsbl.elf [pmufw_image] embeddedsw/lib/sw_apps/zynqmp_pmufw/src/executable.elf [destination_device=pl] design_1_wrapper.bit [destination_cpu=a53-0, load=0x00100000] my_dts/system-top.dtb [destination_cpu=a53-0,exception_level=el-3,trustzone] arm-trusted-firmware/build/zynqmp/release/bl31/bl31.elf [destination_cpu=a53-0,exception_level=el-2] u-boot-xlnx/u-boot.elf } |
/dts-v1/; / { description = "U-Boot fitImage for plnx_aarch64 kernel"; #address-cells = <1>; images { kernel@0 { description = "Linux Kernel"; data = /incbin/("./linux-xlnx/arch/arm64/boot/Image"); type = "kernel"; arch = "arm64"; os = "linux"; compression = "none"; load = <0x80000>; entry = <0x80000>; hash@1 { algo = "sha1"; }; }; fdt@0 { description = "Flattened Device Tree blob"; data = /incbin/("./my_dts/system.dtb"); type = "flat_dt"; arch = "arm64"; compression = "none"; hash@1 { algo = "sha1"; }; }; ramdisk@0 { description = "ramdisk"; data = /incbin/("./petalinux-user-image-plnx_aarch64.cpio.gz"); type = "ramdisk"; arch = "arm64"; os = "linux"; compression = "none"; hash@1 { algo = "sha1"; }; }; }; configurations { default = "conf@1"; conf@1 { description = "Boot Linux kernel with FDT blob + ramdisk"; kernel = "kernel@0"; fdt = "fdt@0"; ramdisk = "ramdisk@0"; hash@1 { algo = "sha1"; }; }; conf@2 { description = "Boot Linux kernel with FDT blob"; kernel = "kernel@0"; fdt = "fdt@0"; hash@1 { algo = "sha1"; }; }; }; }; |