Skip to content

Commit 4c2924b

Browse files
grandwolfralfbaechle
authored andcommitted
MIPS: PCI: Use pci_resource_to_user to map pci memory space properly
[[email protected]: This only matters to Alchemy platforms. On other platforms fixup_bigphys_addr is just an identidy mapping.] Signed-off-by: Wolfgang Grandegger <[email protected]> Cc: tiejun.chen <[email protected]> Cc: Linux-MIPS <[email protected]> Patchwork: https://patchwork.linux-mips.org/patch/1868/ Signed-off-by: Ralf Baechle <[email protected]>
1 parent 9213ad7 commit 4c2924b

File tree

1 file changed

+12
-0
lines changed
  • arch/mips/include/asm

1 file changed

+12
-0
lines changed

arch/mips/include/asm/pci.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,18 @@ static inline void pcibios_penalize_isa_irq(int irq, int active)
8383
extern int pci_mmap_page_range(struct pci_dev *dev, struct vm_area_struct *vma,
8484
enum pci_mmap_state mmap_state, int write_combine);
8585

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+
8698
/*
8799
* Dynamic DMA mapping stuff.
88100
* MIPS has everything mapped statically.

0 commit comments

Comments
 (0)