summaryrefslogtreecommitdiff
path: root/util/sconfig/sconfig.h
diff options
context:
space:
mode:
authorFurquan Shaikh <furquan@google.com>2018-06-22 09:19:15 -0700
committerFurquan Shaikh <furquan@google.com>2018-06-25 17:40:36 +0000
commit27efc501d179c34e5602e3c691cb9b6d52474d86 (patch)
tree102138bd6b467294f2760e31f012f25eecae8f9c /util/sconfig/sconfig.h
parentf2419983523e577688318dea523f6cb9ffb3d9b8 (diff)
downloadcoreboot-27efc501d179c34e5602e3c691cb9b6d52474d86.tar.xz
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 files. 2. Walk through the trees in lockstep fashion using depth-first traversal checking if a node in override tree has a matching node in base tree. - 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. BUG=b:80081934 Change-Id: I6604e4f8abe3fc48240e942fea32da96031e1e46 Signed-off-by: Furquan Shaikh <furquan@google.com> Reviewed-on: https://review.coreboot.org/27206 Reviewed-by: Aaron Durbin <adurbin@chromium.org> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'util/sconfig/sconfig.h')
-rw-r--r--util/sconfig/sconfig.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/util/sconfig/sconfig.h b/util/sconfig/sconfig.h
index 63b65fd372..d350f52569 100644
--- a/util/sconfig/sconfig.h
+++ b/util/sconfig/sconfig.h
@@ -58,6 +58,12 @@ struct chip_instance {
/* Pointer to next instance of the same chip. */
struct chip_instance *next;
+
+ /*
+ * Reference count - Indicates how many devices hold pointer to this
+ * chip instance.
+ */
+ int ref_count;
};
struct chip {