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>
diff --git a/util/sconfig/main.c b/util/sconfig/main.c
index 1fd4404..815bfc7 100644
--- a/util/sconfig/main.c
+++ b/util/sconfig/main.c
@@ -1559,6 +1559,12 @@
 	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.