Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[PATCH] v850: Update PCI support

These changes are untested (I no longer have the hardware).

Signed-off-by: Miles Bader <miles@gnu.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

authored by

Miles Bader and committed by
Linus Torvalds
8b2bf069 947ac8b9

+76 -12
+31 -6
arch/v850/kernel/rte_mb_a_pci.c
··· 1 1 /* 2 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 5 - * Copyright (C) 2001,02,03 Miles Bader <miles@gnu.org> 4 + * Copyright (C) 2001,02,03,05 NEC Electronics Corporation 5 + * Copyright (C) 2001,02,03,05 Miles Bader <miles@gnu.org> 6 6 * 7 7 * This file is subject to the terms and conditions of the GNU General 8 8 * Public License. See the file COPYING in the main directory of this ··· 743 743 for a scatter-gather list, same rules and usage. */ 744 744 745 745 void 746 - pci_dma_sync_sg_for_cpu (struct pci_dev *dev, struct scatterlist *sg, int sg_len, 747 - int dir) 746 + pci_dma_sync_sg_for_cpu (struct pci_dev *dev, 747 + struct scatterlist *sg, int sg_len, 748 + int dir) 748 749 { 749 750 BUG (); 750 751 } 751 752 752 753 void 753 - pci_dma_sync_sg_for_device (struct pci_dev *dev, struct scatterlist *sg, int sg_len, 754 - int dir) 754 + pci_dma_sync_sg_for_device (struct pci_dev *dev, 755 + struct scatterlist *sg, int sg_len, 756 + int dir) 755 757 { 756 758 BUG (); 757 759 } ··· 788 786 } 789 787 790 788 789 + /* iomap/iomap */ 790 + 791 + void __iomem *pci_iomap (struct pci_dev *dev, int bar, unsigned long max) 792 + { 793 + unsigned long start = pci_resource_start (dev, bar); 794 + unsigned long len = pci_resource_len (dev, bar); 795 + 796 + if (!start || len == 0) 797 + return 0; 798 + 799 + /* None of the ioremap functions actually do anything, other than 800 + re-casting their argument, so don't bother differentiating them. */ 801 + return ioremap (start, len); 802 + } 803 + 804 + void pci_iounmap (struct pci_dev *dev, void __iomem *addr) 805 + { 806 + /* nothing */ 807 + } 808 + 809 + 791 810 /* symbol exports (for modules) */ 792 811 793 812 EXPORT_SYMBOL (pci_map_single); ··· 817 794 EXPORT_SYMBOL (pci_free_consistent); 818 795 EXPORT_SYMBOL (pci_dma_sync_single_for_cpu); 819 796 EXPORT_SYMBOL (pci_dma_sync_single_for_device); 797 + EXPORT_SYMBOL (pci_iomap); 798 + EXPORT_SYMBOL (pci_iounmap);
+14
arch/v850/kernel/vmlinux.lds.S
··· 12 12 */ 13 13 14 14 #include <linux/config.h> 15 + 15 16 #define VMLINUX_SYMBOL(_sym_) _##_sym_ 16 17 #include <asm-generic/vmlinux.lds.h> 17 18 ··· 43 42 *(.rodata) *(.rodata.*) \ 44 43 *(__vermagic) /* Kernel version magic */ \ 45 44 *(.rodata1) \ 45 + /* PCI quirks */ \ 46 + ___start_pci_fixups_early = . ; \ 47 + *(.pci_fixup_early) \ 48 + ___end_pci_fixups_early = . ; \ 49 + ___start_pci_fixups_header = . ; \ 50 + *(.pci_fixup_header) \ 51 + ___end_pci_fixups_header = . ; \ 52 + ___start_pci_fixups_final = . ; \ 53 + *(.pci_fixup_final) \ 54 + ___end_pci_fixups_final = . ; \ 55 + ___start_pci_fixups_enable = . ; \ 56 + *(.pci_fixup_enable) \ 57 + ___end_pci_fixups_enable = . ; \ 46 58 /* Kernel symbol table: Normal symbols */ \ 47 59 ___start___ksymtab = .; \ 48 60 *(__ksymtab) \
+31 -6
include/asm-v850/pci.h
··· 1 1 /* 2 2 * include/asm-v850/pci.h -- PCI support 3 3 * 4 - * Copyright (C) 2001,02 NEC Corporation 5 - * Copyright (C) 2001,02 Miles Bader <miles@gnu.org> 4 + * Copyright (C) 2001,02,05 NEC Corporation 5 + * Copyright (C) 2001,02,05 Miles Bader <miles@gnu.org> 6 6 * 7 7 * This file is subject to the terms and conditions of the GNU General 8 8 * Public License. See the file COPYING in the main directory of this ··· 48 48 perform a pci_dma_sync_for_device, and then the device again owns 49 49 the buffer. */ 50 50 extern void 51 - pci_dma_sync_single_for_cpu (struct pci_dev *dev, dma_addr_t dma_addr, size_t size, 52 - int dir); 51 + pci_dma_sync_single_for_cpu (struct pci_dev *dev, dma_addr_t dma_addr, 52 + size_t size, int dir); 53 53 54 54 extern void 55 - pci_dma_sync_single_for_device (struct pci_dev *dev, dma_addr_t dma_addr, size_t size, 56 - int dir); 55 + pci_dma_sync_single_for_device (struct pci_dev *dev, dma_addr_t dma_addr, 56 + size_t size, int dir); 57 57 58 58 59 59 /* Do multiple DMA mappings at once. */ ··· 64 64 extern void 65 65 pci_unmap_sg (struct pci_dev *pdev, struct scatterlist *sg, int sg_len, 66 66 int dir); 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 + } 67 89 68 90 /* Allocate and map kernel buffer using consistent mode DMA for PCI 69 91 device. Returns non-NULL cpu-view pointer to the buffer if ··· 112 90 *strategy_parameter = ~0UL; 113 91 } 114 92 #endif 93 + 94 + extern void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long max); 95 + extern void pci_iounmap (struct pci_dev *dev, void __iomem *addr); 115 96 116 97 static inline void pcibios_add_platform_entries(struct pci_dev *dev) 117 98 {