summaryrefslogtreecommitdiff
path: root/src/southbridge/intel/i82801ix/pcie.c
diff options
context:
space:
mode:
authorVladimir Serbinenko <phcoder@gmail.com>2014-10-28 23:43:20 +0100
committerVladimir Serbinenko <phcoder@gmail.com>2014-11-19 21:09:51 +0100
commit36fa5b80843d836518eb89f46747e80ed6b5d96f (patch)
treea36f498a48aaa8764df768ff3616ff476f62a07b /src/southbridge/intel/i82801ix/pcie.c
parent10dd0e3171bc631fd5d83d4f42aa376edd3c6d55 (diff)
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 <phcoder@gmail.com> Reviewed-on: http://review.coreboot.org/7296 Reviewed-by: Edward O'Callaghan <eocallaghan@alterapraxis.com> Reviewed-by: Nicolas Reinecke <nr@das-labor.org> Tested-by: build bot (Jenkins)
Diffstat (limited to 'src/southbridge/intel/i82801ix/pcie.c')
-rw-r--r--src/southbridge/intel/i82801ix/pcie.c28
1 files changed, 27 insertions, 1 deletions
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 <device/pci.h>
#include <device/pciexp.h>
#include <device/pci_ids.h>
+#include <southbridge/intel/common/pciehp.h>
+#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,
};