util/sconfig: Add support for overriding base tree properties/node
This change adds support to allow variants to override the devices and
properties in base device tree by providing an override device
tree. It works as follows:
1. Both base and override device trees are parsed from provided input
2. Walk through the trees in lockstep fashion using depth-first
traversal checking if a node in override tree has a matching node in
- If matching node is found, then update the properties of base node
using the override node. Continue walking the children of the nodes.
- If matching node is not found, then copy the entire override
subtree of the node under the current base parent. In addition to
that, chip instance pointers of the nodes in override tree need to be
updated if they were pointing to the override parents chip instance.
Since chip always expects a device to be present, it leads to a
side-effect that overriding chip registers requires that a device is
always provided for the chip in the override tree as well.
Signed-off-by: Furquan Shaikh <email@example.com>
Reviewed-by: Aaron Durbin <firstname.lastname@example.org>
Tested-by: build bot (Jenkins) <email@example.com>
2 files changed