LWN: Comments on "Device tree overlays" https://lwn.net/Articles/616859/ This is a special feed containing comments posted to the individual LWN article titled "Device tree overlays". en-us Thu, 11 Sep 2025 13:21:14 +0000 Thu, 11 Sep 2025 13:21:14 +0000 https://www.rssboard.org/rss-specification lwn@lwn.net Device tree overlays https://lwn.net/Articles/638266/ https://lwn.net/Articles/638266/ matwey <div class="FormattedComment"> Do I understand correctly, that currently there is still no way to modify device tree from user space in 4.0?<br> </div> Sat, 28 Mar 2015 11:58:31 +0000 Device tree overlays https://lwn.net/Articles/633598/ https://lwn.net/Articles/633598/ etienne <div class="FormattedComment"> Yes, but one question is: is that board needed to boot?<br> If not, then is the pre-initialisation system the right place to do that kind of things?<br> How is it different than some equipment plugged in a serial port, like a modem, that you initialize in user mode when you need it?<br> I understand that having a single place to describe the hardware is nice, but modifying that place (device tree) may trigger a bug which stops the system booting - and so make it more difficult to recover.<br> You may want to "insert" a device tree overlay after boot in user mode, but then isn't it complexifying the system compared to inserting a module with some parameters.<br> </div> Tue, 17 Feb 2015 11:12:57 +0000 Device tree overlays https://lwn.net/Articles/633547/ https://lwn.net/Articles/633547/ Kamilion <div class="FormattedComment"> Have a look at this, It's a pretty good example of what can be done with a beaglebone cape (as well as being generally useful to a lot of folks doing EE)<br> <p> <a href="https://github.com/abhishek-kakkar/BeagleLogic/wiki/The-BeagleLogic-Cape">https://github.com/abhishek-kakkar/BeagleLogic/wiki/The-B...</a><br> <p> Very simple design, two ICs and some headers on a PCB from dirtypcbs.com.<br> There's just some unpopulated shunt-resistors for the I2C EEPROM, as it assumes it will be the lowest board in the stack. Not surprising, considering it's set up to be a 100Mhz multichannel logic analyzer.<br> Software side of it has something like 20+ common protocol decoders.<br> <p> The TI 74LVCH16T245 16-bit buffer chip doesn't really have any means of identification, as it's just a logic part. And yet the I2C EEPROM still says "I got here first" on the pins it's contents requests, for the capes that may be stacked on top. Maybe a cellular module, maybe a 30Mhz SPI display... If you've got a raspberry pi or a odroid C1 or something right now and try to stick one of the cheap 30Mhz SPI displays floating around out there right now, you still need to track down the right kernel module, tell it which GPIOs go where when you modprobe stuff.<br> <p> modprobe spicc<br> modprobe fbtft_device name=odroidc_tft32 rotate=270 gpios=reset:116,dc:115 speed=32000000 cs=0<br> <p> Kinda squicky; we can do better. Loading Devicetree fragments is at least a signpost along the path.<br> <p> <p> And yes, the loaded i2c rom can potentially be very large (256K+) and contain just about anything after the relatively small header the beaglebone code will attempt to parse, which is about 256 bytes.<br> </div> Mon, 16 Feb 2015 20:52:38 +0000 Device tree overlays https://lwn.net/Articles/618240/ https://lwn.net/Articles/618240/ jem <div class="FormattedComment"> The EEPROM is on the cape and is pre-programmed by the maker of the cape. The I2C address of the EEPROM is one of four fixed addresses; the cape should also include a two position switch to select which of the four addresses it responds to. If several capes are stacked (up to four), the user must take care the switches are in different positions on each cape.<br> <p> The EEPROM contents are defined in the BeagleBone Black System Reference Manual, and contain information like Manufacturer Name, Part Number, Pin Usage, etc.<br> <p> </div> Tue, 28 Oct 2014 09:43:44 +0000 Device tree overlays https://lwn.net/Articles/618176/ https://lwn.net/Articles/618176/ giraffedata <blockquote> The EEPROM is non-volatile memory and will only contain information about what's present (e.g. which cape), whereas the device tree contains information about how to use it (e.g. the I²C bus address of the cape's chip). </blockquote> <P> Where is the EEPROM and who programs it? Who chooses the I²C bus address of the cape's chip? <p> Does "which cape" mean which model of cape? If so, it sounds a lot like PCI vendor and device ID, which seems like all Linux needs to know to know how to use the cape (assuming the requisite knowledge were programmed in, as for most PCI devices). <p> Is there some reason the EEPROM can't contain information about how to use a cape? <blockquote> What is more, the user could also hard-code in a script which device tree overlay must be loaded, because she knowns what cape the board is equipped with. </blockquote> <p> But I'm sure she'd rather not, which is why I'm trying to understand what is different about the world in which Beaglebone lives that Linux can't detect what cape the board is equipped with like it does in the bigger systems. Mon, 27 Oct 2014 17:20:01 +0000 Device tree overlays https://lwn.net/Articles/618137/ https://lwn.net/Articles/618137/ dlang <div class="FormattedComment"> so where are these snippets of devicetree data coming from? are they being compiled into the kernel, loaded from userspace somehow, or what?<br> <p> without device tree snippets, you had drivers that looked for an id on some bus and then knew what devices were where when they saw that ID (hard coded in the driver), it sounds like this is trying to avoid the hard-coding into a driver, but it's not clear where the data is arriving from.<br> <p> It's also not clear why the info about a particular device (cape or whatever) needs to be merged with the devicetree that was handed to the kernel at boot time. Why aren't the appropriate devices just configured and initialized without going to the trouble of merging the info about this cape into the tree that you were given at initialization time.<br> <p> If this was being done in the bootloader, with the resulting devicetree being handed to the kernel, it would make perfect sense. But it seems to make far less sense after the kernel has initialized the system from the devicetree it was handed and is now running normally.<br> </div> Mon, 27 Oct 2014 08:11:54 +0000 Device tree overlays https://lwn.net/Articles/618136/ https://lwn.net/Articles/618136/ rvfh <div class="FormattedComment"> The EEPROM is non-volatile memory and will only contain information about what's present (e.g. which cape), whereas the device tree contains information about how to use it (e.g. the I²C bus address of the cape's chip).<br> <p> They are complementary.<br> <p> What is more, the user could also hard-code in a script which device tree overlay must be loaded, because she knowns what cape the board is equipped with.<br> </div> Mon, 27 Oct 2014 08:00:52 +0000 Device tree overlays https://lwn.net/Articles/618131/ https://lwn.net/Articles/618131/ giraffedata I'm still not getting it. Where is this Beaglebone EEPROM and what information is in it? And if it doesn't have all the information a Linux kernel needs to drive a device, so a device tree would not be necessary, why doesn't it? Mon, 27 Oct 2014 01:21:11 +0000 Device tree overlays https://lwn.net/Articles/618047/ https://lwn.net/Articles/618047/ HIGHGuY <div class="FormattedComment"> In the absense of the device-tree overlay patchset in our 'old' 2.6.32 kernel we had to refrain to a close-enough hack.<br> <p> Our device-tree contains all overlays and each node that is 'optional' contains an extra field indicating the overlays it is active in.<br> The bootloader then reads an EEPROM and fills in a /chosen entry.<br> <p> The I2C subsystem and one custom driver were modified to compare the extra node field against the /chosen field and only probe the device when they match.<br> <p> It's not perfect, but gets the job done sufficiently for the few plugin cards we expect in the future.<br> </div> Sat, 25 Oct 2014 08:01:47 +0000 Device tree overlays https://lwn.net/Articles/617801/ https://lwn.net/Articles/617801/ pantoniou <div class="FormattedComment"> There are two levels of invalid file.<br> <p> 1) The file has syntax errors; this means the file won't compile - that's easy.<br> <p> 2) The file's syntax is correct but is not a valid description of the hardware. That's the hard part. I.e. a typo in one of the properties names is a valid DT file, but it's not going to work when you use it.<br> </div> Thu, 23 Oct 2014 17:09:41 +0000 Device tree overlays https://lwn.net/Articles/617800/ https://lwn.net/Articles/617800/ pantoniou <div class="FormattedComment"> The kernel cannot detect the full set of hardware devices. It can however deduce what's there by reading an out-of-band marker that describes.<br> <p> On the beaglebone you have an EEPROM, on other platforms you might encode the possible expansion board combination on GPIOs and so on.<br> <p> For FPGAs you just have a-priori knowledge of what a bitstream loaded to the FPGA is providing.<br> </div> Thu, 23 Oct 2014 17:07:29 +0000 Device tree overlays https://lwn.net/Articles/617733/ https://lwn.net/Articles/617733/ jezuch <div class="FormattedComment"> <font class="QuotedText">&gt; The fact that the current device tree compiler performs no syntax checks does not help the situation; the first indication of an incorrect device tree file is typically a failure to boot.</font><br> <p> So, um, what does it do if the file is invalid?<br> </div> Thu, 23 Oct 2014 11:07:16 +0000 Device tree overlays https://lwn.net/Articles/617713/ https://lwn.net/Articles/617713/ koenkooi <div class="FormattedComment"> One of the use-cases is plugging in expansion boards (e.g. capes for the beaglebone, hats for the rpi) where the kernel can detect and read the EEPROM, but not the actual hardware. Using information from the EEPROM you can load a devicetree overlay for the new hardware. Maybe in the future you'll be able to put the overlay directly into the EEPROM.<br> </div> Thu, 23 Oct 2014 07:20:56 +0000 Device tree overlays https://lwn.net/Articles/617708/ https://lwn.net/Articles/617708/ bnorris <div class="FormattedComment"> <font class="QuotedText">&gt; Why does the device tree need to be involved if the kernel can detect the hardware?</font><br> <p> I don't think the kernel can detect the hardware in the examples mentioned in the article. From the sound of it, dynamic patching of the device tree is controlled by the user in some form, either via sysfs or procfs. But admittedly, it's difficult to tell, since this article doesn't actually link to the relevant work.<br> <p> [Preemptive edit:] It looks like this contains some of the work, although it surely can't be the latest:<br> <p> <a href="http://lwn.net/Articles/600466/">http://lwn.net/Articles/600466/</a><br> <p> In this work, overlays are provided by the user via configfs.<br> </div> Thu, 23 Oct 2014 07:19:54 +0000 Device tree overlays https://lwn.net/Articles/617704/ https://lwn.net/Articles/617704/ dlang <div class="FormattedComment"> I'm missing something here. Device trees are needed because the system can't detect hardware, so the kernel needs to be told what hardware exists.<br> <p> But this proposal is about having the kernel detect hardware and change the device tree.<br> <p> Why does the device tree need to be involved if the kernel can detect the hardware?<br> </div> Thu, 23 Oct 2014 04:43:50 +0000