diff options
author | Thomas Bogendoerfer <tsbogend@alpha.franken.de> | 2013-06-14 03:05:41 -0400 |
---|---|---|
committer | Helge Deller <deller@gmx.de> | 2013-06-18 14:29:08 -0400 |
commit | 2cc7138f4347df939ce03f313e3d87794bab36f8 (patch) | |
tree | 454da49dd4761ae664ca8901944c4b5c89a6f0cf /arch | |
parent | 9a66d1869d90f13fbaf83dcce5b1aeec86fbc699 (diff) |
parisc: provide pci_mmap_page_range() for parisc
pci_mmap_page_range() is needed for X11-server support on C8000 with ATI
FireGL card.
Signed-off-by Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Signed-off-by: Helge Deller <deller@gmx.de>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/parisc/include/asm/pci.h | 5 | ||||
-rw-r--r-- | arch/parisc/kernel/pci.c | 27 |
2 files changed, 32 insertions, 0 deletions
diff --git a/arch/parisc/include/asm/pci.h b/arch/parisc/include/asm/pci.h index 3234f492d575..465154076d23 100644 --- a/arch/parisc/include/asm/pci.h +++ b/arch/parisc/include/asm/pci.h | |||
@@ -225,4 +225,9 @@ static inline int pci_get_legacy_ide_irq(struct pci_dev *dev, int channel) | |||
225 | return channel ? 15 : 14; | 225 | return channel ? 15 : 14; |
226 | } | 226 | } |
227 | 227 | ||
228 | #define HAVE_PCI_MMAP | ||
229 | |||
230 | extern int pci_mmap_page_range(struct pci_dev *dev, struct vm_area_struct *vma, | ||
231 | enum pci_mmap_state mmap_state, int write_combine); | ||
232 | |||
228 | #endif /* __ASM_PARISC_PCI_H */ | 233 | #endif /* __ASM_PARISC_PCI_H */ |
diff --git a/arch/parisc/kernel/pci.c b/arch/parisc/kernel/pci.c index 60309051875e..64f2764a8cef 100644 --- a/arch/parisc/kernel/pci.c +++ b/arch/parisc/kernel/pci.c | |||
@@ -220,6 +220,33 @@ resource_size_t pcibios_align_resource(void *data, const struct resource *res, | |||
220 | } | 220 | } |
221 | 221 | ||
222 | 222 | ||
223 | int pci_mmap_page_range(struct pci_dev *dev, struct vm_area_struct *vma, | ||
224 | enum pci_mmap_state mmap_state, int write_combine) | ||
225 | { | ||
226 | unsigned long prot; | ||
227 | |||
228 | /* | ||
229 | * I/O space can be accessed via normal processor loads and stores on | ||
230 | * this platform but for now we elect not to do this and portable | ||
231 | * drivers should not do this anyway. | ||
232 | */ | ||
233 | if (mmap_state == pci_mmap_io) | ||
234 | return -EINVAL; | ||
235 | |||
236 | if (write_combine) | ||
237 | return -EINVAL; | ||
238 | |||
239 | /* | ||
240 | * Ignore write-combine; for now only return uncached mappings. | ||
241 | */ | ||
242 | prot = pgprot_val(vma->vm_page_prot); | ||
243 | prot |= _PAGE_NO_CACHE; | ||
244 | vma->vm_page_prot = __pgprot(prot); | ||
245 | |||
246 | return remap_pfn_range(vma, vma->vm_start, vma->vm_pgoff, | ||
247 | vma->vm_end - vma->vm_start, vma->vm_page_prot); | ||
248 | } | ||
249 | |||
223 | /* | 250 | /* |
224 | * A driver is enabling the device. We make sure that all the appropriate | 251 | * A driver is enabling the device. We make sure that all the appropriate |
225 | * bits are set to allow the device to operate as the driver is expecting. | 252 | * bits are set to allow the device to operate as the driver is expecting. |