With the introduction of fw_config support in coreboot, it is possible for mainboards to control the state of a device (on/off) in ramstage using fw_config probe conditions. However, the device tree in immutable in all other stages and hence `is_dev_enabled()` does not really reflect the true state as in ramstage. This change adds a call to `fw_config_probe_dev()` in `is_dev_enabled()` when device tree is immutable (by checking DEVTREE_EARLY) to first check if device is disabled because of device probe conditions. If so, then it reports device as being disabled. Else, dev->enabled is used to report the device state. This allows early stages (bootblock, romstage) to use `is_dev_enabled()` to get the true state of the device by taking probe conditions into account and eliminates the need for each caller to perform their own separate probing. Change-Id: Ifede6775bda245cba199d3419aebd782dc690f2c Signed-off-by: Furquan Shaikh <furquan@google.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/54752 Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org> Reviewed-by: Karthik Ramasubramanian <kramasub@google.com> Reviewed-by: EricR Lai <ericr_lai@compal.corp-partner.google.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org> |
||
|---|---|---|
| .. | ||
| dram | ||
| oprom | ||
| azalia_device.c | ||
| cardbus_device.c | ||
| cpu_device.c | ||
| device.c | ||
| device_const.c | ||
| device_util.c | ||
| gpio.c | ||
| i2c.c | ||
| i2c_bus.c | ||
| Kconfig | ||
| Makefile.inc | ||
| mmio.c | ||
| pci_class.c | ||
| pci_device.c | ||
| pci_early.c | ||
| pci_ops.c | ||
| pci_rom.c | ||
| pciexp_device.c | ||
| pcix_device.c | ||
| pnp_device.c | ||
| resource_allocator_common.c | ||
| resource_allocator_v3.c | ||
| resource_allocator_v4.c | ||
| root_device.c | ||
| smbus_ops.c | ||
| software_i2c.c | ||
| xhci.c | ||