coreboot-kgpe-d16/src/device
Jeremy Soller cf2ac543a0 pciexp: Add support for allocating PCI express hotplug resources
This change adds support for allocating resources for PCI express hotplug
bridges when PCIEXP_HOTPLUG is selected. By default, this will add 32 PCI
subordinate numbers (buses), 256 MiB of prefetchable memory, 8 MiB of
non-prefetchable memory, and 8 KiB of I/O space to any device with the
PCI_EXP_SLTCAP_HPC bit set in the PCI_EXP_SLTCAP register, which
indicates hot-plugging capability. The resource allocation is configurable,
please see the PCIEXP_HOTPLUG_* variables in src/device/Kconfig.

In order to support the allocation of hotplugged PCI buses, a new field
is added to struct device called hotplug_buses. This is defaulted to
zero, but when set, it adds the hotplug_buses value to the subordinate
value of the PCI bridge. This allows devices to be plugged in and
unplugged after boot.

This code was tested on the System76 Darter Pro (darp6). Before this
change, there are not enough resources allocated to the Thunderbolt
PCI bridge to allow plugging in new devices after boot. This can be
worked around in the Linux kernel by passing a boot param such as:
pci=assign-busses,hpbussize=32,realloc

This change makes it possible to use Thunderbolt hotplugging without
kernel parameters, and attempts to match closely what our motherboard
manufacturer's firmware does by default.

Signed-off-by: Jeremy Soller <jeremy@system76.com>
Change-Id: I500191626584b83e6a8ae38417fd324b5e803afc
Reviewed-on: https://review.coreboot.org/c/coreboot/+/35946
Reviewed-by: Philipp Deppenwiese <zaolin.daisuki@gmail.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2020-02-05 09:32:30 +00:00
..
dram printf: Automatically prefix %p with 0x 2019-12-11 11:38:59 +00:00
oprom src/{drivers,device,ec}: Remove unused <stdlib.h> 2019-12-19 05:25:56 +00:00
azalia_device.c AUTHORS: Move src/device copyrights into AUTHORS file 2019-09-17 08:14:13 +00:00
cardbus_device.c src: Remove unused include '<device/pci_ids.h>' 2019-10-18 18:41:09 +00:00
cpu_device.c AUTHORS: Move src/device copyrights into AUTHORS file 2019-09-17 08:14:13 +00:00
device.c device: Log times with millisecond resolution 2019-12-31 17:38:22 +00:00
device_const.c device/pci: Reduce scope of dev_find_slot() 2019-11-21 19:43:34 +00:00
device_util.c src/[arch-lib]: change "unsigned" to "unsigned int" 2019-10-27 21:08:39 +00:00
hypertransport.c device/hypertransport: Drop unused code 2019-11-22 10:41:10 +00:00
i2c.c src/[arch-lib]: change "unsigned" to "unsigned int" 2019-10-27 21:08:39 +00:00
i2c_bus.c src/{drivers,device,ec}: Remove unused <stdlib.h> 2019-12-19 05:25:56 +00:00
Kconfig pciexp: Add support for allocating PCI express hotplug resources 2020-02-05 09:32:30 +00:00
Makefile.inc Add buffer_to/from_fifo32(_prefix) helpers 2019-08-22 10:36:22 +00:00
mmio.c AUTHORS: Move src/device copyrights into AUTHORS file 2019-09-17 08:14:13 +00:00
pci_class.c src/device: Update pci_class to PCI-SIG Specification 2020-01-10 10:55:49 +00:00
pci_device.c pciexp: Add support for allocating PCI express hotplug resources 2020-02-05 09:32:30 +00:00
pci_early.c device/pci_early: Drop some __SIMPLE_DEVICE__ use 2019-09-30 20:06:06 +00:00
pci_ops.c device,drivers/: Drop some __SIMPLE_DEVICE__ use 2019-09-30 11:07:46 +00:00
pci_rom.c arch/acpi.h: Use of typedef for acpi_vfct 2019-10-24 07:44:53 +00:00
pciexp_device.c pciexp: Add support for allocating PCI express hotplug resources 2020-02-05 09:32:30 +00:00
pcix_device.c AUTHORS: Move src/device copyrights into AUTHORS file 2019-09-17 08:14:13 +00:00
pnp_device.c device/pnp_device: improve warning/error messages 2020-02-01 01:45:03 +00:00
root_device.c device: Use scan_static_bus() over scan_lpc_bus() 2019-10-08 12:59:56 +00:00
smbus_ops.c device/smbus: Drop unused smbus_set_link() 2020-01-04 22:08:38 +00:00
software_i2c.c src/[arch-lib]: change "unsigned" to "unsigned int" 2019-10-27 21:08:39 +00:00