diff options
-rw-r--r-- | arch/v850/kernel/rte_mb_a_pci.c | 37 | ||||
-rw-r--r-- | arch/v850/kernel/vmlinux.lds.S | 14 | ||||
-rw-r--r-- | include/asm-v850/pci.h | 37 |
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 | ||
745 | void | 745 | void |
746 | pci_dma_sync_sg_for_cpu (struct pci_dev *dev, struct scatterlist *sg, int sg_len, | 746 | pci_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 | ||
752 | void | 753 | void |
753 | pci_dma_sync_sg_for_device (struct pci_dev *dev, struct scatterlist *sg, int sg_len, | 754 | pci_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 | |||
793 | void __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 | |||
806 | void 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 | ||
791 | EXPORT_SYMBOL (pci_map_single); | 814 | EXPORT_SYMBOL (pci_map_single); |
@@ -794,3 +817,5 @@ EXPORT_SYMBOL (pci_alloc_consistent); | |||
794 | EXPORT_SYMBOL (pci_free_consistent); | 817 | EXPORT_SYMBOL (pci_free_consistent); |
795 | EXPORT_SYMBOL (pci_dma_sync_single_for_cpu); | 818 | EXPORT_SYMBOL (pci_dma_sync_single_for_cpu); |
796 | EXPORT_SYMBOL (pci_dma_sync_single_for_device); | 819 | EXPORT_SYMBOL (pci_dma_sync_single_for_device); |
820 | EXPORT_SYMBOL (pci_iomap); | ||
821 | EXPORT_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. */ |
50 | extern void | 50 | extern void |
51 | pci_dma_sync_single_for_cpu (struct pci_dev *dev, dma_addr_t dma_addr, size_t size, | 51 | pci_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 | ||
54 | extern void | 54 | extern void |
55 | pci_dma_sync_single_for_device (struct pci_dev *dev, dma_addr_t dma_addr, size_t size, | 55 | pci_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 | |||
65 | pci_unmap_sg (struct pci_dev *pdev, struct scatterlist *sg, int sg_len, | 65 | pci_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. */ | ||
69 | extern void | ||
70 | pci_dma_sync_sg_for_cpu (struct pci_dev *dev, | ||
71 | struct scatterlist *sg, int sg_len, | ||
72 | int dir); | ||
73 | extern void | ||
74 | pci_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. */ | ||
84 | static inline int | ||
85 | pci_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 | ||
116 | extern void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long max); | ||
117 | extern void pci_iounmap (struct pci_dev *dev, void __iomem *addr); | ||
118 | |||
94 | static inline void pcibios_add_platform_entries(struct pci_dev *dev) | 119 | static inline void pcibios_add_platform_entries(struct pci_dev *dev) |
95 | { | 120 | { |
96 | } | 121 | } |