Device tree remote update

  • Hello, the method of extracting the device tree for modification and then writing it back is rather complex and involves kernel security hash verification. The simplest way is to directly use "io -4 0xFF388038 0x000C0000" to set the register (reboot will be invalid, it can be written in the startup script). Please refer to the attachment.
    Attachments
    Downloaded 419 times
  • Just a side note to this: In my own builds (OpenWrt, not the standard image) for Luckfox targets, the kernel is built with CONFIG_OF_OVERLAY enabled, and there's the dtbocfg driver (https://github.com/ikwzm/dtbocfg) which allows loading device tree overlays, effectively modifying the device tree, at runtime. I use that all the time to configure hardware (such as i2c device nodes, or PWM configs, pinmux) without need to modify or re-flash the entire image. I can only recommend that approach, because it very much modularizes hardware support in a clean way (and it's nothing new, the RPi folks are using this for a long time already).