COMPAS’25 Tutorial - A2. Bonus: Linux Image

Nicolas Derumigny

/!\ This section is for informative use only, as compiling the Linux image requires (even more) disk space and time, mostly due to the use of Buildroot that compiles GCC, Linux, BusyBox and all of their dependencies. It is however required to modify the frequency on ZCU104.

The CVA boot chain is composed of three elements:

The CVA6 SoC boot sequence

Therefore, the CVA6 boot image is composed of 3 partitions:

/!\ The CVA6 image building chain relies on Buildroot to build the Linux kernel, which downloads and recompiles a lot of dependencies, including GCC. This will take space (~20 GiB) and time (1 hour+)!

Buidling the Linux boot image

To build the image generation toolchain, clone this modified CVA6-sdk repo: https://github.com/NicolasDerumigny/cva6-sdk, branch linux_6.6 using the following command:

git clone --recurse-submodule --depth 1 -b linux_6.6 https://github.com/NicolasDerumigny/cva6-sdk.git

To compile the Linux image, go to ~/cva6_sdk and run:

make

To flash the image on the SD card, plug the card in your host PC and run:

sudo -E make flash-sdcard SDDEVICE=/dev/<SD_CARD_DEVICE>

BE CAREFUL TO SELECT THE RIGHT DEVICE, OR YOU MAY LOSE ALL YOUR DATA!

Device tree

Another Device tree is present in u-boot to allow simpler tests without needing to launch a costly bitstream generation at each modification. The file is located in ./u-boot/arch/riscv/dts/cv64a6_pynq_z2.dts (CVA6-sdk repo). make clean is required after every modification for the change to be taken into account, else the former u-boot binary (with unchanged DTB) is used!. Moreover, u-boot must be configured to use this embedded device tree instead of the one provided by the design, using CONFIG_DEFAULT_DEVICE_TREE="cv64a6_pynq_z2" in ./u-boot/configs/openhwgroup_cv64a6_pynq_z2_defconfig

Previous page
Summary