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-tree
661
questions
60
votes
3
answers
159k
views
How to compile dts Linux device tree source files to dtb?
I have a device tree file (.dts) and I want to compile the file for my powerpc based board.
How can I do it on my machine, which is not powerpc based?? Can I do it with the DTC installed on my Ubuntu ...
33
votes
1
answer
16k
views
Device tree compiler not recognizes C syntax for include files
I want to compile my board device tree manually. I have downloaded the latest version of dtc from its official source, but when I try to run the following command, I get an error advising me to change ...
32
votes
5
answers
80k
views
Tool to visualize the device tree file (dtb) used by the Linux kernel? [closed]
I am looking for a tool which can graphically represent the hardware device tree used in linux kernel. I am trying to understand linux kernel for particular arm chipset. It would be a really useful ...
30
votes
1
answer
21k
views
How to add i2c devices on the Beaglebone Black using device tree overlays?
Why should I read this?
If you have a Beaglebone Black (BBB) and you want to wire up your own devices to it (not capes), you might already have heard about the device tree. In my case I wanted to ...
28
votes
3
answers
39k
views
Quick rebuild of device tree only with Yocto/bitbake?
So, each time I modify the device tree I typically change the dts in a custom recipe and rebuild the image. The rebuild takes a long time since it rebuilds the entire kernel, and then the image needs ...
25
votes
3
answers
25k
views
Why Device Tree Structure (DTS) file is needed both in bootloader and kernel source code?
Bootloaders like U-Boot that do not implement the Open Firmware API, are expected to pass to the kernel a binary form of the flattened device tree - LinuxFDTBlob
Why are the DTS files present in the ...
23
votes
1
answer
31k
views
What is the difference between .dts file and .dtsi file?
What is the difference between .dts file and .dtsi file? Is there a difference when generating device tree blobs? When to use one or the other?
22
votes
4
answers
45k
views
How to program Linux .dts device tree files?
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 ...
18
votes
2
answers
11k
views
Hello Word Device Tree Based device driver
I have read and almost gone through all the linux kernel documentation on the device tree and device tree overlays.I am not able to understand if we have to create a new entree in the device tree of ...
18
votes
4
answers
10k
views
Difference between dts and ACPI
We can declare platform device information in dts file, rather than hard coding every data
into operating system. Taking "arm" architecture as example. it supports dts and we will
take dts ...
14
votes
2
answers
26k
views
imx6 Device Tree compilation -- FATAL ERROR: Unable to parse input tree
I am working on Embedded Linux for TX6U-8010 based on Freescale imx6.
I am trying to compile dtb using the device tree compiler (dtc). However when I use the command:
dtc -O dtb -o imx6dl-tx6u-801x....
14
votes
2
answers
21k
views
How to put comments in device tree source files
How do i put multiline or single line comments in device tree source files. I couldn't find it anywhere.
Does the default c way of using comments work?
14
votes
2
answers
13k
views
ARM Linux Atags vs Device Tree
What is the difference between device tree and ATAGs? Also, are ATAGs a must and does the kernel expect them at a fixed address, or does it expect them in r0-r3?
14
votes
2
answers
6k
views
Named GPIOs in DeviceTree
I am trying to create a device tree for an embedded system, and would like to expose a few GPIOs to userspace. These are not and should not be used by kernel drivers. For instance, there is a USB ...
12
votes
3
answers
19k
views
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";
...
12
votes
1
answer
6k
views
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, ...
12
votes
2
answers
6k
views
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 {...
12
votes
1
answer
15k
views
Linux kernel dtb vs dtbo
I am developing a device driver for a device.I wanted to know besides writing the device driver what and when it is necessary for it - a device tree blob (dtb) or a device tree overlay (dtbo).
Is it ...
11
votes
2
answers
7k
views
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 (...
11
votes
1
answer
10k
views
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 ...
11
votes
2
answers
20k
views
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,...
11
votes
1
answer
5k
views
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 ...
11
votes
1
answer
1k
views
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 ...
10
votes
2
answers
20k
views
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-...
10
votes
1
answer
18k
views
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 ...
10
votes
1
answer
2k
views
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 ...
9
votes
2
answers
14k
views
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 ...
9
votes
2
answers
3k
views
In linux, what is difference between Open firmware device tree and flattened device tree
In linux, what is difference between Open firmware device tree and flattened device tree.
How to identify the linux kernel is using which Device tree OF DT or FDT.
9
votes
2
answers
20k
views
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 ...
8
votes
1
answer
5k
views
API to read the device tree from userspace
Is there an API to read the Open-Firmware device tree from userspace?
For example, reading /sys/firmware/fdt (flattened device tree)?
If not, is the file format published so a userspace application ...
8
votes
1
answer
11k
views
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 ...
8
votes
1
answer
11k
views
what is the use of Flattened device tree - Linux Kernel
I am going through the Uboot & kernel startup process. What exactly is the use of the FDT (Flat device tree) ?
Many link i have read they state that uboot pass the board & SOC configuration ...
8
votes
2
answers
12k
views
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&...
7
votes
3
answers
18k
views
What is the meaning of a phandle when used as device tree node name?
This code snippet comes from the device tree for the RIoTBoard (/arch/arm/boot/dts/imx6dl-riotboard.dts)
&hdmi {
ddc-i2c-bus = <&i2c2>;
status = "okay";
};
I have ...
7
votes
1
answer
10k
views
Device Tree and manual registration
I'm using Embedded Linux on a board that is mainly configured via the device tree mechanism (.dts/.dtc files), i.e. entries in the device tree file indicate which devices to register and thereby which ...
7
votes
1
answer
22k
views
tcpdump error message "That device doesn't support monitor mode"
Running Linux on a Xilinx ZCU102 development board. When using a 1000BASE-X & Tri-Mode Ethernet Mac. I can send pings out of the Ethernet port, but when I run tcpdump to try and show that packets ...
7
votes
2
answers
14k
views
Passing Bootargs via Chosen node in Device Tree not working for Beaglebone Black
As per my understanding chosen node is used to send boot arguments to the kernel.
The following is the chosen node of the existing device code (am335x-bone-common.dtsi).
chosen {
stdout-path = &...
7
votes
3
answers
18k
views
Linux: boot arguments with U-Boot and Flat Image Tree (FIT)
I am trying to get my own build of U-Boot to boot Linux on a Jetson TK1 board. As we are pushing for verified boot I am using the Flat Image Tree (unifying kernel image, device tree blob, ...) to ...
7
votes
1
answer
5k
views
Modifying the device tree for the Beaglebone Black
I have used Yocto to create a small linux image for the Beaglebone Black. I think I have most everything working like I want it, except I need access to UARTs 2 and 4. When I was using the standard ...
7
votes
2
answers
11k
views
How can I edit a pinmux for BeagleBone Black on linux kernel 3.17?
I can take a peek at /sys/kernel/debug/pinctrl/44e10800.pinmux/pins and see the pin I am interested in:
pin 38 (44e10898.0) 00000037 pinctrl-single
This corresponds to GPIO[2]4, or P8.10.
I'm ...
7
votes
2
answers
6k
views
How to specify the device name for uart in device tree(.dts) file?
I was compiling the OpenWrt (A wireless router based on Linux), i added a board to the OpenWrt source, my board has two uart ports, i can declare and enable the two uart ports, the two uart ports are ...
7
votes
3
answers
4k
views
Embedded Linux device tree parser in python? [closed]
I am looking to create a utility that validates Embedded (PPC or ARM) Linux *.dts (device tree source) or *.dtb (binary) files against an XML configuration file from another tool. So, I need to parse ...
7
votes
1
answer
7k
views
How to add device tree blob to Linux x86 kernel boot?
My custom development board is based on x86 and one of the electronic component which is connected to it (through SPI mainly) cannot be controlled easily without using the vendor kernel driver (and ...
6
votes
6
answers
37k
views
Configuring Pins Mode Beaglebone
In the beagleboard or beaglebone are different modes to work the pin. With the previous kernel they are located in /sys/kernel/debug/omap_mux. Do u know with the last Kernel where are those files?
6
votes
1
answer
5k
views
How linux kernel get data from the Device tree?
I am a beginner to the Linux Kernel.
In my knowledge, in the older versions of the Kernel there was a board specific file, in which all the devices were registered (by using some API s like ...
6
votes
1
answer
3k
views
Difference between spi_driver.id_table and spi_driver.driver.of_match_table
I'm currently trying to understand how Linux drivers work. As far as I know, A driver's probe/init function is called when the kernel parses the corresponding .compatible string in the device tree. ...
6
votes
2
answers
4k
views
Linux Device Tree (DTS): i2c device on USB-I2C bridge
I have an i2c device (touch controller). Usually I would add it to the .dts file like this when it is connected to the SoC i2c master (a tegra chip in my case):
i2c@7000c000 {
st1332: ...
6
votes
1
answer
2k
views
Overview/reference manual for Open Firmware Device Trees
I am trying to setup a driver for an embedded PowerPC board, and the correct way to do this today is to use the OpenFirmware Device Tree datastructure (the .dtb file, compiled from a .dts file). ...
6
votes
2
answers
626
views
Yocto Kirkstone Beaglebone Black add custom devicetree
When I build a core-image using Yocto Kirkstone for machine beaglebone-yocto, I get a file /boot/extlinux/extlinux.conf. This file looks like:
default Yocto
label Yocto
kernel /zImage
fdtdir /
...
6
votes
1
answer
3k
views
What does fwnode in struct device do in linux kernel?
In the definition of struct device,there is a fwnode field defined,
struct device {
...
struct fwnode_handle *fwnode; /* firmware device node */
...
}
And the corresponding file is in ...