summaryrefslogtreecommitdiff
path: root/util/sconfig/main.c
diff options
context:
space:
mode:
authorRonald G. Minnich <rminnich@gmail.com>2019-10-22 02:02:24 +0000
committerron minnich <rminnich@gmail.com>2020-02-08 18:57:36 +0000
commit466ca2c1adbf2fc97dd559a3b69fcf0c7fe5d472 (patch)
tree24c665b13fe23e8e6be540ef917d1c23ad175309 /util/sconfig/main.c
parent91dc1e74a52ec33dc7f5c33dca73f02c5fe54cf0 (diff)
Add configurable ramstage support for minimal PCI scanning
This CL has changes that allow us to enable a configurable ramstage, and one change that allows us to minimize PCI scanning. Minimal scanning is a frequently requested feature. To enable it, we add two new variables to src/Kconfig CONFIGURABLE_RAMSTAGE is the overall variable controlling other options for minimizing the ramstage. MINIMAL_PCI_SCANNING is how we indicate we wish to enable minimal PCI scanning. Some devices must be scanned in all cases, such as 0:0.0. To indicate which devices we must scan, we add a new mandatory keyword to sconfig It is used in place of on, off, or hidden, and indicates a device is enabled and mandatory. Mandatory devices are always scanned. When MINIMAL_PCI_SCANNING is enabled, ONLY mandatory devices are scanned. We further add support in src/device/pci_device.c to manage both MINIMAL_PCI_SCANNING and mandatory devices. Finally, to show how this works in practice, we add mandatory keywords to 3 devices on the qemu-q35. TEST= 1. This is tested and working on the qemu-q35 target. 2. On CML-Hatch Before CL: Total Boot time: ~685ms After CL: Total Boot time: ~615ms Change-Id: I2073d9f8e9297c2b02530821ebb634ea2a5c758e Signed-off-by: Ronald G. Minnich <rminnich@gmail.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/36221 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Jeremy Soller <jeremy@system76.com>
Diffstat (limited to 'util/sconfig/main.c')
-rw-r--r--util/sconfig/main.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/util/sconfig/main.c b/util/sconfig/main.c
index 3b60e2a87f..d784642ae2 100644
--- a/util/sconfig/main.c
+++ b/util/sconfig/main.c
@@ -516,6 +516,7 @@ struct device *new_device(struct bus *parent,
new_d->enabled = status & 0x01;
new_d->hidden = (status >> 1) & 0x01;
+ new_d->mandatory = (status >> 2) & 0x01;
new_d->chip_instance = chip_instance;
chip_instance->ref_count++;
@@ -810,6 +811,7 @@ static void pass1(FILE *fil, FILE *head, struct device *ptr, struct device *next
fprintf(fil, "},\n");
fprintf(fil, "\t.enabled = %d,\n", ptr->enabled);
fprintf(fil, "\t.hidden = %d,\n", ptr->hidden);
+ fprintf(fil, "\t.mandatory = %d,\n", ptr->mandatory);
fprintf(fil, "\t.on_mainboard = 1,\n");
if (ptr->subsystem_vendor > 0)
fprintf(fil, "\t.subsystem_vendor = 0x%04x,\n",