From 7f6a4845110cc74a97428b321627454e02c8d2fe Mon Sep 17 00:00:00 2001 From: Duncan Laurie Date: Wed, 28 Oct 2020 14:22:34 -0700 Subject: [PATCH] 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 Change-Id: Iebe5f6d2fd93fbcc4329875565c2ebf4823da59b Reviewed-on: https://review.coreboot.org/c/coreboot/+/47197 Reviewed-by: Furquan Shaikh Reviewed-by: Tim Wawrzynczak Tested-by: build bot (Jenkins) --- util/sconfig/main.c | 6 ++++++ 1 file changed, 6 insertions(+) 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 @@ -1558,6 +1558,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