aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci/quirks.c
diff options
context:
space:
mode:
authorDaniel Yeisley <dan.yeisley@unisys.com>2006-12-21 14:34:57 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2007-02-07 18:50:05 -0500
commit15a260d53f7ca026e45109d2c2bec8c4b087780b (patch)
tree6db2fde4b3c8589f94f532e09f4e105c703b7606 /drivers/pci/quirks.c
parent9f593e30b318719b0e3889c730cc3a2d0729a707 (diff)
PCI Quirk: 1k I/O space IOBL_ADR fix on P64H2
There's an existing quirk for the kernel to use 1k IO space granularity on the Intel P64H2. It turns out however that pci_setup_bridge() in drivers/pci/setup-bus.c reads in the IO base and limit address register masks it off to the nearest 4k, and writes it back. This causes the kernel to be on 1k boundaries and the hardware to be 4k aligned. The patch below fixes the problem. Signed-off-by: Dan Yeisley <dan.yeisley@unisys.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/pci/quirks.c')
-rw-r--r--drivers/pci/quirks.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
index 1d04ca02dd0f..47214fdfa6c8 100644
--- a/drivers/pci/quirks.c
+++ b/drivers/pci/quirks.c
@@ -1670,6 +1670,31 @@ static void __devinit quirk_p64h2_1k_io(struct pci_dev *dev)
1670} 1670}
1671DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x1460, quirk_p64h2_1k_io); 1671DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x1460, quirk_p64h2_1k_io);
1672 1672
1673/* Fix the IOBL_ADR for 1k I/O space granularity on the Intel P64H2
1674 * The IOBL_ADR gets re-written to 4k boundaries in pci_setup_bridge()
1675 * in drivers/pci/setup-bus.c
1676 */
1677static void __devinit quirk_p64h2_1k_io_fix_iobl(struct pci_dev *dev)
1678{
1679 u16 en1k, iobl_adr, iobl_adr_1k;
1680 struct resource *res = dev->resource + PCI_BRIDGE_RESOURCES;
1681
1682 pci_read_config_word(dev, 0x40, &en1k);
1683
1684 if (en1k & 0x200) {
1685 pci_read_config_word(dev, PCI_IO_BASE, &iobl_adr);
1686
1687 iobl_adr_1k = iobl_adr | (res->start >> 8) | (res->end & 0xfc00);
1688
1689 if (iobl_adr != iobl_adr_1k) {
1690 printk(KERN_INFO "PCI: Fixing P64H2 IOBL_ADR from 0x%x to 0x%x for 1 KB Granularity\n",
1691 iobl_adr,iobl_adr_1k);
1692 pci_write_config_word(dev, PCI_IO_BASE, iobl_adr_1k);
1693 }
1694 }
1695}
1696DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x1460, quirk_p64h2_1k_io_fix_iobl);
1697
1673/* Under some circumstances, AER is not linked with extended capabilities. 1698/* Under some circumstances, AER is not linked with extended capabilities.
1674 * Force it to be linked by setting the corresponding control bit in the 1699 * Force it to be linked by setting the corresponding control bit in the
1675 * config space. 1700 * config space.