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>
This commit is contained in:
Karthikeyan Ramasubramanian
2024-08-16 14:36:29 -06:00
committed by Felix Held
parent f5b9e9aed1
commit 6bdc3becfd
9 changed files with 298 additions and 260 deletions

View File

@ -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;