X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=arch%2Fv850%2Fkernel%2Frte_mb_a_pci.c;h=f36b778f14320e96e6dca7f748b2ed7cf98ae76c;hb=16c70f8c1b54b61c3b951b6fb220df250fe09b32;hp=da39beb8e3c8fec1695ccf8635703a54481b18db;hpb=5273a3df6485dc2ad6aa7ddd441b9a21970f003b;p=linux-2.6.git diff --git a/arch/v850/kernel/rte_mb_a_pci.c b/arch/v850/kernel/rte_mb_a_pci.c index da39beb8e..f36b778f1 100644 --- a/arch/v850/kernel/rte_mb_a_pci.c +++ b/arch/v850/kernel/rte_mb_a_pci.c @@ -1,8 +1,8 @@ /* * arch/v850/kernel/mb_a_pci.c -- PCI support for Midas lab RTE-MOTHER-A board * - * Copyright (C) 2001,02,03 NEC Electronics Corporation - * Copyright (C) 2001,02,03 Miles Bader + * Copyright (C) 2001,02,03,05 NEC Electronics Corporation + * Copyright (C) 2001,02,03,05 Miles Bader * * This file is subject to the terms and conditions of the GNU General * Public License. See the file COPYING in the main directory of this @@ -11,7 +11,6 @@ * Written by Miles Bader */ -#include #include #include #include @@ -254,7 +253,7 @@ static void __devinit pcibios_assign_resources (void) struct pci_dev *dev = NULL; struct resource *r; - while ((dev = pci_find_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL) { + for_each_pci_dev(dev) { unsigned di_num; unsigned class = dev->class >> 8; @@ -322,8 +321,6 @@ pcibios_resource_to_bus(struct pci_dev *dev, struct pci_bus_region *region, /* Stubs for things we don't use. */ -struct pci_fixup pcibios_fixups[] = { { 0 } }; - /* Called after each bus is probed, but before its children are examined. */ void pcibios_fixup_bus(struct pci_bus *b) { @@ -331,7 +328,7 @@ void pcibios_fixup_bus(struct pci_bus *b) void pcibios_align_resource (void *data, struct resource *res, - unsigned long size, unsigned long align) + resource_size_t size, resource_size_t align) { } @@ -361,7 +358,7 @@ static struct mb_sram_free_area *mb_sram_free_areas = &mb_sram_free_tail; static struct mb_sram_free_area *mb_sram_free_free_areas = 0; /* Spinlock protecting the above globals. */ -static spinlock_t mb_sram_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(mb_sram_lock); /* Allocate a memory block at least SIZE bytes long in the Mother-A SRAM space. */ @@ -516,7 +513,7 @@ static struct dma_mapping *active_dma_mappings = 0; static struct dma_mapping *free_dma_mappings = 0; /* Spinlock protecting the above globals. */ -static spinlock_t dma_mappings_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(dma_mappings_lock); static struct dma_mapping *new_dma_mapping (size_t size) { @@ -745,15 +742,17 @@ pci_unmap_sg (struct pci_dev *pdev, struct scatterlist *sg, int sg_len,int dir) for a scatter-gather list, same rules and usage. */ void -pci_dma_sync_sg_for_cpu (struct pci_dev *dev, struct scatterlist *sg, int sg_len, - int dir) +pci_dma_sync_sg_for_cpu (struct pci_dev *dev, + struct scatterlist *sg, int sg_len, + int dir) { BUG (); } void -pci_dma_sync_sg_for_device (struct pci_dev *dev, struct scatterlist *sg, int sg_len, - int dir) +pci_dma_sync_sg_for_device (struct pci_dev *dev, + struct scatterlist *sg, int sg_len, + int dir) { BUG (); } @@ -787,6 +786,27 @@ pci_free_consistent (struct pci_dev *pdev, size_t size, void *cpu_addr, free_mb_sram (mb_sram_mem, size); } + +/* iomap/iomap */ + +void __iomem *pci_iomap (struct pci_dev *dev, int bar, unsigned long max) +{ + unsigned long start = pci_resource_start (dev, bar); + unsigned long len = pci_resource_len (dev, bar); + + if (!start || len == 0) + return 0; + + /* None of the ioremap functions actually do anything, other than + re-casting their argument, so don't bother differentiating them. */ + return ioremap (start, len); +} + +void pci_iounmap (struct pci_dev *dev, void __iomem *addr) +{ + /* nothing */ +} + /* symbol exports (for modules) */ @@ -796,3 +816,5 @@ EXPORT_SYMBOL (pci_alloc_consistent); EXPORT_SYMBOL (pci_free_consistent); EXPORT_SYMBOL (pci_dma_sync_single_for_cpu); EXPORT_SYMBOL (pci_dma_sync_single_for_device); +EXPORT_SYMBOL (pci_iomap); +EXPORT_SYMBOL (pci_iounmap);