summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKarthikeyan Ramasubramanian <kramasub@google.com>2024-08-16 14:36:29 -0600
committerFelix Held <felix-coreboot@felixheld.de>2024-08-22 13:53:18 +0000
commit6bdc3becfd99880474b849ec32dc23dddf3cbf11 (patch)
tree959c4ce70e397e11563ce33035a8fcae4d558140 /src
parentf5b9e9aed11b3c4909aba8159c2b66e7ecd67a66 (diff)
util/sconfig: Probe device when fw_config is unprovisioned
When fw_config is unprovisioned (eg. in the factory), devices that do not have any probe list are enabled by default and those that have probe list are disabled. On mainboards that support multiple types of boot critical devices (eg. storage) through probing fw_config, all of them are disabled when fw_config is unprovisioned. Hence the devices do not boot to OS. Add sconfig fw_config rule `probe unprovisioned` to enable such devices when fw_config is unprovisioned. BUG=None TEST=Build Brox firmware and boot to OS when fw_config is unprovisioned. Change-Id: I178f821e077912776d654971924d67203a7c43df Signed-off-by: Karthikeyan Ramasubramanian <kramasub@google.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/83983 Reviewed-by: Jon Murphy <jpmurphy@google.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Eric Lai <ericllai@google.com> Reviewed-by: Ren Kuo <ren.kuo@quanta.corp-partner.google.com>
Diffstat (limited to 'src')
-rw-r--r--src/include/device/device.h1
-rw-r--r--src/lib/fw_config.c4
2 files changed, 5 insertions, 0 deletions
diff --git a/src/include/device/device.h b/src/include/device/device.h
index 3eee3218fa..a1a64e2e28 100644
--- a/src/include/device/device.h
+++ b/src/include/device/device.h
@@ -150,6 +150,7 @@ struct device {
/* Zero-terminated array of fields and options to probe. */
DEVTREE_CONST struct fw_config *probe_list;
+ bool enable_on_unprovisioned_fw_config;
};
/**
diff --git a/src/lib/fw_config.c b/src/lib/fw_config.c
index 02e2a7dadd..e03256764b 100644
--- a/src/lib/fw_config.c
+++ b/src/lib/fw_config.c
@@ -104,6 +104,10 @@ bool fw_config_probe_dev(const struct device *dev, const struct fw_config **matc
if (!dev->probe_list)
return true;
+ /* If the device wants to be enabled during unprovisioned fw_config */
+ if (!fw_config_is_provisioned() && dev->enable_on_unprovisioned_fw_config)
+ return true;
+
for (probe = dev->probe_list; probe && probe->mask != 0; probe++) {
if (!fw_config_probe(probe))
continue;