Skip to content

Commit

Permalink
MIPS: PCI: Use pci_resource_to_user to map pci memory space properly
Browse files Browse the repository at this point in the history
[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>
  • Loading branch information
Wolfgang Grandegger authored and Ralf Baechle committed Sep 18, 2013
1 parent 9213ad7 commit 4c2924b
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions arch/mips/include/asm/pci.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,18 @@ static inline void pcibios_penalize_isa_irq(int irq, int active)
extern int pci_mmap_page_range(struct pci_dev *dev, struct vm_area_struct *vma,
enum pci_mmap_state mmap_state, int write_combine);

#define HAVE_ARCH_PCI_RESOURCE_TO_USER

static inline void pci_resource_to_user(const struct pci_dev *dev, int bar,
const struct resource *rsrc, resource_size_t *start,
resource_size_t *end)
{
phys_t size = resource_size(rsrc);

*start = fixup_bigphys_addr(rsrc->start, size);
*end = rsrc->start + size;
}

/*
* Dynamic DMA mapping stuff.
* MIPS has everything mapped statically.
Expand Down

0 comments on commit 4c2924b

Please sign in to comment.