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.
- ) the DTS file contains a lot of lines similar to
linux,something = "value";
every time the preprocessor has processed the DTS file, there are 4 instances or "linux," that have been replaced by "1,". Any idea why this could happen?
- The dtsi output file generated by the PINS tool seems to only contain info on the PIN mux. From what I understood, this should be part of the DTS file, not the DTSI file? As the pinout is a description of the system, not the SoC.
The exported file describes only the iomux module, followed by the pin setup. Is this just meant to provide a starting point to create the actual DTS file? It could contain info on e.g. the cpu or other modules like i2c/uart/spi etc?
- When looking at the pin_mux.c file exported using PINS, I can see that the pins are assigned to the desired function: HW_IOMUXC_SW_MUX_CTL_PAD_EPDC_SDCE3_WR(
So, in this case, the EPDC_SDCE3 pin is used for RGMII_TD1, what is the pins alternate function #2.
I do not understand how the numbering in the DTS(I) file works.
The default sabre DTS file file contains
MX7D_PAD_... is expanded to multiple numbers, like
0x1048 0x08BD 0x0000 0x0005 0x0000
and the first two values seem to be related to registers, the second last is the alternate pin function number.
The exported DTSI file contains e.g.
what is different to the ogirinal file (0x14 instead 0x1). In fact, EVERY pin in the exported file has the value 0x14. What does this value mean?
Thanks for helping me understand,