1. Typical Device Tree File Types
| File Extension | Meaning | Typical Purpose |
|---|---|---|
.dts | Device Tree Source | Device Tree source, entry main file, one per board/model |
.dtsi | Device Tree Source Include | Common sections, can be referenced by multiple .dts files, similar to .h in C |
.dtb | Device Tree Blob | Compiled binary file, the file actually used by the kernel |
2. Directory Structure and Hierarchy
Device Tree source files are usually located in the kernel source directory (using LCSC-TaishanPi-3M as example):
bash
arch/
└── arm64/
└── boot/
└── dts/
└── rockchip/
├── rk3576.dtsi
├── tspi-3m-rk3576.dts
|── rk3576-pinctrl.dtsi
├── rockchip-pinconf.dtsi
└── ... (other .dtsi/.dts/peripheral common dtsi, etc.)1
2
3
4
5
6
7
8
9
10
2
3
4
5
6
7
8
9
10
- Each SoC (chip) has its own
xxx.dtsi, such asrk3576.dtsi, describing all on-chip resources (CPU, on-chip peripherals, etc.) - Each board/project has its own
xxx.dts, such astspi-3m-rk3576.dts, describing board-level information (power, external sensors, pin multiplexing, etc.), generally including its own SoC dtsi file
3. include Hierarchy Diagram
Using the specific board dts as the entry point, the system will recursively include all shared resources layer by layer.
- Board dts as the top level,
#includethe on-chip SoC, peripherals, and various common module dtsi files - Each dtsi can continue to
#includemore underlying common resources
4. Classic dts/dtsi Relationship
tspi-3m-rk3576.dts header is written like this:
c
#include "rk3576.dtsi"
#include "rk3576-rk806.dtsi"1
2
2
- Among them,
rk3576.dtsidefines all SoC resources rk3576-rk806.dtsidefines board-level power chip 809 related resources- Others can be connected through include.
5. Summary
- Board .dts is the main entry: ultimately compiled into dtb and passed to the kernel
- dtsi files ensure resource reusability: different boards can share the same SoC and peripheral dtsi templates
- All #includes are recursively merged into the final dtb
6. Common File Division Summary
| File Name | Main Content/Division | Purpose |
|---|---|---|
| tspi-3m-rk3576.dts | Board entry file, project description, board hardware list, peripheral pins, model and compatible, core entry for all hardware configuration include | Compiled to dtb, used for kernel boot |
| rk3576.dtsi | SoC main chip common resource definitions (CPU, interrupt controller, on-chip peripherals, etc.) | Board common section, included by dts |
| rk3576-linux.dtsi / rk3576-android.dtsi | Custom resource configuration for different systems (Linux / Android) | Switch different configurations by system |
| rk3576-rk806.dtsi | Power chip PMIC related configuration information | Chip-level low-level power management |
| tspi-3m-rk3576-core.dtsi | Board-level core basic configuration (clocks, reset, kernel essential peripherals, etc.) | Ensures basic board operation |
| tspi-3m-rk3576-typec.dtsi | Type-C OTG related configuration | Type-C interface |
| tspi-3m-rk3576-usb-host.dtsi | USB host related peripherals | On-board USB HOST interface configuration |
| tspi-3m-rk3576-eth.dtsi | On-board Ethernet interface configuration | Network port/PHY/MDIO resources |
| tspi-3m-rk3576-sdio-wifibt.dtsi | On-board WiFi/Bluetooth module | SDIO wireless module/clock configuration |
| tspi-3m-rk3576-rtc.dtsi | Real-time clock/RTC resources | RTC chip/external clock configuration |
| tspi-3m-rk3576-csi0.dtsi/csi1.dtsi/csi3.dtsi | On-board camera MIPI-CSI channel configuration | Multi-channel camera MIPI interface |
| tspi-3m-rk3576-pcie.dtsi/sata.dtsi/ec20-4g.dtsi | Extension interfaces (choose one of three: PCIe, SATA, 4G module) | On-board MINI card, storage, communication |
| tspi-3m-rk3576-headset-onboard-mic.dtsi | Headphone and on-board microphone related | Audio input/output |
| tspi-3m-rk3576-hdmi.dtsi / ...-dp.dtsi | On-board HDMI, DP display interfaces | On-board video output interface separate management |
| tspi-3m-rk3576-dsi-cXXXXXXX.dtsi | On-board MIPI LCD display screen, divided by model | Adapts to multiple MIPI screen specifications |
| leds node (in dts main file) | On-board LED software/hardware description, status lights, etc. | GPIO-LED control/system indicator lights |
| ... (other dtsi expanded as needed) | Other specialized resources, on-board modules, custom peripherals | Flexible adaptation for complex applications |
Note:
.dtsis the main controller board/project entry, all includes converge here..dtsiis reusable on-chip/peripheral/interface/module resources, select include based on platform and function.- This splitting allows different hardware and customization needs to be batch adapted, modified, shared, and maintained!
- Commenting/uncommenting certain includes can enable/disable specific on-board hardware, providing high customization flexibility.