aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/v850/kernel/rte_mb_a_pci.c37
-rw-r--r--arch/v850/kernel/vmlinux.lds.S14
-rw-r--r--include/asm-v850/pci.h37
3 files changed, 76 insertions, 12 deletions
diff --git a/arch/v850/kernel/rte_mb_a_pci.c b/arch/v850/kernel/rte_mb_a_pci.c
index 074b50abc89d..ffbb6d073bf2 100644
--- a/arch/v850/kernel/rte_mb_a_pci.c
+++ b/arch/v850/kernel/rte_mb_a_pci.c
@@ -1,8 +1,8 @@
1/* 1/*
2 * arch/v850/kernel/mb_a_pci.c -- PCI support for Midas lab RTE-MOTHER-A board 2 * arch/v850/kernel/mb_a_pci.c -- PCI support for Midas lab RTE-MOTHER-A board
3 * 3 *
4 * Copyright (C) 2001,02,03 NEC Electronics Corporation 4 * Copyright (C) 2001,02,03,05 NEC Electronics Corporation
5 * Copyright (C) 2001,02,03 Miles Bader <miles@gnu.org> 5 * Copyright (C) 2001,02,03,05 Miles Bader <miles@gnu.org>
6 * 6 *
7 * This file is subject to the terms and conditions of the GNU General 7 * This file is subject to the terms and conditions of the GNU General
8 * Public License. See the file COPYING in the main directory of this 8 * Public License. See the file COPYING in the main directory of this
@@ -743,15 +743,17 @@ pci_unmap_sg (struct pci_dev *pdev, struct scatterlist *sg, int sg_len,int dir)
743 for a scatter-gather list, same rules and usage. */ 743 for a scatter-gather list, same rules and usage. */
744 744
745void 745void
746pci_dma_sync_sg_for_cpu (struct pci_dev *dev, struct scatterlist *sg, int sg_len, 746pci_dma_sync_sg_for_cpu (struct pci_dev *dev,
747 int dir) 747 struct scatterlist *sg, int sg_len,
748 int dir)
748{ 749{
749 BUG (); 750 BUG ();
750} 751}
751 752
752void 753void
753pci_dma_sync_sg_for_device (struct pci_dev *dev, struct scatterlist *sg, int sg_len, 754pci_dma_sync_sg_for_device (struct pci_dev *dev,
754 int dir) 755 struct scatterlist *sg, int sg_len,
756 int dir)
755{ 757{
756 BUG (); 758 BUG ();
757} 759}
@@ -786,6 +788,27 @@ pci_free_consistent (struct pci_dev *pdev, size_t size, void *cpu_addr,
786} 788}
787 789
788 790
791/* iomap/iomap */
792
793void __iomem *pci_iomap (struct pci_dev *dev, int bar, unsigned long max)
794{
795 unsigned long start = pci_resource_start (dev, bar);
796 unsigned long len = pci_resource_len (dev, bar);
797
798 if (!start || len == 0)
799 return 0;
800
801 /* None of the ioremap functions actually do anything, other than
802 re-casting their argument, so don't bother differentiating them. */
803 return ioremap (start, len);
804}
805
806void pci_iounmap (struct pci_dev *dev, void __iomem *addr)
807{
808 /* nothing */
809}
810
811
789/* symbol exports (for modules) */ 812/* symbol exports (for modules) */
790 813
791EXPORT_SYMBOL (pci_map_single); 814EXPORT_SYMBOL (pci_map_single);
@@ -794,3 +817,5 @@ EXPORT_SYMBOL (pci_alloc_consistent);
794EXPORT_SYMBOL (pci_free_consistent); 817EXPORT_SYMBOL (pci_free_consistent);
795EXPORT_SYMBOL (pci_dma_sync_single_for_cpu); 818EXPORT_SYMBOL (pci_dma_sync_single_for_cpu);
796EXPORT_SYMBOL (pci_dma_sync_single_for_device); 819EXPORT_SYMBOL (pci_dma_sync_single_for_device);
820EXPORT_SYMBOL (pci_iomap);
821EXPORT_SYMBOL (pci_iounmap);
diff --git a/arch/v850/kernel/vmlinux.lds.S b/arch/v850/kernel/vmlinux.lds.S
index c366a8b326ee..5be05f47109e 100644
--- a/arch/v850/kernel/vmlinux.lds.S
+++ b/arch/v850/kernel/vmlinux.lds.S
@@ -12,6 +12,7 @@
12 */ 12 */
13 13
14#include <linux/config.h> 14#include <linux/config.h>
15
15#define VMLINUX_SYMBOL(_sym_) _##_sym_ 16#define VMLINUX_SYMBOL(_sym_) _##_sym_
16#include <asm-generic/vmlinux.lds.h> 17#include <asm-generic/vmlinux.lds.h>
17 18
@@ -42,6 +43,19 @@
42 *(.rodata) *(.rodata.*) \ 43 *(.rodata) *(.rodata.*) \
43 *(__vermagic) /* Kernel version magic */ \ 44 *(__vermagic) /* Kernel version magic */ \
44 *(.rodata1) \ 45 *(.rodata1) \
46 /* PCI quirks */ \
47 ___start_pci_fixups_early = . ; \
48 *(.pci_fixup_early) \
49 ___end_pci_fixups_early = . ; \
50 ___start_pci_fixups_header = . ; \
51 *(.pci_fixup_header) \
52 ___end_pci_fixups_header = . ; \
53 ___start_pci_fixups_final = . ; \
54 *(.pci_fixup_final) \
55 ___end_pci_fixups_final = . ; \
56 ___start_pci_fixups_enable = . ; \
57 *(.pci_fixup_enable) \
58 ___end_pci_fixups_enable = . ; \
45 /* Kernel symbol table: Normal symbols */ \ 59 /* Kernel symbol table: Normal symbols */ \
46 ___start___ksymtab = .; \ 60 ___start___ksymtab = .; \
47 *(__ksymtab) \ 61 *(__ksymtab) \
diff --git a/include/asm-v850/pci.h b/include/asm-v850/pci.h
index 8e79be0fe99d..4581826e1cac 100644
--- a/include/asm-v850/pci.h
+++ b/include/asm-v850/pci.h
@@ -1,8 +1,8 @@
1/* 1/*
2 * include/asm-v850/pci.h -- PCI support 2 * include/asm-v850/pci.h -- PCI support
3 * 3 *
4 * Copyright (C) 2001,02 NEC Corporation 4 * Copyright (C) 2001,02,05 NEC Corporation
5 * Copyright (C) 2001,02 Miles Bader <miles@gnu.org> 5 * Copyright (C) 2001,02,05 Miles Bader <miles@gnu.org>
6 * 6 *
7 * This file is subject to the terms and conditions of the GNU General 7 * This file is subject to the terms and conditions of the GNU General
8 * Public License. See the file COPYING in the main directory of this 8 * Public License. See the file COPYING in the main directory of this
@@ -48,12 +48,12 @@ pci_unmap_single (struct pci_dev *pdev, dma_addr_t dma_addr, size_t size,
48 perform a pci_dma_sync_for_device, and then the device again owns 48 perform a pci_dma_sync_for_device, and then the device again owns
49 the buffer. */ 49 the buffer. */
50extern void 50extern void
51pci_dma_sync_single_for_cpu (struct pci_dev *dev, dma_addr_t dma_addr, size_t size, 51pci_dma_sync_single_for_cpu (struct pci_dev *dev, dma_addr_t dma_addr,
52 int dir); 52 size_t size, int dir);
53 53
54extern void 54extern void
55pci_dma_sync_single_for_device (struct pci_dev *dev, dma_addr_t dma_addr, size_t size, 55pci_dma_sync_single_for_device (struct pci_dev *dev, dma_addr_t dma_addr,
56 int dir); 56 size_t size, int dir);
57 57
58 58
59/* Do multiple DMA mappings at once. */ 59/* Do multiple DMA mappings at once. */
@@ -65,6 +65,28 @@ extern void
65pci_unmap_sg (struct pci_dev *pdev, struct scatterlist *sg, int sg_len, 65pci_unmap_sg (struct pci_dev *pdev, struct scatterlist *sg, int sg_len,
66 int dir); 66 int dir);
67 67
68/* SG-list versions of pci_dma_sync functions. */
69extern void
70pci_dma_sync_sg_for_cpu (struct pci_dev *dev,
71 struct scatterlist *sg, int sg_len,
72 int dir);
73extern void
74pci_dma_sync_sg_for_device (struct pci_dev *dev,
75 struct scatterlist *sg, int sg_len,
76 int dir);
77
78#define pci_map_page(dev, page, offs, size, dir) \
79 pci_map_single(dev, (page_address(page) + (offs)), size, dir)
80#define pci_unmap_page(dev,addr,sz,dir) \
81 pci_unmap_single(dev, addr, sz, dir)
82
83/* Test for pci_map_single or pci_map_page having generated an error. */
84static inline int
85pci_dma_mapping_error (dma_addr_t dma_addr)
86{
87 return dma_addr == 0;
88}
89
68/* Allocate and map kernel buffer using consistent mode DMA for PCI 90/* Allocate and map kernel buffer using consistent mode DMA for PCI
69 device. Returns non-NULL cpu-view pointer to the buffer if 91 device. Returns non-NULL cpu-view pointer to the buffer if
70 successful and sets *DMA_ADDR to the pci side dma address as well, 92 successful and sets *DMA_ADDR to the pci side dma address as well,
@@ -91,6 +113,9 @@ static inline void pci_dma_burst_advice(struct pci_dev *pdev,
91} 113}
92#endif 114#endif
93 115
116extern void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long max);
117extern void pci_iounmap (struct pci_dev *dev, void __iomem *addr);
118
94static inline void pcibios_add_platform_entries(struct pci_dev *dev) 119static inline void pcibios_add_platform_entries(struct pci_dev *dev)
95{ 120{
96} 121}