diff options
author | David S. Miller <davem@sunset.davemloft.net> | 2007-05-02 20:31:36 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-05-07 01:44:06 -0400 |
commit | 861fe90656b8e20d750d73c57088dc52d316ce7b (patch) | |
tree | 3f7df274478242ecf9f4186637c9cc38f59b5b8a /arch/sparc64/kernel/pci_iommu.c | |
parent | 4cad69174f385c183b2bcb369fb4304d8624ab96 (diff) |
[SPARC64]: SUN4U PCI-E controller support.
Some minor refactoring in the generic code was necessary for
this:
1) This controller requires 8-byte access to the interrupt map
and clear register. They are 64-bits on all the other
SBUS and PCI controllers anyways, so this was easy to cure.
2) The IMAP register has a different layout and some bits that we
need to preserve, so use a read/modify/write when making
changes to the IMAP register in generic code.
3) Flushing the entire IOMMU TLB is best done with a single write
to a register on this PCI controller, add a iommu->iommu_flushinv
for this.
Still lacks MSI support, that will come later.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/sparc64/kernel/pci_iommu.c')
-rw-r--r-- | arch/sparc64/kernel/pci_iommu.c | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/arch/sparc64/kernel/pci_iommu.c b/arch/sparc64/kernel/pci_iommu.c index 66712772f494..9e405cbbcb0d 100644 --- a/arch/sparc64/kernel/pci_iommu.c +++ b/arch/sparc64/kernel/pci_iommu.c | |||
@@ -37,17 +37,21 @@ | |||
37 | /* Must be invoked under the IOMMU lock. */ | 37 | /* Must be invoked under the IOMMU lock. */ |
38 | static void __iommu_flushall(struct iommu *iommu) | 38 | static void __iommu_flushall(struct iommu *iommu) |
39 | { | 39 | { |
40 | unsigned long tag; | 40 | if (iommu->iommu_flushinv) { |
41 | int entry; | 41 | pci_iommu_write(iommu->iommu_flushinv, ~(u64)0); |
42 | } else { | ||
43 | unsigned long tag; | ||
44 | int entry; | ||
42 | 45 | ||
43 | tag = iommu->iommu_flush + (0xa580UL - 0x0210UL); | 46 | tag = iommu->iommu_flush + (0xa580UL - 0x0210UL); |
44 | for (entry = 0; entry < 16; entry++) { | 47 | for (entry = 0; entry < 16; entry++) { |
45 | pci_iommu_write(tag, 0); | 48 | pci_iommu_write(tag, 0); |
46 | tag += 8; | 49 | tag += 8; |
47 | } | 50 | } |
48 | 51 | ||
49 | /* Ensure completion of previous PIO writes. */ | 52 | /* Ensure completion of previous PIO writes. */ |
50 | (void) pci_iommu_read(iommu->write_complete_reg); | 53 | (void) pci_iommu_read(iommu->write_complete_reg); |
54 | } | ||
51 | } | 55 | } |
52 | 56 | ||
53 | #define IOPTE_CONSISTENT(CTX) \ | 57 | #define IOPTE_CONSISTENT(CTX) \ |