coreboot/src/device
Furquan Shaikh 7f6ae79280 device: Consider fw_config probing in is_dev_enabled()
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>
2021-05-24 16:55:39 +00:00
..
dram device/dram/ddr3: Drop unused MRS helpers 2021-04-05 13:03:58 +00:00
oprom device/oprom/include/x86emu/fpu_regs.h: Fix lint error 2021-02-01 08:46:11 +00:00
azalia_device.c device/azalia_device.c: Add option to lock down GCAP 2021-04-19 19:02:08 +00:00
cardbus_device.c src: Never set ISA Enable on PCI bridges 2020-07-28 10:54:02 +00:00
cpu_device.c treewide: Remove "this file is part of" lines 2020-05-11 17:11:40 +00:00
device.c device/device.c: Print bus numbers in decimal 2021-05-11 12:52:30 +00:00
device_const.c device: Consider fw_config probing in is_dev_enabled() 2021-05-24 16:55:39 +00:00
device_util.c Rename do_printk() to printk() 2021-04-14 10:38:09 +00:00
gpio.c device + util/sconfig: introduce new device gpio 2020-12-28 17:47:04 +00:00
i2c.c treewide: Remove "this file is part of" lines 2020-05-11 17:11:40 +00:00
i2c_bus.c device/i2c_bus.c: Correct code style 2021-04-06 07:02:47 +00:00
Kconfig device/azalia_device.c: Add option to lock down GCAP 2021-04-19 19:02:08 +00:00
Makefile.inc device + util/sconfig: introduce new device gpio 2020-12-28 17:47:04 +00:00
mmio.c treewide: Remove "this file is part of" lines 2020-05-11 17:11:40 +00:00
pci_class.c treewide: Remove "this file is part of" lines 2020-05-11 17:11:40 +00:00
pci_device.c device/pciexp_device.c: Remove CPP guarding 2021-03-14 19:27:18 +00:00
pci_early.c treewide: Remove "this file is part of" lines 2020-05-11 17:11:40 +00:00
pci_ops.c device: Switch pci_dev_is_wake_source to take pci_devfn_t 2021-05-03 16:28:42 +00:00
pci_rom.c soc/amd/common/block/graphics/graphics: GOP: load VBIOS 2021-03-13 02:44:40 +00:00
pciexp_device.c pciexp_device: Rewrite LTR configuration 2021-03-15 06:04:38 +00:00
pcix_device.c treewide: Remove "this file is part of" lines 2020-05-11 17:11:40 +00:00
pnp_device.c device/pnp: add register PNP_IO4 2020-12-28 21:01:08 +00:00
resource_allocator_common.c src/device: Remove unused <console/console.h> 2021-02-15 10:48:28 +00:00
resource_allocator_v3.c device/resource_allocator_v3: Do not set IORESOURCE_ASSIGNED for size 0 resource 2020-05-26 15:15:54 +00:00
resource_allocator_v4.c device/resource_allocator_v4: Improve the logging in resource allocator 2020-05-28 09:43:44 +00:00
root_device.c device: Export enable_static_device() function 2020-10-21 15:35:24 +00:00
smbus_ops.c treewide: Remove "this file is part of" lines 2020-05-11 17:11:40 +00:00
software_i2c.c treewide: Remove "this file is part of" lines 2020-05-11 17:11:40 +00:00
xhci.c device/xhci.c: Remove repeated word 2021-01-18 07:33:25 +00:00