Introduction to Microchip’s Official Flattened Image Tree (FIT)
Introduction to Microchip’s Official Device Tree Overlay (DT Overlay)
This series of articles will create my first runnable embedded Linux system based on the Buildroot repository provided by Microchip.
Basic Knowledge of FIT
Why Introduce FIT in Linux Systems
FIT (Flattened Image Tree) is an image format used for booting the Linux kernel. It is mainly used to combine and encapsulate multiple images (such as kernel images, device tree binaries, etc.) into a single file structure known as “Flattened Image Tree”, which facilitates system management and booting.
Using FIT in Microchip MPU Embedded Linux Development
All DT Overlay related files for Microchip MPU are located in buildroot-mchp-linux4microchip-2024.10/output/build/dt-overlay-mchp-linux4microchip-2024.10. Taking the sama5d2-xult development board as an example, you can open the sama5d2_xplained.its file in that directory.

<span>From the screenshot above, we can see that the generated FIT image file includes the kernel zImage file, the at91-sama5d2_xplained.dtb file, and multiple DT Overlay information.</span>
<span>FIT image = zImage + dtb + multiple dtbo</span>
Taking the sama5d2-xult development board as an example, in the dt-overlay-mchp-linux4microchip-2024.10/sama5d2_xplained directory, you can see multiple dtso files. The dtbo files need to be compiled to generate the corresponding dtbo and finally linked to the final FIT image.

<span>Open the dt-overlay-mchp-linux4microchip-2024.10/sama5d2_xplained/sama5d2_xplained_isc.dtso file. This dtso file describes the ISC interface of the SAMA5D27 chip, including the definition of the ISC interface pins and modules to prevent pin conflicts.</span>

<span>When we need to use the camera located in the ISC module on the SAMA5D27 MPU, we not only need to add the content of sama5d2_xplained_isc.dtso to the original device tree content but also need to add relevant descriptions of the camera module in the device tree content. Taking the OV7670 as an example, we then open the sama5d2_xplained_ov7670.dtso file.</span>

<span>In the sama5d2_xplained_ov7670.dtso file, we continue to add information about the corresponding ISC module required by the ov7670 module and the I2C controller module for register read/write control. This way, in our system, we can dynamically adjust the dtbo files loaded through U-Boot to dynamically create and delete nodes in the Linux device tree.</span>
When we boot U-Boot, we can dynamically create the Omnivision image sensor (ov7670) node using the following command.
bootm 0x24000000#kernel_dtb#isc#ov7670
Regenerating a New FIT Image in Buildroot
Based on the above introduction, when we change the Linux kernel dts file according to project needs, we need to regenerate a new FIT image file for the Microchip MPU to facilitate the subsequent generation of the final burn image file.
<span>Taking the sama5d2-xult development board as an example:</span>
<span>Assuming we have modified the buildroot-mchp-linux4microchip-2024.10/output/build/linux-custom/arch/arm/boot/dts/microchip/at91-sama5d2_xplained.dts file and recompiled the kernel.</span>
make linux-rebuild
<span>Next, update and generate a new FIT image file:</span>
<span>Enter the buildroot-mchp-linux4microchip-2024.10/output/build/dt-overlay-mchp-linux4microchip-2024.10 directory and execute the following command:</span>
KERNEL_DIR=../linux-headers-custom KERNEL_BUILD_DIR=../linux-custom make ARCH=arm CROSS_COMPILE=arm-buildroot-linux-gnueabihf- sama5d2_xplained.itb
FIT Image File Output from the SAMA5D2 Xplained Development Board
<span>The newly generated FIT image sama5d2_xplained.itb should be copied to the buildroot-mchp-linux4microchip-2024.10/output/images directory, replacing the original file. After deleting some files in the images directory, regenerate the new final burn image file.</span>
Files that need to be manually deleted: rootfs.tar, rootfs.ext2, sdcard.img
If we update the dtso files, we need to regenerate the new dtbo files using the following command and repeat the above steps to regenerate the new FIT image.
KERNEL_DIR=../linux-headers-custom KERNEL_BUILD_DIR=../linux-custom make sama5d2_xplained_dtbos
