From 23d99bfa9f2c4ec2b842f5df135114271c68435d Mon Sep 17 00:00:00 2001 From: Daniel Yeisley Date: Thu, 21 Dec 2006 14:34:57 -0500 Subject: [PATCH] --- yaml --- r: 46725 b: refs/heads/master c: 15a260d53f7ca026e45109d2c2bec8c4b087780b h: refs/heads/master i: 46723: 3c171039a4b503f30fa9d65e915fa813e523aba9 v: v3 --- [refs] | 2 +- trunk/drivers/pci/quirks.c | 25 +++++++++++++++++++++++++ 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index d00332501358..d413b660ef89 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 9f593e30b318719b0e3889c730cc3a2d0729a707 +refs/heads/master: 15a260d53f7ca026e45109d2c2bec8c4b087780b diff --git a/trunk/drivers/pci/quirks.c b/trunk/drivers/pci/quirks.c index 1d04ca02dd0f..47214fdfa6c8 100644 --- a/trunk/drivers/pci/quirks.c +++ b/trunk/drivers/pci/quirks.c @@ -1670,6 +1670,31 @@ static void __devinit quirk_p64h2_1k_io(struct pci_dev *dev) } DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x1460, quirk_p64h2_1k_io); +/* Fix the IOBL_ADR for 1k I/O space granularity on the Intel P64H2 + * The IOBL_ADR gets re-written to 4k boundaries in pci_setup_bridge() + * in drivers/pci/setup-bus.c + */ +static void __devinit quirk_p64h2_1k_io_fix_iobl(struct pci_dev *dev) +{ + u16 en1k, iobl_adr, iobl_adr_1k; + struct resource *res = dev->resource + PCI_BRIDGE_RESOURCES; + + pci_read_config_word(dev, 0x40, &en1k); + + if (en1k & 0x200) { + pci_read_config_word(dev, PCI_IO_BASE, &iobl_adr); + + iobl_adr_1k = iobl_adr | (res->start >> 8) | (res->end & 0xfc00); + + if (iobl_adr != iobl_adr_1k) { + printk(KERN_INFO "PCI: Fixing P64H2 IOBL_ADR from 0x%x to 0x%x for 1 KB Granularity\n", + iobl_adr,iobl_adr_1k); + pci_write_config_word(dev, PCI_IO_BASE, iobl_adr_1k); + } + } +} +DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x1460, quirk_p64h2_1k_io_fix_iobl); + /* Under some circumstances, AER is not linked with extended capabilities. * Force it to be linked by setting the corresponding control bit in the * config space.