Page 1 of 1

STICKY: Device Tree Forum Area README

Posted: Thu May 28, 2015 3:40 pm
by James Adams
From http://www.devicetree.org: "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"

Raspberry Pi's latest kernels and firmware, including Raspbian and NOOBS releases, now by default use Device Tree (DT) to manage some resource allocation and module loading. This change is to alleviate the problem of multiple drivers contending for system resources, and to allow HAT modules to be auto-configured.

As Device Tree is 'the new way' for Raspberry Pi products we've decided to dedicate some forum area to collecting questions/feedback/issues about it. This forum area is for discussing issues specific to Linux Device Tree implementation used on the Raspberry Pi and Compute Module products, so please keep the disucssions on topic.

Documentation:

Main Raspberry Pi Linux Device Tree Docs:
https://www.raspberrypi.org/documentati ... ce-tree.md

'GPU' Device Tree (This is a DT file specifically for stuff that the GPU uses and Linux doesn't see - e.g. Camera control I2C and pins; usually you won't need to touch this though you might if you are using a Compute Module):
https://www.raspberrypi.org/documentati ... uration.md

Attaching peripherals to a Compute Module and enabling them using Device Tree (also relevant for Raspberry Pi boards):
https://www.raspberrypi.org/documentati ... w-guide.md

Re: Device Tree Forum Area README

Posted: Wed Dec 09, 2015 2:44 pm
by Maykef
Hi James

I recently got the compute module and I'm trying to learn about device tree and so on. My question is probably very stupid but, how can I visualize .dts files? I have tried opening them with nano or vim but they look quite messy and senseless.

Re: Device Tree Forum Area README

Posted: Wed Dec 09, 2015 2:47 pm
by ghans
Are you sure you are looking at the .dts files instead of .dtb ? The latter are compiled binary files and not supposed to be edited.

ghans

Re: Device Tree Forum Area README

Posted: Wed Dec 09, 2015 2:51 pm
by PhilE
Maykef,

Yes, it takes a while to get familiar with DTS to the point that you can read it with ease. You can help yourself by reading the source DTS files (you'll find these in the Linux tree, e.g. here), rather than the result of decompiling DTBs; the compilation process loses the labels and replaces them with phandles (small integers) which are harder to follow.

Other than that, start with the base DTS files bcm2708-rpi-cm.dts, which includes bcm2708-rpi-cm.dts, which include bcm2708.dtsi, which includes bcm2708_common.dtsi. Overlays add another level of complexity, and have to be read with the base DTS/DTB as a reference.

Re: Device Tree Forum Area README

Posted: Wed Dec 09, 2015 2:54 pm
by Maykef
OK.

Got it.

Thanks!

Re: Device Tree Forum Area README

Posted: Fri Jan 29, 2016 11:07 am
by MAHaines
Hi,

I am trying to get my head around the Device Tree set up, I think I am getting my head around the files, syntax, overlays etc. The thing I am getting confused with is the attaching peripherals to the Compute Module guide.

It says that the dt-blob.bin and other files are to be placed in root of the FAT partition and overlays in '/overlays' but later on in the examples all these files are being placed in '/boot' and '/boot/overlays'. Which location should the device tree files and overlays be placed?

Re: Device Tree Forum Area README

Posted: Fri Jan 29, 2016 1:14 pm
by PhilE
Both statements are correct. The absolute root of the Pi's virtual filing system is usually either a Linux filing system (ext3, ext4, etc.) or a RAM disk of some description. The VFAT partition - the one a Windows PC recognises - is usually mounted within the root filing system on /boot. Hence /boot/overlays is the overlays directory in the root of the VFAT partition.

Re: Device Tree Forum Area README

Posted: Fri Jan 29, 2016 1:34 pm
by MAHaines
Right, okay thank you, I am used to root in linux being '/' so I was a bit confused as to why it was /boot/overlays in the examples, but being the root of FAT and not absolute root makes sense.

Thank you for your help.

Re: STICKY: Device Tree Forum Area README

Posted: Sun Nov 04, 2018 8:58 pm
by eriksson25
Noob in need of help. Been reading about overlays until my head is spinning.

I have a runing Rasbian system with kernel 4.14.71+ I need to edit the w1-gpio overlay.
But on my system I only find the dtb0 in /boot/overlays/

I have found the dts on github (actualy not for my kernel since it says "folder truncaded". But from an earlier version.

I can edit the dts, but how then can insert it to my runing system instead of the existing dtb0 file?

/KG

Re: STICKY: Device Tree Forum Area README

Posted: Sun Nov 04, 2018 9:05 pm
by PhilE
Please start a new topic for your question, where I'll happily answer it.