Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Device tree override reg value

I have a device tree that I want to override some node's reg value. The problem is that my understanding the name of the node has to match the reg value. How can this node's reg change without overriding the parent node.

Example:

\{

parent_name : parent {
   n10 : node@10 {
       reg = <10>;
  };

   n100 : node@100 {
      reg = <100>;
   };
};

To override node@100 to have a different reg value, can this be done:

&n100 {
  reg = <200>;
}

If this is done, the reg of node@100 will be 200 which is not what the specs says.

like image 834
hesham_EE Avatar asked Feb 28 '26 02:02

hesham_EE


1 Answers

the name of the node has to match the reg value

Correct, the Device Tree Specification does mention this requirement.

You should not try to "redefine" the reg property which would create a discrepancy.
Rather you could create a whole new node with the proper node name & unit address.

You can delete the old node using

/delete-node/ node@100;

or

/delete-node/ &n100;

Note that /delete-node/ is a directive to the DT compiler, and is not some kind of comment.
Refer to Device Tree Source Undocumented for more details.

like image 53
sawdust Avatar answered Mar 03 '26 15:03

sawdust



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!