Hello community!
It took me quite some time to figure out how to create/adjust/change a custom device tree file for linux, but I finally I have managed to compile the device tree and can go ahead to create a device tree for custom hardware.
The DTSI file discribes every function that the SoC has (CPUs, perihperals, controllers, ..).
The DTS file describes the system. It imports the dtsi file and enables some of the peripherals described in the dtsi file. It also handles pin muxing and description of external devices.
DTS is compiled to a DTB (binary) using the device tree compiler DTC. To actually have this work, the DTS file has to be processed by a C preprocessor first (like CPP) and the result passed to DTC.
But there are some things that are quite strange.
Thanks for helping me understand,
Lars
Hi Lars,
DTSI files are include files for DTS files. At the end of the day you can write everything in a DTS file but it will be more ordered if you use DTSI files. Actually when you decompile a .dtb into a .dts it will generate a single .dts that includes everything that was included (.dts and .dtsi files) to generate the .dtb file.
The numbers assigned to the macro are the Pad Mux Reg and Pad Control Reg offsets and the pin mux Alt selected for that pin. And the number besides the macro is the value of the Pad Control Reg. The following thread explains a good example:
32Khz clock on CCM_CLKO2 (SD1_WP)
To develop your custom device tree this post will be helful
Basic Device Tree for the Udoo Board
Regards,
Carlos
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------