Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to program Linux .dts device tree files?

Tags:

I'm going to launch a Linux on my development board, and i need a dts file (device tree file) to describe the whole hardware. But I only know very little about the syntax of this file which is not enough to run Linux properly on the board.

What i know now are only how to describe a unit's interrupt number, frequency, address, parent-unit and its compatible driver type (as described below):

ps7_scuwdt_0: ps7-scuwdt@f8f00620 {
                        compatible = "xlnx,ps7-scuwdt-1.00.a";
                        device_type = "watchdog";
                        interrupt-parent = <&ps7_scugic_0>;
                        interrupts = < 1 14 769 >;
                        reg = < 0xf8f00620 0xe0 >;
                } ;

Other advanced usage or grammar is unfamiliar to me.

like image 253
Ezio Avatar asked Jul 05 '13 11:07

Ezio


People also ask

What is device tree file in Linux?

The device tree is a set of text files in the Linux kernel source tree that describe the hardware of a certain platform. They are located at arch/arm/boot/dts/ and can have two extensions: *. dtsi files are device tree source include files.

How do I read a DTS file?

dts files are final device trees containing board-level information. The . dtsi extension denotes “device tree source include”. The inclusion works by overlaying the tree of the including file over the tree of the included file, producing a combined compiled binary.


1 Answers

Take a look at the dts of the board which most closely resembles your dev-board. Use that as a reference and make changes to the dts according to the differences between the reference board and your dev-board.

Also checkout the following :
- Device-tree Documentation project at eLinux (has a vast collection of links to start reading).
- Series of articles on the basics of device tree.
- Walkthrough of migrating to device-tree.

like image 95
TheCodeArtist Avatar answered Oct 07 '22 12:10

TheCodeArtist