How to generate the device tree source and how to compile it to a device tree blob file that Linux needs
Overview
Important Note: This page refers to the Linux Device Tree, that is required by Linux in order to boot. On Arria 10 there are two different Device Trees: one required by Bootloader (U-Boot) and this one, required by the Linux kernel.
For detailed information about the Device Tree Generator see
Device Tree Generator User Guide.
Prerequisites
The following items are required:
- Host PC running Linux (CentOS 6.6 was used for testing)
- Altera SoC EDS based on Release Tags
Procedure
1. Compile the GHRD as described in
Compiling the Hardware Design to obtain the .sopcinfo file. Or simply use the pre-compiled GHRD.
2. Start an Embedded Command Shell and go to GHRD folder (assumed here to be saved in the home folder):
$ ~/altera/16.1/embedded/embedded_command_shell.sh
$ cd ~/a10_soc_devkit_ghrd
3. Run the Device Tree Generator
$ sopc2dts --input ghrd_10as066n2.sopcinfo --output ghrd_10as066n2.dts --board hps_a10_common_board_info.xml --board hps_
a10_devkit_board_info.xml --board ghrd_10as066n2_board_info.xml --bridge-removal all --clocks
This will generate the file ~/a10_soc_devkit_ghrd/ghrd_10as066n2.dts which a text representation of the Device Tree.
5. Use the Device Tree Compiler (dtc) to convert the device tree source to the binary format required to build Linux
$ dtc -I dts -O dtb -o socfpga_arria10_socdk_sdmmc.dtb ghrd_10as066n2.dts
This will generate the file ~/a10_soc_devkit_ghrd/socfpga_arria10_socdk_sdmmc.dtb required by Linux to boot.