Port-arm archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Device tree overlays



I am figuring out device tree overlays, in this case for a Beaglebone Black, although my questions here are more general.

After some trying I have successfully created the simple overlay attached below (beaglebone_black-leds.dts).  It is based upon changing some properties that are defined in part of the main device tree, also attached (am335x-bone-common.dtsi).  

This involved a fair bit of trial and error.  I am wondering if anyone has some clear guidelines regarding how best to construct overlays.  A few I am arriving at are the following:

- Every overlay needs a root node with a compatible property, as this is checked upon loading.

- Nodes must be modified by referring to their parent and then defining a subnode with modified properties.  Normally, at least the parent, if not also the child, will already be in the main device tree.

- Nodes originally defined without labels must be referenced with a path.

Some questions are:

- Can entirely new nodes be created?  For example, could I have created a “leds2” node within the root node and created the “led6” node there, instead of as a subnode of the “leds” node?  If so, could “leds6” have been labeled “led2” instead, even though that name is used within the “leds” node?

- What is the significance about which parent node a subnode is created within?  Presumably, these match drivers, but how can one figure out which are appropriate places for new nodes or modified/additional properties?

Sorry if these all seem pretty basic.  I’m just trying to improve my understanding of a new (to me) area of the kernel.

I would appreciate any thoughts, corrections, additions, etc.  Thanks a lot.

Cheers,
Brook


Attachment: beaglebone_black-leds.dts
Description: Binary data

Attachment: am335x-bone-common.dtsi
Description: Binary data



Home | Main Index | Thread Index | Old Index