diff options
-rw-r--r-- | arch/sh/drivers/pci/Makefile | 6 | ||||
-rw-r--r-- | arch/sh/drivers/pci/pci-lib.c | 26 | ||||
-rw-r--r-- | arch/sh/include/asm/pci.h | 3 |
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 @@ | |||
1 | # | 1 | # |
2 | # Makefile for the PCI specific kernel interface routines under Linux. | 2 | # Makefile for the PCI specific kernel interface routines under Linux. |
3 | # | 3 | # |
4 | 4 | obj-y += pci-lib.o | |
5 | obj-$(CONFIG_PCI_AUTO) := pci.o pci-auto.o | 5 | obj-$(CONFIG_PCI_AUTO) += pci.o pci-auto.o |
6 | obj-$(CONFIG_PCI_NEW) := pci-new.o | 6 | obj-$(CONFIG_PCI_NEW) += pci-new.o |
7 | 7 | ||
8 | obj-$(CONFIG_CPU_SUBTYPE_SH7751) += pci-sh7751.o ops-sh4.o | 8 | obj-$(CONFIG_CPU_SUBTYPE_SH7751) += pci-sh7751.o ops-sh4.o |
9 | obj-$(CONFIG_CPU_SUBTYPE_SH7751R) += pci-sh7751.o ops-sh4.o | 9 | 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 @@ | |||
1 | #include <linux/kernel.h> | ||
2 | #include <linux/mm.h> | ||
3 | #include <linux/init.h> | ||
4 | #include <linux/types.h> | ||
5 | #include <linux/pci.h> | ||
6 | |||
7 | int pci_mmap_page_range(struct pci_dev *dev, struct vm_area_struct *vma, | ||
8 | enum pci_mmap_state mmap_state, int write_combine) | ||
9 | { | ||
10 | /* | ||
11 | * I/O space can be accessed via normal processor loads and stores on | ||
12 | * this platform but for now we elect not to do this and portable | ||
13 | * drivers should not do this anyway. | ||
14 | */ | ||
15 | if (mmap_state == pci_mmap_io) | ||
16 | return -EINVAL; | ||
17 | |||
18 | /* | ||
19 | * Ignore write-combine; for now only return uncached mappings. | ||
20 | */ | ||
21 | vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot); | ||
22 | |||
23 | return remap_pfn_range(vma, vma->vm_start, vma->vm_pgoff, | ||
24 | vma->vm_end - vma->vm_start, | ||
25 | vma->vm_page_prot); | ||
26 | } | ||
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[]; | |||
40 | 40 | ||
41 | struct pci_dev; | 41 | struct pci_dev; |
42 | 42 | ||
43 | #define HAVE_PCI_MMAP | ||
44 | extern int pci_mmap_page_range(struct pci_dev *dev, struct vm_area_struct *vma, | ||
45 | enum pci_mmap_state mmap_state, int write_combine); | ||
43 | extern void pcibios_set_master(struct pci_dev *dev); | 46 | extern void pcibios_set_master(struct pci_dev *dev); |
44 | 47 | ||
45 | static inline void pcibios_penalize_isa_irq(int irq, int active) | 48 | static inline void pcibios_penalize_isa_irq(int irq, int active) |