Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

MIPS: PCI: Use pci_resource_to_user to map pci memory space properly

[ralf@linux-mips.org: This only matters to Alchemy platforms. On other
platforms fixup_bigphys_addr is just an identidy mapping.]

Signed-off-by: Wolfgang Grandegger <wg@denx.de>
Cc: tiejun.chen <tiejun.chen@windriver.com>
Cc: Linux-MIPS <linux-mips@linux-mips.org>
Patchwork: https://patchwork.linux-mips.org/patch/1868/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>

authored by

Wolfgang Grandegger and committed by
Ralf Baechle
4c2924b7 9213ad77

+12
+12
arch/mips/include/asm/pci.h
··· 83 83 extern int pci_mmap_page_range(struct pci_dev *dev, struct vm_area_struct *vma, 84 84 enum pci_mmap_state mmap_state, int write_combine); 85 85 86 + #define HAVE_ARCH_PCI_RESOURCE_TO_USER 87 + 88 + static inline void pci_resource_to_user(const struct pci_dev *dev, int bar, 89 + const struct resource *rsrc, resource_size_t *start, 90 + resource_size_t *end) 91 + { 92 + phys_t size = resource_size(rsrc); 93 + 94 + *start = fixup_bigphys_addr(rsrc->start, size); 95 + *end = rsrc->start + size; 96 + } 97 + 86 98 /* 87 99 * Dynamic DMA mapping stuff. 88 100 * MIPS has everything mapped statically.