forked from torvalds/linux
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
These changes are untested (I no longer have the hardware). Signed-off-by: Miles Bader <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
- Loading branch information
1 parent
947ac8b
commit 8b2bf06
Showing
3 changed files
with
76 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 <[email protected]> | ||
* Copyright (C) 2001,02,03,05 NEC Electronics Corporation | ||
* Copyright (C) 2001,02,03,05 Miles Bader <[email protected]> | ||
* | ||
* 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 | ||
|
@@ -743,15 +743,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 (); | ||
} | ||
|
@@ -785,6 +787,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) */ | ||
|
||
|
@@ -794,3 +817,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); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
/* | ||
* include/asm-v850/pci.h -- PCI support | ||
* | ||
* Copyright (C) 2001,02 NEC Corporation | ||
* Copyright (C) 2001,02 Miles Bader <[email protected]> | ||
* Copyright (C) 2001,02,05 NEC Corporation | ||
* Copyright (C) 2001,02,05 Miles Bader <[email protected]> | ||
* | ||
* 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 | ||
|
@@ -48,12 +48,12 @@ pci_unmap_single (struct pci_dev *pdev, dma_addr_t dma_addr, size_t size, | |
perform a pci_dma_sync_for_device, and then the device again owns | ||
the buffer. */ | ||
extern void | ||
pci_dma_sync_single_for_cpu (struct pci_dev *dev, dma_addr_t dma_addr, size_t size, | ||
int dir); | ||
pci_dma_sync_single_for_cpu (struct pci_dev *dev, dma_addr_t dma_addr, | ||
size_t size, int dir); | ||
|
||
extern void | ||
pci_dma_sync_single_for_device (struct pci_dev *dev, dma_addr_t dma_addr, size_t size, | ||
int dir); | ||
pci_dma_sync_single_for_device (struct pci_dev *dev, dma_addr_t dma_addr, | ||
size_t size, int dir); | ||
|
||
|
||
/* Do multiple DMA mappings at once. */ | ||
|
@@ -65,6 +65,28 @@ extern void | |
pci_unmap_sg (struct pci_dev *pdev, struct scatterlist *sg, int sg_len, | ||
int dir); | ||
|
||
/* SG-list versions of pci_dma_sync functions. */ | ||
extern void | ||
pci_dma_sync_sg_for_cpu (struct pci_dev *dev, | ||
struct scatterlist *sg, int sg_len, | ||
int dir); | ||
extern void | ||
pci_dma_sync_sg_for_device (struct pci_dev *dev, | ||
struct scatterlist *sg, int sg_len, | ||
int dir); | ||
|
||
#define pci_map_page(dev, page, offs, size, dir) \ | ||
pci_map_single(dev, (page_address(page) + (offs)), size, dir) | ||
#define pci_unmap_page(dev,addr,sz,dir) \ | ||
pci_unmap_single(dev, addr, sz, dir) | ||
|
||
/* Test for pci_map_single or pci_map_page having generated an error. */ | ||
static inline int | ||
pci_dma_mapping_error (dma_addr_t dma_addr) | ||
{ | ||
return dma_addr == 0; | ||
} | ||
|
||
/* Allocate and map kernel buffer using consistent mode DMA for PCI | ||
device. Returns non-NULL cpu-view pointer to the buffer if | ||
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, | |
} | ||
#endif | ||
|
||
extern void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long max); | ||
extern void pci_iounmap (struct pci_dev *dev, void __iomem *addr); | ||
|
||
static inline void pcibios_add_platform_entries(struct pci_dev *dev) | ||
{ | ||
} | ||
|