diff options
author | Bjorn Helgaas <bhelgaas@google.com> | 2012-07-09 15:38:57 -0400 |
---|---|---|
committer | Bjorn Helgaas <bhelgaas@google.com> | 2012-07-09 21:52:04 -0400 |
commit | 2b28ae1912e5ce5bb0527e352ae6ff04e76183d1 (patch) | |
tree | f8fb930ee1277c1e59c3db8bb802867e2c2d9a59 /include | |
parent | 5dde383e2ef5e22fe7db689dc38c1aabfb801449 (diff) |
PCI: reimplement P2P bridge 1K I/O windows (Intel P64H2)
9d265124d051 and 15a260d53f7c added quirks for P2P bridges that support
I/O windows that start/end at 1K boundaries, not just the 4K boundaries
defined by the PCI spec. For details, see the IOBL_ADR register and the
EN1K bit in the CNF register in the Intel 82870P2 (P64H2).
These quirks complicate the code that reads P2P bridge windows
(pci_read_bridge_io() and pci_cfg_fake_ranges()) because the bridge
I/O resource is updated in the HEADER quirk, in pci_read_bridge_io(),
in pci_setup_bridge(), and again in the FINAL quirk. This is confusing
and makes it impossible to reassign the bridge windows after FINAL
quirks are run.
This patch adds support for 1K windows in the generic paths, so the
HEADER quirk only has to enable this support. The FINAL quirk, which
used to undo damage done by pci_setup_bridge(), is no longer needed.
This removes "if (!res->start) res->start = ..." from pci_read_bridge_io();
that was part of 9d265124d051 to avoid overwriting the resource filled in
by the quirk. Since pci_read_bridge_io() itself now knows about
granularity, the quirk no longer updates the resource and this test is no
longer needed.
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/pci.h | 1 | ||||
-rw-r--r-- | include/linux/pci_regs.h | 3 |
2 files changed, 3 insertions, 1 deletions
diff --git a/include/linux/pci.h b/include/linux/pci.h index d8c379dba6ad..89b46fd245c6 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h | |||
@@ -324,6 +324,7 @@ struct pci_dev { | |||
324 | unsigned int is_hotplug_bridge:1; | 324 | unsigned int is_hotplug_bridge:1; |
325 | unsigned int __aer_firmware_first_valid:1; | 325 | unsigned int __aer_firmware_first_valid:1; |
326 | unsigned int __aer_firmware_first:1; | 326 | unsigned int __aer_firmware_first:1; |
327 | unsigned int io_window_1k:1; /* Intel P2P bridge 1K I/O windows */ | ||
327 | pci_dev_flags_t dev_flags; | 328 | pci_dev_flags_t dev_flags; |
328 | atomic_t enable_cnt; /* pci_enable_device has been called */ | 329 | atomic_t enable_cnt; /* pci_enable_device has been called */ |
329 | 330 | ||
diff --git a/include/linux/pci_regs.h b/include/linux/pci_regs.h index 4b608f543412..88c9ea56e252 100644 --- a/include/linux/pci_regs.h +++ b/include/linux/pci_regs.h | |||
@@ -125,7 +125,8 @@ | |||
125 | #define PCI_IO_RANGE_TYPE_MASK 0x0fUL /* I/O bridging type */ | 125 | #define PCI_IO_RANGE_TYPE_MASK 0x0fUL /* I/O bridging type */ |
126 | #define PCI_IO_RANGE_TYPE_16 0x00 | 126 | #define PCI_IO_RANGE_TYPE_16 0x00 |
127 | #define PCI_IO_RANGE_TYPE_32 0x01 | 127 | #define PCI_IO_RANGE_TYPE_32 0x01 |
128 | #define PCI_IO_RANGE_MASK (~0x0fUL) | 128 | #define PCI_IO_RANGE_MASK (~0x0fUL) /* Standard 4K I/O windows */ |
129 | #define PCI_IO_1K_RANGE_MASK (~0x03UL) /* Intel 1K I/O windows */ | ||
129 | #define PCI_SEC_STATUS 0x1e /* Secondary status register, only bit 14 used */ | 130 | #define PCI_SEC_STATUS 0x1e /* Secondary status register, only bit 14 used */ |
130 | #define PCI_MEMORY_BASE 0x20 /* Memory range behind */ | 131 | #define PCI_MEMORY_BASE 0x20 /* Memory range behind */ |
131 | #define PCI_MEMORY_LIMIT 0x22 | 132 | #define PCI_MEMORY_LIMIT 0x22 |