device-tree
/device-tree
Device tree skill for Linux hardware description. Use when writing DTS/DTSI, bindings, overlays, phandles, or debugging OF platform probe failures. Activates on queries about device tree, DTS syntax, phandle, devicetree bindings, DT overlay, or OF graph.
- Author
- mohitmishra786 ↗
- Repository
- low-level-dev-skills ↗
- Licence
- MIT
- Last repository change
- 27.06.2026
Assessment and security
- Files in this package
- 1
- Scripts
- 0
- HTML comments
- 0
- URLs in SKILL.md
- 1
No signals detected. Repository changed on 27.06.2026, without references to retired models or APIs.
MIT, open: use and modify while retaining author attribution.
What it does and when to use it
Device tree skill for Linux hardware description. Use when writing DTS/DTSI, bindings, overlays, phandles, or debugging OF platform probe failures. Activates on queries about device tree, DTS syntax, phandle, devicetree bindings, DT overlay, or OF graph.
Original author description
Device tree skill for Linux hardware description. Use when writing DTS/DTSI, bindings, overlays, phandles, or debugging OF platform probe failures. Activates on queries about device tree, DTS syntax, phandle, devicetree bindings, DT overlay, or OF graph.
How it works
- Purpose
- When to Use
- Workflow
- Common Problems
- Related Skills
SKILL.md preview
---
name: device-tree
description: Device tree skill for Linux hardware description. Use when writing DTS/DTSI, bindings, overlays, phandles, or debugging OF platform probe failures. Activates on queries about device tree, DTS syntax, phandle, devicetree bindings, DT overlay, or OF graph.
---
# Device Tree (Devicetree)
## Purpose
Guide agents through Linux device tree source (DTS): syntax, bindings, phandles, overlays, and how the kernel OF (Open Firmware) layer parses hardware description into `platform_device` instances.
## When to Use
- Platform driver not probing — DT mismatch
- Adding a new board `.dts` or fragment overlay
- Understanding `compatible`, `reg`, `interrupts`, `clocks` properties
- Cross-checking hardware with `skills/kernel-dev/platform-device-model`
## Workflow
### 1. DTS structure
```dts
/dts-v1/;
#include "soc.dtsi"
/ {
model = "My Board";
compatible = "vendor,my-board", "vendor,soc-family";
soc {
uart0: serial@40011000 {
compatible = "vendor,uart";
reg = <0x40011000 0x400>;
interrupts = <GIC_SPI 38 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&clk_uart0>;
status = "okay";
};
};
};
```
### 2. Key properties
| Property | Meaning |
|----------|---------|
| `compatible` | Driver match string (most specific first) |
| `reg` | MMIO address + length ( `#address-cells`, `#size-cells` ) |
| `interrupts` | IRQ specifier (interrupt parent defines cells) |
| `clocks` / `clock-names` | phandle to clock provider |
| `status` | `"disabled"` skips probe |
### 3. Phandles
```dts
clk_uart0: clock-uart {
compatible = "vendor,clk";
#clock-cells = <0>;
};
serial@... {
clocks = <&clk_uart0>; /* phandle reference */
};
```
### 4. Kernel parsing
```
OF core reads DTB at boot
├── of_platform_populate() creates platform_devices
└── driver `.of_match_table` matches `compatible`
```
```c
static const struct of_device_id my_of_match[] = {
{ .compatible = "vendor,uart" },
{ }
};
MODULE_DEVICE_TABLE(of, my_of_match);
```
### 5. Compile and inspect
```bash
dtc -I dts -O dtb -o board.dtb board.dts
dtc -I fs -O dts /proc/device-tree 2>/dev/null | less
ls /sys/firmware/devicetree/base/
```
Bindings live at [devicetree.org](https://www.devicetree.org/) — always cite binding name in commits.
### 6. Overlays (configfs)
```bash
# Runtime overlay apply (when CONFIG_OF_OVERLAY)
mkdir -p /config/device-tree/overlays/my-overlay
cat my-overlay.dtbo > /config/device-tree/overlays/my-overlay/dtbo
```
### 7. Agent usage
```
/device-tree Write DTS fragment for I2C sensor on i2c1 with interrupt on GPIO5
```
## Common Problems
| Symptom | Cause | Fix |
|---------|-------|-----|
| Driver not bound | `compatible` typo | Match driver's `of_match_table` |
| Wrong MMIO | `#address-cells` mismatch | Follow SoC `.dtsi` |
| IRQ not firing | Wrong interrupt parent/cells | Copy from working board DTS |
| Probe defer loop | Clock/regulator missing | `-EPROBE_DEFER` supplier in DT |
| Overlay fails | Symbol unresolved | `__fixups__` / label exports |
## Related Skills
- `skills/kernel-dev/platform-device-model` — probe and sysfs
- `skills/kernel/device-drivers` — `devm_of_iomap`
- `skills/baremetal/datasheet-and-refmanual-reading` — HW to DT mapping
- `skills/embedded/zephyr` — Zephyr devicetree (different tooling)
- `skills/kernel-dev/bus-drivers-i2c-spi` — bus node children
Versions
The database has no other skills named device-tree.
Database snapshot: 13.11.2026 · package version d9f7aee671d7 (SHA-256 digest of the entire package)
Downloads in the last 30 days: 0 · ranking
Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.
Similar skills
- 100device-driver-development
Use when developing, reviewing, debugging, porting, or engineering Linux kernel device drivers, kernel modules, device tree bindings, bus clients, subsystem drivers, DMA/IRQ/memory paths, userspace interfaces, or hardware bring-up plans. - 100schem2firmware-co-design
Hardware-to-firmware co-design, Device Tree generation, pinout mapping, and peripheral initialization. Use this skill when converting schematic nets into firmware configurations: Zephyr RTOS app.overlay, Linux Device Tree (.dts), ESP-IDF sdkconfig / gpio_map.h, STM32CubeMX… - 100platform-device-model
Platform device model skill for Linux driver binding. Use when implementing platform_driver probe/remove, sysfs attributes, device properties, or deferred probe. Activates on queries about platform_device, platform_driver, driver model, sysfs, probe remove, or Linux device bus. - 100kernel-development-skills
Workflows of experienced Linux kernel engineers for writing, debugging, reviewing, and upstreaming kernel code in mainline, linux-next, stable/LTS, Android, and vendor BSP trees. Use for any kernel or driver task, including probe/remove and devm teardown bugs, devicetree… - 100rk-linux-bringup-skill
指导 AI agent 与人协作,把只有原厂系统的 Rockchip(RK3399/RK356x/RK3588)板子适配到 Armbian 或主线 Linux:从原厂取证、零写入点亮、逐外设写 DTS、装进镜像冷启动验证,直到可提交上游。当用户要移植 Linux、点亮一块 RK 板、修 dtb 或外设不工作、或整理 dts 提 PR 时使用。 - 100device-drivers
Use when writing or debugging Linux drivers: platform, I2C/SPI, device-tree, char-device, IRQ, DMA, regmap, PM, sysfs, udev, NACK, -EREMOTEIO, or probe failures.