summaryrefslogtreecommitdiffstats
path: root/arch/sh
diff options
context:
space:
mode:
authorPaul Mundt <lethal@linux-sh.org>2009-04-20 08:51:45 +0200
committerPaul Mundt <lethal@linux-sh.org>2009-04-20 08:51:45 +0200
commit9833385131fc4e8c52f95320ab899051d1c06831 (patch)
treeb293094ef57c340e196bae1a79ab061b2f93df46 /arch/sh
parentsh: pci: Split out new-style PCI core. (diff)
downloadlinux-9833385131fc4e8c52f95320ab899051d1c06831.tar.xz
linux-9833385131fc4e8c52f95320ab899051d1c06831.zip
sh: pci: HAVE_PCI_MMAP support.
Derived from the MIPS version, now uses pgprot_noncached(). Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh')
-rw-r--r--arch/sh/drivers/pci/Makefile6
-rw-r--r--arch/sh/drivers/pci/pci-lib.c26
-rw-r--r--arch/sh/include/asm/pci.h3
3 files changed, 32 insertions, 3 deletions
diff --git a/arch/sh/drivers/pci/Makefile b/arch/sh/drivers/pci/Makefile
index 362a1eec73a4..c8eab14843e5 100644
--- a/arch/sh/drivers/pci/Makefile
+++ b/arch/sh/drivers/pci/Makefile
@@ -1,9 +1,9 @@
#
# Makefile for the PCI specific kernel interface routines under Linux.
#
-
-obj-$(CONFIG_PCI_AUTO) := pci.o pci-auto.o
-obj-$(CONFIG_PCI_NEW) := pci-new.o
+obj-y += pci-lib.o
+obj-$(CONFIG_PCI_AUTO) += pci.o pci-auto.o
+obj-$(CONFIG_PCI_NEW) += pci-new.o
obj-$(CONFIG_CPU_SUBTYPE_SH7751) += pci-sh7751.o ops-sh4.o
obj-$(CONFIG_CPU_SUBTYPE_SH7751R) += pci-sh7751.o ops-sh4.o
diff --git a/arch/sh/drivers/pci/pci-lib.c b/arch/sh/drivers/pci/pci-lib.c
new file mode 100644
index 000000000000..1a43a350d574
--- /dev/null
+++ b/arch/sh/drivers/pci/pci-lib.c
@@ -0,0 +1,26 @@
+#include <linux/kernel.h>
+#include <linux/mm.h>
+#include <linux/init.h>
+#include <linux/types.h>
+#include <linux/pci.h>
+
+int pci_mmap_page_range(struct pci_dev *dev, struct vm_area_struct *vma,
+ enum pci_mmap_state mmap_state, int write_combine)
+{
+ /*
+ * 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;
+
+ /*
+ * Ignore write-combine; for now only return uncached mappings.
+ */
+ vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
+
+ return remap_pfn_range(vma, vma->vm_start, vma->vm_pgoff,
+ vma->vm_end - vma->vm_start,
+ vma->vm_page_prot);
+}
diff --git a/arch/sh/include/asm/pci.h b/arch/sh/include/asm/pci.h
index 69cb615c3916..46afd449739d 100644
--- a/arch/sh/include/asm/pci.h
+++ b/arch/sh/include/asm/pci.h
@@ -40,6 +40,9 @@ extern struct pci_channel board_pci_channels[];
struct pci_dev;
+#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);
extern void pcibios_set_master(struct pci_dev *dev);
static inline void pcibios_penalize_isa_irq(int irq, int active)