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
12
votes
2 answers

Interpretation of gpio: in fixed-regulator device tree entry?

I'm trying to control (on/off) a voltage regulator that is mapped to a GPIO pin and powers an external device. The device tree for the regulator has the following entry: reg_usb1_vbus: usb1_vbus { compatible = "regulator-fixed"; …
11
votes
2 answers

how to access and debug a FDT/DTS device tree from a Linux driver (seg-fault)

I have written a Linux kernel-module to act as an FPGA driver for a custom board based off the Freescale P2020RDB. The driver contains several #defines to specify various addresses, sizes, bus-widths, etc. I would like to access the board's…
Trevor
  • 1,613
  • 3
  • 22
  • 34
11
votes
1 answer

Purpose and usage of GPIO-Hog declaration

Questions What is the purpose and use-case of the gpio-hog declaration? Can a 'hogged' gpio pin be interfaced with from Userspace? If a 'hogged' gpio pin cannot be interfaced with from Userspace, then is there any mechanism to configure GPIO pins…
Liam Kelly
  • 3,524
  • 1
  • 17
  • 41
11
votes
1 answer

Hello World for common clock framework driver on Raspberry Pi 3

I am trying to write a common clock framework driver for a clock that I have attached to my Raspberry PI 3 via I2C. NOTE: I am very new to both Linux and kernel programming. Update: SUCCESS! The code below works for a Hello World driver, and the…
David Cater
  • 415
  • 3
  • 15
11
votes
3 answers

How devices in device tree and platform drivers were connected

I read some articles about this topic. but none of them describes the details. What I know is: declare "compatible" property in Device tree: gpio0: gpio@44e07000 { compatible = "ti,omap4-gpio"; ... }; and make the connection to platform…
jianing
  • 153
  • 1
  • 1
  • 9
11
votes
2 answers

device-tree mismatch: .probe never called

I'm having trouble understanding how device-tree works, or specifically why this driver won't init. This is in the rockchip vendor kernel for android, version 3.10 drivers/watchdog/rk29_wdt.c (reduced for readability) static const struct…
aep
  • 776
  • 5
  • 26
11
votes
1 answer

Device tree driven kernel for raspberry pi

I'd like to boot the raspberry pi with a device-tree-driven linux kernel, is there anything special to do to do that? Can anyone point what are required to set up a device-tree-based kernel boot up for the raspberry pi. I may need to have raspberry…
Amit Singh Tomar
  • 8,380
  • 27
  • 120
  • 199
11
votes
1 answer

What "compatible" key to use in device tree?

I'm trying to write a device tree overlay to recognize a SPI-based enc28j60 module to my BeagleBone Black. This module doesn't show up in /kernel-dev/Documentation/devicetree/bindings but there does exist a driver for it in the kernel. Does the lack…
sholsapp
  • 15,542
  • 10
  • 50
  • 67
10
votes
1 answer

How to load device tree overlay on kernel 3.19+

Kernel 3.19 (re-)introduced Device Tree Overlays. I am on Linux kernel 3.19.4, via Fedora (3.19.4-200.fc21.armv7hl). I have an overlay file overlay.dts as described in the documentation. overlay.c contains functions to work with overlays, including…
ToBeReplaced
  • 3,334
  • 2
  • 26
  • 42
10
votes
2 answers

Linux Device Tree Help (GPIO controller/interrupts)

I've been learning about linux device trees and we've been trying to start porting some of our older code to use them. I'm having a little bit of trouble with the gpio controller node: gpio1: gpio-controller@c00 { #gpio-cells = <2>; …
nigp4w rudy
  • 525
  • 1
  • 5
  • 9
9
votes
2 answers

Linux, spidev: why it shouldn't be directly in devicetree?

I want to define a SPI device with usermode access, as explained for example in http://linux-sunxi.org/SPIdev Following these examples, I added in the devicetree this : &ecspi1 { .... other stuff ... mydev@0 { compatible = "spidev"; …
ddbug
  • 1,392
  • 1
  • 11
  • 25
9
votes
1 answer

How to work with reserved CMA memory?

I would like to allocate piece of physically contiguous reserved memory (in predefined physical addresses) for my device with DMA support. As I see CMA has three options: 1. To reserve memory via kernel config file. 2. To reserve memory via kernel…
8
votes
1 answer

What is reg property in device tree?

What is address-cell and size-cells in the device tree? Is reg is related to address-cell and size-cell? If yes, then how? For example: memory: memory@20000000 { #address-cells = <1>; #size-cells = <1>; …
Pankaj Suryawanshi
  • 681
  • 1
  • 9
  • 23
8
votes
2 answers

what is Gpio hog in device tree?

I am trying to set a pin mode in device tree for am335. I change the pinmux node in device tree as below. pinctrl_test: pinctrl_test_pins { pinctrl-single,pins = < 0x078 0x07 /* P9_12 OUTPUT | MODE7 | PULLDOWN */ 0x048 0x07 /*…
Daniel
  • 121
  • 1
  • 1
  • 7
8
votes
1 answer

Mapping device tree interrupt flags to devm_request_irq

I am currently writing a device driver for Linux for use of PowerPC. The device tree entry is as follows: // PPS Interrupt client pps_hwirq { compatible = "pps-hwirq"; interrupts = <17 0x02>; // IPIC 17 = IRQ1, 0x02 =…
Damien
  • 785
  • 3
  • 8
  • 18
1
2
3
41 42