{"docs":[{"id":148,"title":"Device Tree Explained: Describing Hardware to Linux","heading":"Device Tree Explained: Describing Hardware to Linux","subheading":null,"category":"Embedded Linux","body":{"root":{"type":"root","children":[{"type":"heading","tag":"h3","version":1,"children":[{"type":"text","text":"How it fits together","version":1}]},{"type":"paragraph","version":1,"children":[{"type":"text","text":"The processor vendor provides an include file describing the system-on-chip: every peripheral with its address, interrupts and clocks, mostly marked disabled. The board file includes it, enables the peripherals the board uses, sets their pin multiplexing and adds child nodes for external devices such as a sensor on an I2C bus.","version":1}]},{"type":"paragraph","version":1,"children":[{"type":"text","text":"The device tree compiler turns the source into a binary blob. At boot the kernel walks the tree and, for each enabled node, looks for a driver whose match table lists the same compatible string. The bindings documentation in the kernel source defines which properties each compatible string requires, and most bindings are now machine-checkable schemas.","version":1}]}],"direction":"ltr","format":"","indent":0,"version":1}},"tags":"Embedded Linux, Device Tree, Linux Kernel","cardCta":{"label":null,"link":null},"pageCta":{"label":"Talk to AAVICO engineering","link":"/contact"},"excerpt":"Embedded Linux learns what hardware a board has from a device tree rather than from code. Getting it right is much of the work of new board bring-up.","featuredImage":null,"type":"Blog","readTime":"3 min read","publishedAt":"2026-11-15T19:51:00.000Z","heroImage":null,"introText":"A PC discovers its hardware through firmware tables and buses that enumerate themselves. Most embedded boards have neither: an I2C sensor or a GPIO-driven LED cannot announce itself. Linux on Arm, RISC-V and other embedded architectures therefore reads a device tree, a data structure describing the hardware, which the bootloader passes to the kernel at boot. This article explains how it is organised and used.","metrics":[{"id":"device-tree-explained-describing-hardware-to-lin-metric-1","value":".dts","label":"Device tree source: the human-readable text file describing a board.","icon":null},{"id":"device-tree-explained-describing-hardware-to-lin-metric-2","value":".dtb","label":"The compiled binary blob the bootloader passes to the kernel.","icon":null},{"id":"device-tree-explained-describing-hardware-to-lin-metric-3","value":"compatible","label":"The property the kernel matches against drivers to decide which one handles a node.","icon":null},{"id":"device-tree-explained-describing-hardware-to-lin-metric-4","value":"Overlay","label":"A fragment applied on top of a base tree, used for add-on boards and options.","icon":null}],"gallery":[],"challenge":{"root":{"type":"root","children":[{"type":"paragraph","version":1,"children":[{"type":"text","text":"A device tree error rarely produces a clear message. A wrong interrupt number, a misspelt compatible string or a node left disabled simply means a driver never probes, and the symptom is a missing device with nothing obvious in the log.","version":1}]},{"type":"paragraph","version":1,"children":[{"type":"text","text":"Copying nodes from another board is the usual cause. Pin multiplexing, clock assignments and regulator references differ between boards even with the same processor, and a node correct on the evaluation board can be quietly wrong on yours.","version":1}]}],"direction":"ltr","format":"","indent":0,"version":1}},"blockquote":{"quote":"The device tree is the board schematic written for the kernel. Review it against the schematic, line by line.","author":"","role":"AAVICO Engineering"},"supportImage1":null,"deliverables":{"root":{"type":"root","children":[{"type":"paragraph","version":1,"children":[{"type":"text","text":"Start from the vendor include file and the evaluation board file, then create your own board file rather than editing theirs.","version":1}]},{"type":"paragraph","version":1,"children":[{"type":"text","text":"Enable each peripheral the schematic uses, check its pins and supplies against the schematic, and add nodes for external devices with their bus addresses and interrupts.","version":1}]},{"type":"paragraph","version":1,"children":[{"type":"text","text":"Validate the tree against the bindings with the kernel schema checks, then confirm on hardware that each driver probes.","version":1}]}],"direction":"ltr","format":"","indent":0,"version":1}},"results":[{"id":"device-tree-explained-describing-hardware-to-lin-result-1","title":"Faster Bring-Up","description":"Each interface works when its driver is enabled, or fails with a clear cause."},{"id":"device-tree-explained-describing-hardware-to-lin-result-2","title":"Fewer Kernel Patches","description":"Board differences live in data, not in modified driver code."},{"id":"device-tree-explained-describing-hardware-to-lin-result-3","title":"Reusability","description":"Board variants share a common include file and differ only where the hardware does."},{"id":"device-tree-explained-describing-hardware-to-lin-result-4","title":"Upstream Readiness","description":"A tree that follows the bindings can be submitted alongside mainline support."}],"lookingAhead":{"root":{"type":"root","children":[{"type":"paragraph","version":1,"children":[{"type":"text","text":"Use overlays for genuinely optional hardware, such as plug-in modules, instead of near-identical board files.","version":1}]},{"type":"paragraph","version":1,"children":[{"type":"text","text":"When a device does not appear, check its driver probe messages and the running tree under /proc/device-tree before changing code.","version":1}]}],"direction":"ltr","format":"","indent":0,"version":1}},"supportImage2":null,"testimonial":{"quote":null,"author":null,"role":null,"photo":null},"challengesSolved":[{"id":"device-tree-explained-describing-hardware-to-lin-challenge-1","title":"Drivers that never probe, with no error shown","description":null,"icon":null},{"id":"device-tree-explained-describing-hardware-to-lin-challenge-2","title":"Nodes copied from a board with different wiring","description":null,"icon":null},{"id":"device-tree-explained-describing-hardware-to-lin-challenge-3","title":"Edits made directly to the vendor board file","description":null,"icon":null},{"id":"device-tree-explained-describing-hardware-to-lin-challenge-4","title":"Near-duplicate trees for every variant","description":null,"icon":null}],"relatedPosts":[],"contactUs":{"show":true},"updatedAt":"2026-11-15T17:32:32.682Z","createdAt":"2026-11-15T17:32:32.682Z"}],"hasNextPage":false,"hasPrevPage":false,"limit":10,"nextPage":null,"page":1,"pagingCounter":1,"prevPage":null,"totalDocs":1,"totalPages":1}