coreboot/src/include/device
Nico Huber 5e8afce88f soc/intel: Implement PCIe RP devicetree update based on LCAP
Most of the current implementations for FSP-based platforms
make (sometimes wrong) assumptions how FSP reorders root ports
and what is specified in the devicetree. We don't have to make
assumptions though, and can read the root-port number from the
PCIe link capapilities (LCAP) instead. This is also what we do
in ASL code for years already.

This new implementation acts solely on information read from
the PCI config space. In a first round, we scan all possible
DEVFNs and store which root port has that DEVFN now. Then, we
walk through the devicetree that still only knows devices that
were originally mentioned in `devicetree.cb`, update device
paths and unlink vanished devices.

To be most compatible, we work with the following constraints:
  o Use only standard PCI config registers.
  o Most notable, don't try to read the registers that
    configure the function numbers. FSP has undocumented
    ways to block access to non-standard registers.
  o Don't make assumptions what function is assigned to
    hidden devices.

The following assumptions were made, though:
  o The absolute root-port numbering as documented in
    datasheets matches what is read from LCAP.
  o This numbering doesn't contain any gaps.
  o Original root-port function numbers below a PCI
    device start at function zero and also don't
    contain any gaps.

Change-Id: Ib17d2b6fd34608603db3936d638bdf5acb46d717
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/35985
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-by: Michael Niewöhner
Reviewed-by: Patrick Rudolph <patrick.rudolph@9elements.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2019-11-16 11:11:36 +00:00
..
dram src/{device,drivers,mb,nb,soc,sb}: Remove unused 'include <console/console.h>' 2019-10-21 14:21:09 +00:00
azalia.h src/include: Remove use of binary constants 2017-03-13 17:22:59 +01:00
azalia_device.h src: Remove unneeded include <arch/interrupt.h> 2019-09-11 14:45:08 +00:00
cardbus.h src: Use of device_t is deprecated 2018-06-14 09:29:31 +00:00
device.h device: Use scan_static_bus() over scan_lpc_bus() 2019-10-08 12:59:56 +00:00
drm_dp_helper.h FUI: reorganize include files 2013-07-10 02:39:42 +02:00
early_smbus.h coreboot: Replace all IS_ENABLED(CONFIG_XXX) with CONFIG(XXX) 2019-03-08 08:33:24 +00:00
hypertransport.h AMD K8 fam10: Drop extra HT scan_chain() parameters 2015-06-05 10:19:02 +02:00
hypertransport_def.h Fix up remaining boolean uses of CONFIG_XXX to CONFIG(XXX) 2019-03-25 11:03:49 +00:00
i2c.h include/device: Split i2c.h into three 2017-08-18 15:33:29 +00:00
i2c_bus.h device/i2c_bus: Add i2c_dev_read_at16() 2019-09-30 11:50:16 +00:00
i2c_simple.h Fix up remaining boolean uses of CONFIG_XXX to CONFIG(XXX) 2019-03-25 11:03:49 +00:00
mmio.h device/mmio.h: Add more bit field helpers 2019-10-08 05:54:10 +00:00
path.h src: Add missing include <stdint.h> 2018-11-01 11:25:07 +00:00
pci.h device/pci_early: Drop some __SIMPLE_DEVICE__ use 2019-09-30 20:06:06 +00:00
pci_def.h soc/intel: Implement PCIe RP devicetree update based on LCAP 2019-11-16 11:11:36 +00:00
pci_ehci.h src/: Replace some __PRE_RAM__ use 2019-09-14 11:16:17 +00:00
pci_ids.h soc/intel/tigerlake: Include few more Tigerlake device IDs 2019-11-14 11:29:03 +00:00
pci_mmio_cfg.h include/device: add pci mmio cfg address helpers 2019-11-11 10:25:40 +00:00
pci_ops.h device/pci_ops: Add ENV_PCI_SIMPLE_DEVICE 2019-09-29 03:39:06 +00:00
pci_rom.h device/pci_device.c: Use verified boot to check oprom 2019-10-04 16:24:44 +00:00
pci_type.h device/pci: Rewrite PCI MMCONF with symbol reference 2019-04-07 02:31:36 +00:00
pciexp.h device/pciexp_device: Convert LTR non-snoop/snoop value into common macro 2019-03-27 04:39:48 +00:00
pcix.h src: Use of device_t is deprecated 2018-06-14 09:29:31 +00:00
pnp.h device/pnp_ops: Add ENV_PNP_SIMPLE_DEVICE 2019-09-29 03:39:20 +00:00
pnp_def.h device/pnp: Ability to set vendor specific logical device config 2015-12-29 18:17:01 +01:00
pnp_ops.h device/pnp_ops: Add ENV_PNP_SIMPLE_DEVICE 2019-09-29 03:39:20 +00:00
pnp_type.h device/pnp_ops: Add ENV_PNP_SIMPLE_DEVICE 2019-09-29 03:39:20 +00:00
resource.h device: Constify dev argument to (probe|find)_resource() 2019-07-31 09:10:28 +00:00
smbus.h coreboot: Replace all IS_ENABLED(CONFIG_XXX) with CONFIG(XXX) 2019-03-08 08:33:24 +00:00
smbus_def.h Reinvent I2C ops 2017-08-18 15:33:45 +00:00
spi.h device: Add a new "SPI" device type 2017-02-16 08:41:28 +01:00