summaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authorDuncan Laurie <dlaurie@google.com>2020-10-28 14:22:34 -0700
committerDuncan Laurie <dlaurie@chromium.org>2020-11-20 00:26:11 +0000
commit7f6a4845110cc74a97428b321627454e02c8d2fe (patch)
tree89b17eae798fbb77d84a64275703f8866615f18d /util
parent98a9f1f61de45fdf936d51342c6a2f06e1980c58 (diff)
downloadcoreboot-7f6a4845110cc74a97428b321627454e02c8d2fe.tar.xz
sconfig: Apply 'hidden' state from override tree
In order to allow override trees to hide/unhide a device copy the hidden state to the base device. This allows a sequence of states like: chipset.cb: mark device 'off' by default devicetree.cb: mark device 'hidden' (to skip resource allocation) overridetree.cb: mark device 'on' for device present on a variant BUG=b:159143739 BRANCH=volteer TEST=build volteer variants with TCSS RP0 either hidden or on and check the resulting static.c to see if the hidden bit is set appropriately. Signed-off-by: Duncan Laurie <dlaurie@google.com> Change-Id: Iebe5f6d2fd93fbcc4329875565c2ebf4823da59b Reviewed-on: https://review.coreboot.org/c/coreboot/+/47197 Reviewed-by: Furquan Shaikh <furquan@google.com> Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'util')
-rw-r--r--util/sconfig/main.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/util/sconfig/main.c b/util/sconfig/main.c
index 1fd4404942..815bfc7e55 100644
--- a/util/sconfig/main.c
+++ b/util/sconfig/main.c
@@ -1559,6 +1559,12 @@ static void update_device(struct device *base_dev, struct device *override_dev)
base_dev->enabled = override_dev->enabled;
/*
+ * Copy the hidden state of override device to base device. This allows
+ * override tree to hide or unhide a particular device.
+ */
+ base_dev->hidden = override_dev->hidden;
+
+ /*
* Copy subsystem vendor and device ids from override device to base
* device only if the ids are non-zero in override device. Else, honor
* the values in base device.