From 36fa5b80843d836518eb89f46747e80ed6b5d96f Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Tue, 28 Oct 2014 23:43:20 +0100 Subject: i82801ix,bd82x6x,ibexpeak: rewrite expresscard hotplug This implementation is more compact, unified and works with windows as well. Tested under windows and under Debian GNU/Linux. Change-Id: I585dec12e17e22d829baa3f2dc7aecc174f9d3b5 Signed-off-by: Vladimir Serbinenko Reviewed-on: http://review.coreboot.org/7296 Reviewed-by: Edward O'Callaghan Reviewed-by: Nicolas Reinecke Tested-by: build bot (Jenkins) --- src/southbridge/intel/i82801ix/pcie.c | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) (limited to 'src/southbridge/intel/i82801ix/pcie.c') diff --git a/src/southbridge/intel/i82801ix/pcie.c b/src/southbridge/intel/i82801ix/pcie.c index 2022dac3e7..7583715add 100644 --- a/src/southbridge/intel/i82801ix/pcie.c +++ b/src/southbridge/intel/i82801ix/pcie.c @@ -24,11 +24,14 @@ #include #include #include +#include +#include "chip.h" static void pci_init(struct device *dev) { u16 reg16; u32 reg32; + struct southbridge_intel_i82801ix_config *config = dev->chip_info; printk(BIOS_DEBUG, "Initializing ICH9 PCIe root port.\n"); @@ -85,6 +88,14 @@ static void pci_init(struct device *dev) reg32 |= (1 << 1); pci_write_config32(dev, 0xe8, reg32); } + + /* Enable expresscard hotplug events. */ + if (config->pcie_hotplug_map[PCI_FUNC(dev->path.pci.devfn)]) { + pci_write_config32(dev, 0xd8, + pci_read_config32(dev, 0xd8) + | (1 << 30)); + pci_write_config16(dev, 0x42, 0x142); + } } static void pcie_set_subsystem(device_t dev, unsigned vendor, unsigned device) @@ -99,6 +110,21 @@ static void pcie_set_subsystem(device_t dev, unsigned vendor, unsigned device) } } +static unsigned int pch_pciexp_scan_bridge(device_t dev, unsigned int max) +{ + unsigned int ret; + struct southbridge_intel_i82801ix_config *config = dev->chip_info; + + /* Normal PCIe Scan */ + ret = pciexp_scan_bridge(dev, max); + + if (config->pcie_hotplug_map[PCI_FUNC(dev->path.pci.devfn)]) { + intel_acpi_pcie_hotplug_scan_slot(dev->link_list); + } + + return ret; +} + static struct pci_operations pci_ops = { .set_subsystem = pcie_set_subsystem, }; @@ -108,7 +134,7 @@ static struct device_operations device_ops = { .set_resources = pci_dev_set_resources, .enable_resources = pci_bus_enable_resources, .init = pci_init, - .scan_bus = pciexp_scan_bridge, + .scan_bus = pch_pciexp_scan_bridge, .ops_pci = &pci_ops, }; -- cgit v1.2.3