From a560c711093cbfc3be02018e3ef9788fead4184d Mon Sep 17 00:00:00 2001 From: Arthur Heymans Date: Wed, 24 Feb 2021 22:27:44 +0100 Subject: sb/intel/common/pciehp: Replace HP dummy device with common code Use the common PCIEXP_HOTPLUG code to generate a dummy device for PCIe ports supporting hotplug. This allows to have control over how much resources are allocated to hotplug ports. Tested on thinkpad X220: now hotplugging a dGPU via the expresscard slot sometimes works. Change-Id: I3eec5214c9d200ef97d1ccfdc00e8ea0ee7cfbc6 Signed-off-by: Arthur Heymans Reviewed-on: https://review.coreboot.org/c/coreboot/+/51068 Tested-by: build bot (Jenkins) Reviewed-by: Angel Pons Reviewed-by: Nico Huber Reviewed-by: Patrick Rudolph --- src/southbridge/intel/common/pciehp.c | 39 ----------------------------------- 1 file changed, 39 deletions(-) (limited to 'src/southbridge/intel/common') diff --git a/src/southbridge/intel/common/pciehp.c b/src/southbridge/intel/common/pciehp.c index 247bf5df7f..31fbb21c63 100644 --- a/src/southbridge/intel/common/pciehp.c +++ b/src/southbridge/intel/common/pciehp.c @@ -117,42 +117,3 @@ void intel_acpi_pcie_hotplug_generator(u8 *hotplug_map, int port_number) acpigen_pop_len(); } - -static void slot_dev_read_resources(struct device *dev) -{ - struct resource *resource; - - resource = new_resource(dev, PCI_BASE_ADDRESS_0); - resource->size = 1 << 23; - resource->align = 22; - resource->gran = 22; - resource->limit = 0xffffffff; - resource->flags |= IORESOURCE_MEM; - - resource = new_resource(dev, 0x14); - resource->size = 1 << 23; - resource->align = 22; - resource->gran = 22; - resource->limit = 0xffffffff; - resource->flags |= IORESOURCE_MEM | IORESOURCE_PREFETCH; - - resource = new_resource(dev, 0x18); - resource->size = 1 << 12; - resource->align = 12; - resource->gran = 12; - resource->limit = 0xffff; - resource->flags |= IORESOURCE_IO; -} - -static struct device_operations slot_dev_ops = { - .read_resources = slot_dev_read_resources, -}; - -/* Add a dummy device to reserve I/O space for hotpluggable devices. */ -void intel_acpi_pcie_hotplug_scan_slot(struct bus *bus) -{ - struct device *slot; - struct device_path slot_path = { .type = DEVICE_PATH_NONE }; - slot = alloc_dev(bus, &slot_path); - slot->ops = &slot_dev_ops; -} -- cgit v1.2.3