diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2008-12-10 13:03:55 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-12-10 13:03:55 -0500 |
commit | 942c88cc112d9038049a4d66dd0fb0da7b30667f (patch) | |
tree | 9e5db3f2ef27722f5209e20c8d4e6c89290f1cf3 | |
parent | cba767175becadc5c4016cceb7bfdd2c7fe722f4 (diff) | |
parent | 98873f53becea9a8a46972ff252e96fe575b120d (diff) |
Merge branch 'upstream' of git://ftp.linux-mips.org/pub/scm/upstream-linus
* 'upstream' of git://ftp.linux-mips.org/pub/scm/upstream-linus:
MIPS: Better than nothing implementation of PCI mmap to fix X.
-rw-r--r-- | arch/mips/include/asm/pci.h | 5 | ||||
-rw-r--r-- | arch/mips/pci/pci.c | 24 |
2 files changed, 29 insertions, 0 deletions
diff --git a/arch/mips/include/asm/pci.h b/arch/mips/include/asm/pci.h index 5510c53b7feb..053e4634acee 100644 --- a/arch/mips/include/asm/pci.h +++ b/arch/mips/include/asm/pci.h | |||
@@ -79,6 +79,11 @@ static inline void pcibios_penalize_isa_irq(int irq, int active) | |||
79 | /* We don't do dynamic PCI IRQ allocation */ | 79 | /* We don't do dynamic PCI IRQ allocation */ |
80 | } | 80 | } |
81 | 81 | ||
82 | #define HAVE_PCI_MMAP | ||
83 | |||
84 | extern int pci_mmap_page_range(struct pci_dev *dev, struct vm_area_struct *vma, | ||
85 | enum pci_mmap_state mmap_state, int write_combine); | ||
86 | |||
82 | /* | 87 | /* |
83 | * Dynamic DMA mapping stuff. | 88 | * Dynamic DMA mapping stuff. |
84 | * MIPS has everything mapped statically. | 89 | * MIPS has everything mapped statically. |
diff --git a/arch/mips/pci/pci.c b/arch/mips/pci/pci.c index a377e9d2d029..62cae740e250 100644 --- a/arch/mips/pci/pci.c +++ b/arch/mips/pci/pci.c | |||
@@ -354,6 +354,30 @@ EXPORT_SYMBOL(PCIBIOS_MIN_IO); | |||
354 | EXPORT_SYMBOL(PCIBIOS_MIN_MEM); | 354 | EXPORT_SYMBOL(PCIBIOS_MIN_MEM); |
355 | #endif | 355 | #endif |
356 | 356 | ||
357 | int pci_mmap_page_range(struct pci_dev *dev, struct vm_area_struct *vma, | ||
358 | enum pci_mmap_state mmap_state, int write_combine) | ||
359 | { | ||
360 | unsigned long prot; | ||
361 | |||
362 | /* | ||
363 | * I/O space can be accessed via normal processor loads and stores on | ||
364 | * this platform but for now we elect not to do this and portable | ||
365 | * drivers should not do this anyway. | ||
366 | */ | ||
367 | if (mmap_state == pci_mmap_io) | ||
368 | return -EINVAL; | ||
369 | |||
370 | /* | ||
371 | * Ignore write-combine; for now only return uncached mappings. | ||
372 | */ | ||
373 | prot = pgprot_val(vma->vm_page_prot); | ||
374 | prot = (prot & ~_CACHE_MASK) | _CACHE_UNCACHED; | ||
375 | vma->vm_page_prot = __pgprot(prot); | ||
376 | |||
377 | return remap_pfn_range(vma, vma->vm_start, vma->vm_pgoff, | ||
378 | vma->vm_end - vma->vm_start, vma->vm_page_prot); | ||
379 | } | ||
380 | |||
357 | char * (*pcibios_plat_setup)(char *str) __devinitdata; | 381 | char * (*pcibios_plat_setup)(char *str) __devinitdata; |
358 | 382 | ||
359 | char *__devinit pcibios_setup(char *str) | 383 | char *__devinit pcibios_setup(char *str) |