Questions tagged [device-tree]

The Device Tree is a data structure for describing hardware. Rather than hard coding every detail of a device into an operating system, many aspects of the hardware can be described in a data structure that is passed to the operating system at boot time. The device tree is used both by Open Firmware, and in the standalone Flattened Device Tree (FDT) form.

Device Trees are related to open firmware. It is often abbreviated as DT. They are a mechanism to pass hardware parameters to an OS from a boot loader. Device Trees are common on embedded PowerPC CPUs and more recently ARM CPUs. There is a lot of effort in the Linux kernel to support and use Device trees.

The main benefit is that one kernel binary may support many systems, even ones not conceived when the binary was built.

The device tree supports variable length data with keys, much like XML. Also, by itself, it does not define what the keys mean beyond a few standard details like an address, etc. For instance, it doesn't describe how a video controller entry should look. It is fairly detailed on CPU, memory and bus topologies.

References

Related Tags

  • - older PC BIOS standard, competing with DT/Open Firmware
  • -new PC BIOS standard, competing with DT/Open Firmware
  • - an embedded boot loader which functions as a BIOS on many embedded systems. u-boot supports passing devices trees to an OS.
630 questions
4
votes
1 answer

How does qemu-riscv pass the Device Tree Blob to the guest kernel?

How does the default bios (OpenSBI) in qemu-system-riscv pass the Device Tree Blob to a guest? I can see from the documentation for qemu-system-arm 'virt' platform that QEMU passes the address of the Device Tree Blob (dtb) to guests in r0 when using…
ajxs
  • 3,347
  • 2
  • 18
  • 33
4
votes
3 answers

How to build without make clean after making changes in dts with AOSP?

I made few changes in dts and when i gave make -j8 from my aosp-root-directory, I don't see the changes taking place after building it and booting up my board. It just quickly builds in a minute or so. For the changes to take place, i had to give…
Sourabrt
  • 2,126
  • 2
  • 8
  • 22
4
votes
0 answers

cannot create directory 'device-tree': Operation not permitted

I am on linux operating system. I am Trying to Load device tree Overlays via Configfs. I tried below steps: $ sudo su # mount -t configfs none /sys/kernel/config The mount was successful. however when I try to create a directory, I get…
Sami
  • 311
  • 2
  • 8
4
votes
1 answer

gpiod - use labels in devicetree

I want to use libgpiod to control a few GPIOs via userspace on a custom board. I have an i.MX6UL processor, which has hundreds of pins, I'll use only 8 of them (as GPIOs). I read about the libgpiod as it is replacing the old sysfs API, and I'm happy…
Franz Forstmayr
  • 1,219
  • 1
  • 15
  • 31
4
votes
1 answer

Replace kernel builtin module with a loadable one

I have developped a kernel module to manage a nf4 tag as a char device. I have developped this module outside of the kernel and tested it compiled as a loadable kernel module (i.e. .ko) during the development phase. Once the driver has been…
Arkaik
  • 852
  • 2
  • 19
  • 39
4
votes
2 answers

Built-in kernel driver still need device tree?

If I build a kernel driver as a module, it can be inserted into the kernel at run-time manually with insmod or modprobe, that i am clear. But are the following statements about device tree, correct? If I build a kernel driver as a module it will be…
Consy
  • 326
  • 3
  • 22
4
votes
1 answer

Extract vendor blobs and make a device tree

I'm trying since many time to get a CM (now Lineageos)13/14.1 build for my device, which is a Huawei Mediapad T1-A21W (codename: hwt1a21l) with EMUI 3.0 (Kit Kat 4.4.4) but i'm limited for the following reasons: There are no device tree to work…
Mustang_ssc
  • 41
  • 1
  • 1
  • 4
4
votes
0 answers

How to build a device tree?

Ok, I wanted to build custom ROM for my device (let's say i want lineage os ex cyanogenmod), but there isn't device tree anywhere. So how to build device tree I couldn't find any tutorial for that out there. From this I learned a little. But how to…
4
votes
2 answers

How to cope with platform fragmentation, is device tree the answer?

My task is to implement a custom layer with fixed names for things like Ethernet and LEDs. It needs to be the same on x86 and ARM devices. So the Power LED and eth1 is always the same for the applications, but are not connected to the same hardware…
Rotesmofa
  • 67
  • 8
4
votes
0 answers

Specifying GPIO Numbers for IO Expander in Linux Device Tree

I'm trying to add a PCA9557 I/O expander to an arm-based system on an I2C bus. The system already has another I/O expander on a different I2C bus. I am trying to figure out how to specify which GPIO numbers the pins on the new expander get, and how…
Jeremy
  • 1,083
  • 3
  • 13
  • 25
4
votes
1 answer

device-tree overlay: fragment numbers

Consider the following device-tree overlay example. The fragments are numbered 0, 1, 2. Do the numbers matter? Do they have to be in ascending order? Or would 0, 2, 1 also work? Where is it specified? /dts-v1/; /plugin/; / { fragment@0 { …
sergej
  • 17,147
  • 6
  • 52
  • 89
4
votes
1 answer

linux kernel: regulator consumer usage from userspace

I have some kind of driver in user space: program talk via some interface(rs232) with device. Also I have pin(gpio) to switch on/off this device. I do not code in my program concrete gpio, to make it more portable, so I modify device tree…
fghj
  • 8,898
  • 4
  • 28
  • 56
4
votes
3 answers

Driver binding using device tree without compatible string in the driver

I saw one scenario where "struct of_device_id" is not defined in the driver, but in the device tree(dts) file compatible string added for the same device entry. Following is the sample device tree entry for the chip. &i2c1 { ... adv7ex:…
user3693586
  • 1,227
  • 5
  • 18
  • 40
4
votes
1 answer

Reading Device tree node with Interrupt property

I have following snippets the from two different Device tree source. UART1: serial@ef600400 { device_type = "serial"; compatible = "ns16550"; reg = <0xef600400 8>; virtual-reg = <0xef600400>; …
Amit Singh Tomar
  • 8,380
  • 27
  • 120
  • 199
4
votes
1 answer

Linux kernel boot: how is memory allocation done when DTB and initramfs are initially in memory?

When booting the Linux kernel, it is possible to load an initramfs archive and a DTB file in RAM and specify those physical addresses to the kernel. For example, using U-Boot, you could do: bootz 0x80008000 0x82000000 0x81000000 which means: boot…
eepp
  • 7,255
  • 1
  • 38
  • 56