From 6bdc3becfd99880474b849ec32dc23dddf3cbf11 Mon Sep 17 00:00:00 2001 From: Karthikeyan Ramasubramanian Date: Fri, 16 Aug 2024 14:36:29 -0600 Subject: 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 Reviewed-on: https://review.coreboot.org/c/coreboot/+/83983 Reviewed-by: Jon Murphy Tested-by: build bot (Jenkins) Reviewed-by: Eric Lai Reviewed-by: Ren Kuo --- util/sconfig/main.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'util/sconfig/main.c') diff --git a/util/sconfig/main.c b/util/sconfig/main.c index acab06aace..c06e67ecac 100644 --- a/util/sconfig/main.c +++ b/util/sconfig/main.c @@ -581,6 +581,11 @@ void add_fw_config_probe(struct bus *bus, const char *field, const char *option) append_fw_config_probe_to_dev(bus->dev, probe); } +void probe_unprovisioned_fw_config(struct bus *bus) +{ + bus->dev->enable_on_unprovisioned_fw_config = true; +} + static uint64_t compute_fw_config_mask(const struct fw_config_field_bits *bits) { uint64_t mask = 0; @@ -1260,6 +1265,8 @@ static void pass1(FILE *fil, FILE *head, struct device *ptr, struct device *next fprintf(fil, "\t.sibling = NULL,\n"); if (ptr->probe) fprintf(fil, "\t.probe_list = %s_probe_list,\n", ptr->name); + fprintf(fil, "\t.enable_on_unprovisioned_fw_config = %d,\n", + ptr->enable_on_unprovisioned_fw_config); fprintf(fil, "#if !DEVTREE_EARLY\n"); fprintf(fil, "\t.chip_ops = &%s_ops,\n", chip_ins->chip->name_underscore); @@ -1783,6 +1790,8 @@ static void update_device(struct device *base_dev, struct device *override_dev) * to allow an override to remove a probe from the base device. */ base_dev->probe = override_dev->probe; + base_dev->enable_on_unprovisioned_fw_config = + override_dev->enable_on_unprovisioned_fw_config; /* Copy SMBIOS slot information from base device */ base_dev->smbios_slot_type = override_dev->smbios_slot_type; -- cgit v1.2.3