Jump to content

Recommended Posts

Posted

So, I've been doing some reading, and found this ...

 

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/devicetree/overlay-notes.rst

 

Looks like a mechanism to dynamically load or unload device tree overlays live. Really the only change is that .dtbo files need to be compiled with symbols (-@) like this:

 

dtc -@ -o myoverlay.dtbo myoverlay.dts

 

And then you can load/unload those overlays after (or during) boot by doing something like this:

 

# Creates the dynamic overlay
mkdir /sys/kernel/config/device-tree/overlays/myoverlay

# Load the dynamic overlay
cat myoverlay.dtbo > /sys/kernel/config/device-tree/overlays/myoverlay/dtbo

# Unload the dynamic overlay
rmdir /sys/kernel/config/device-tree/overlays/fan/

 

Which got me thinking. Given that not all board support DTB overlays within u-boot, and u-boot support is generally all over the place, would it make more sense to do DTB overlay support in-kernel and not worry about what u-boot implementations support it or no?

 

Heck armbian-config could potentially load/unload DTB overlays then and there without a reboot.

 

Posted

For experimentation, I loaded the DTS patch I posted HERE, basically adding a PWM fan object to the DTB and hooking it up as a thermal zone cooling device on my M4V2.

 

Not sure if there's any particular requirements. It's part of the configfs, so I suppose that needs to be in the kernel build? Not sure if there's any particular version requirements.

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines