]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commitdiff
parisc: provide pci_mmap_page_range() for parisc
authorThomas Bogendoerfer <tsbogend@alpha.franken.de>
Fri, 14 Jun 2013 07:05:41 +0000 (09:05 +0200)
committerHelge Deller <deller@gmx.de>
Tue, 18 Jun 2013 18:29:08 +0000 (20:29 +0200)
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>
arch/parisc/include/asm/pci.h
arch/parisc/kernel/pci.c

index 3234f492d5754b3935d03f73e3ead2bb940747c5..465154076d23f9c1191f6ff7dcc59cf7b61333de 100644 (file)
@@ -225,4 +225,9 @@ static inline int pci_get_legacy_ide_irq(struct pci_dev *dev, int channel)
        return channel ? 15 : 14;
 }
 
+#define HAVE_PCI_MMAP
+
+extern int pci_mmap_page_range(struct pci_dev *dev, struct vm_area_struct *vma,
+       enum pci_mmap_state mmap_state, int write_combine);
+
 #endif /* __ASM_PARISC_PCI_H */
index 60309051875e9887bcda5e584742ddc843d8585d..64f2764a8cef8778a0602262a5c5b10e4d68975d 100644 (file)
@@ -220,6 +220,33 @@ resource_size_t pcibios_align_resource(void *data, const struct resource *res,
 }
 
 
+int pci_mmap_page_range(struct pci_dev *dev, struct vm_area_struct *vma,
+                       enum pci_mmap_state mmap_state, int write_combine)
+{
+       unsigned long prot;
+
+       /*
+        * I/O space can be accessed via normal processor loads and stores on
+        * this platform but for now we elect not to do this and portable
+        * drivers should not do this anyway.
+        */
+       if (mmap_state == pci_mmap_io)
+               return -EINVAL;
+
+       if (write_combine)
+               return -EINVAL;
+
+       /*
+        * Ignore write-combine; for now only return uncached mappings.
+        */
+       prot = pgprot_val(vma->vm_page_prot);
+       prot |= _PAGE_NO_CACHE;
+       vma->vm_page_prot = __pgprot(prot);
+
+       return remap_pfn_range(vma, vma->vm_start, vma->vm_pgoff,
+               vma->vm_end - vma->vm_start, vma->vm_page_prot);
+}
+
 /*
  * A driver is enabling the device.  We make sure that all the appropriate
  * bits are set to allow the device to operate as the driver is expecting.