Wiki

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
resources:tools-software:linux-build:generic:zynqmp [30 Jun 2021 16:06] – [DisplayPort - no picture?] Stefan-Robert Rausresources:tools-software:linux-build:generic:zynqmp [06 Feb 2023 04:42] (current) – Updated linaro tool details. Added linaro as a cross compiler option. Added a few lines in each section to help clarify each step ALEXIS CZEZAR TORRENO
Line 28: Line 28:
  
 ===== On the development host ===== ===== On the development host =====
 +Create a local copy of ADI's kernel tree
 <code> <code>
 git clone https://github.com/analogdevicesinc/linux.git git clone https://github.com/analogdevicesinc/linux.git
 </code> </code>
  
-or do a git pull in the existing repository.+or do a git pull in an existing repository.
  
 ==== Checkout the master development/master branch ==== ==== Checkout the master development/master branch ====
Line 42: Line 42:
 Your branch is up-to-date with 'origin/master'. Your branch is up-to-date with 'origin/master'.
 </code> </code>
 +
 ==== Add aarch64-linux-gnu-gcc to PATH ==== ==== Add aarch64-linux-gnu-gcc to PATH ====
  
Line 50: Line 51:
 </code> </code>
  
 +Other toolchains/compilers for ARM may work as well, but the ones described here have been tested and found to work.
 +
 +=== Using the Linaro toolchain ===
 +
 +Alternatively, the Linaro toolchain/compiler can be used to compile to kernel.
 +Linaro compilers (that work with ZYNQMP) can be downloaded from: 
 +https://releases.linaro.org/components/toolchain/binaries/latest-7/aarch64-linux-gnu/ . Always use the latest release just in case.
 ==== Setup cross compile environment variables ==== ==== Setup cross compile environment variables ====
 <code> <code>
 dave@hal9000:~/github-linux-build/linux$ export ARCH=arm64 dave@hal9000:~/github-linux-build/linux$ export ARCH=arm64
  
-dave@hal9000:~/github-linux-build/linux$ export CROSS_COMPILE=aarch64-linux-gnu-+dave@hal9000:~/github-linux-build/linux$ export CROSS_COMPILE=$(pwd)/gcc-linaro-7.5.0-2019.12-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-
 </code> </code>
 +
 ==== Configure the kernel ==== ==== Configure the kernel ====
 +Inside the repository, generate the configuration file before building the kernel tree. 
 <code> <code>
 dave@hal9000:~/github-linux-build/linux$ make adi_zynqmp_defconfig  dave@hal9000:~/github-linux-build/linux$ make adi_zynqmp_defconfig 
Line 64: Line 74:
 dave@hal9000:~/github-linux-build/linux$ dave@hal9000:~/github-linux-build/linux$
 </code> </code>
-==== Build the kernel ==== 
  
 +==== Build the kernel ====
 +Build the kernel via 'make'. This is the same for all Xlinx ZYNQMP MPSoC FPGAs. 
 <code> <code>
 dave@hal9000:~/github-linux-build/linux$ make -j5 Image UIMAGE_LOADADDR=0x8000 dave@hal9000:~/github-linux-build/linux$ make -j5 Image UIMAGE_LOADADDR=0x8000
Line 86: Line 97:
 dave@hal9000:~/github-linux-build/linux$ dave@hal9000:~/github-linux-build/linux$
 </code> </code>
 +
 ==== Build the devicetree FCMOMMS2/3 ==== ==== Build the devicetree FCMOMMS2/3 ====
  
 === Build the one that fits your FPGA carrier and FMC card === === Build the one that fits your FPGA carrier and FMC card ===
 +^ device tree ^ board ^
 | zynqmp-zcu102-rev10-ad9361-fmcomms2-3.dts | [[xilinx>ZCU102]] **Rev. 1.0** and the [[/resources/eval/user-guides/ad-fmcomms2-ebz|AD-FMCOMMS2-EBZ]] or [[/resources/eval/user-guides/ad-fmcomms3-ebz|AD-FMCOMMS3-EBZ]] board | | zynqmp-zcu102-rev10-ad9361-fmcomms2-3.dts | [[xilinx>ZCU102]] **Rev. 1.0** and the [[/resources/eval/user-guides/ad-fmcomms2-ebz|AD-FMCOMMS2-EBZ]] or [[/resources/eval/user-guides/ad-fmcomms3-ebz|AD-FMCOMMS3-EBZ]] board |
 | zynqmp-zcu102-rev10-ad9364-fmcomms4.dts | [[xilinx>ZCU102]] **Rev. 1.0** and the [[/resources/eval/user-guides/ad-fmcomms4-ebz|AD-FMCOMMS4-EBZ]] or [[/resources/eval/user-guides/ad-fmcomms3-ebz|AD-FMCOMMS4-EBZ]] board | | zynqmp-zcu102-rev10-ad9364-fmcomms4.dts | [[xilinx>ZCU102]] **Rev. 1.0** and the [[/resources/eval/user-guides/ad-fmcomms4-ebz|AD-FMCOMMS4-EBZ]] or [[/resources/eval/user-guides/ad-fmcomms3-ebz|AD-FMCOMMS4-EBZ]] board |
 | zynqmp-zcu102-revB-ad9361-fmcomms2-3.dts | [[xilinx>ZCU102]] Rev.B and the [[/resources/eval/user-guides/ad-fmcomms2-ebz|AD-FMCOMMS2-EBZ]] or [[/resources/eval/user-guides/ad-fmcomms3-ebz|AD-FMCOMMS3-EBZ]] board | | zynqmp-zcu102-revB-ad9361-fmcomms2-3.dts | [[xilinx>ZCU102]] Rev.B and the [[/resources/eval/user-guides/ad-fmcomms2-ebz|AD-FMCOMMS2-EBZ]] or [[/resources/eval/user-guides/ad-fmcomms3-ebz|AD-FMCOMMS3-EBZ]] board |
 | zynqmp-zcu102-revB-ad9364-fmcomms4.dts | [[xilinx>ZCU102]] Rev.B and the [[/resources/eval/user-guides/ad-fmcomms4-ebz|AD-FMCOMMS4-EBZ]] board | | zynqmp-zcu102-revB-ad9364-fmcomms4.dts | [[xilinx>ZCU102]] Rev.B and the [[/resources/eval/user-guides/ad-fmcomms4-ebz|AD-FMCOMMS4-EBZ]] board |
 +The device tree **zynqmp-zcu102-revA.dts** can also be used for any ZCU102 FPGA that uses an SD card for boot up. 
 +Building the device tree uses 'make' by turning the .dts file to a .dtb. The command is simply 'make' plus the device tree name with a .dtb file extension.
 <code> <code>
 dave@hal9000:~/github-linux-build/linux$  make xilinx/zynqmp-zcu102-rev10-ad9361-fmcomms2-3.dtb dave@hal9000:~/github-linux-build/linux$  make xilinx/zynqmp-zcu102-rev10-ad9361-fmcomms2-3.dtb
Line 101: Line 115:
  
 ==== Copy the generated files to your SD Card ==== ==== Copy the generated files to your SD Card ====
 +The output files for building the kernel and device tree are **Image** and **<device_tree_name>.dtb**. Refer to the code below to find their respective output directories. The device tree file needs to be renamed to **system.dtb**. See [[:resources:tools-software:linux-software:kuiper-linux]] for more information in configuring the SD card.
 <code> <code>
 dave@hal9000:~/github-linux-build/linux$ cp arch/arm64/boot/Image /media/michael/BOOT/ dave@hal9000:~/github-linux-build/linux$ cp arch/arm64/boot/Image /media/michael/BOOT/
resources/tools-software/linux-build/generic/zynqmp.txt · Last modified: 06 Feb 2023 04:42 by ALEXIS CZEZAR TORRENO