diff options
author | Bryan Wu <bryan.wu@analog.com> | 2007-05-06 17:50:22 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-05-07 15:12:58 -0400 |
commit | 1394f03221790a988afc3e4b3cb79f2e477246a9 (patch) | |
tree | 2c1963c9a4f2d84a5e021307fde240c5d567cf70 /include/asm-blackfin/dma-mapping.h | |
parent | 73243284463a761e04d69d22c7516b2be7de096c (diff) |
blackfin architecture
This adds support for the Analog Devices Blackfin processor architecture, and
currently supports the BF533, BF532, BF531, BF537, BF536, BF534, and BF561
(Dual Core) devices, with a variety of development platforms including those
avaliable from Analog Devices (BF533-EZKit, BF533-STAMP, BF537-STAMP,
BF561-EZKIT), and Bluetechnix! Tinyboards.
The Blackfin architecture was jointly developed by Intel and Analog Devices
Inc. (ADI) as the Micro Signal Architecture (MSA) core and introduced it in
December of 2000. Since then ADI has put this core into its Blackfin
processor family of devices. The Blackfin core has the advantages of a clean,
orthogonal,RISC-like microprocessor instruction set. It combines a dual-MAC
(Multiply/Accumulate), state-of-the-art signal processing engine and
single-instruction, multiple-data (SIMD) multimedia capabilities into a single
instruction-set architecture.
The Blackfin architecture, including the instruction set, is described by the
ADSP-BF53x/BF56x Blackfin Processor Programming Reference
http://blackfin.uclinux.org/gf/download/frsrelease/29/2549/Blackfin_PRM.pdf
The Blackfin processor is already supported by major releases of gcc, and
there are binary and source rpms/tarballs for many architectures at:
http://blackfin.uclinux.org/gf/project/toolchain/frs There is complete
documentation, including "getting started" guides available at:
http://docs.blackfin.uclinux.org/ which provides links to the sources and
patches you will need in order to set up a cross-compiling environment for
bfin-linux-uclibc
This patch, as well as the other patches (toolchain, distribution,
uClibc) are actively supported by Analog Devices Inc, at:
http://blackfin.uclinux.org/
We have tested this on LTP, and our test plan (including pass/fails) can
be found at:
http://docs.blackfin.uclinux.org/doku.php?id=testing_the_linux_kernel
[m.kozlowski@tuxland.pl: balance parenthesis in blackfin header files]
Signed-off-by: Bryan Wu <bryan.wu@analog.com>
Signed-off-by: Mariusz Kozlowski <m.kozlowski@tuxland.pl>
Signed-off-by: Aubrey Li <aubrey.li@analog.com>
Signed-off-by: Jie Zhang <jie.zhang@analog.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/asm-blackfin/dma-mapping.h')
-rw-r--r-- | include/asm-blackfin/dma-mapping.h | 66 |
1 files changed, 66 insertions, 0 deletions
diff --git a/include/asm-blackfin/dma-mapping.h b/include/asm-blackfin/dma-mapping.h new file mode 100644 index 000000000000..7a77d7fe3a33 --- /dev/null +++ b/include/asm-blackfin/dma-mapping.h | |||
@@ -0,0 +1,66 @@ | |||
1 | #ifndef _BLACKFIN_DMA_MAPPING_H | ||
2 | #define _BLACKFIN_DMA_MAPPING_H | ||
3 | |||
4 | #include <asm/scatterlist.h> | ||
5 | |||
6 | void dma_alloc_init(unsigned long start, unsigned long end); | ||
7 | void *dma_alloc_coherent(struct device *dev, size_t size, | ||
8 | dma_addr_t *dma_handle, gfp_t gfp); | ||
9 | void dma_free_coherent(struct device *dev, size_t size, void *vaddr, | ||
10 | dma_addr_t dma_handle); | ||
11 | |||
12 | /* | ||
13 | * Now for the API extensions over the pci_ one | ||
14 | */ | ||
15 | #define dma_alloc_noncoherent(d, s, h, f) dma_alloc_coherent(d, s, h, f) | ||
16 | #define dma_free_noncoherent(d, s, v, h) dma_free_coherent(d, s, v, h) | ||
17 | |||
18 | /* | ||
19 | * Map a single buffer of the indicated size for DMA in streaming mode. | ||
20 | * The 32-bit bus address to use is returned. | ||
21 | * | ||
22 | * Once the device is given the dma address, the device owns this memory | ||
23 | * until either pci_unmap_single or pci_dma_sync_single is performed. | ||
24 | */ | ||
25 | extern dma_addr_t dma_map_single(struct device *dev, void *ptr, size_t size, | ||
26 | enum dma_data_direction direction); | ||
27 | |||
28 | /* | ||
29 | * Unmap a single streaming mode DMA translation. The dma_addr and size | ||
30 | * must match what was provided for in a previous pci_map_single call. All | ||
31 | * other usages are undefined. | ||
32 | * | ||
33 | * After this call, reads by the cpu to the buffer are guarenteed to see | ||
34 | * whatever the device wrote there. | ||
35 | */ | ||
36 | extern void dma_unmap_single(struct device *dev, dma_addr_t dma_addr, size_t size, | ||
37 | enum dma_data_direction direction); | ||
38 | |||
39 | /* | ||
40 | * Map a set of buffers described by scatterlist in streaming | ||
41 | * mode for DMA. This is the scather-gather version of the | ||
42 | * above pci_map_single interface. Here the scatter gather list | ||
43 | * elements are each tagged with the appropriate dma address | ||
44 | * and length. They are obtained via sg_dma_{address,length}(SG). | ||
45 | * | ||
46 | * NOTE: An implementation may be able to use a smaller number of | ||
47 | * DMA address/length pairs than there are SG table elements. | ||
48 | * (for example via virtual mapping capabilities) | ||
49 | * The routine returns the number of addr/length pairs actually | ||
50 | * used, at most nents. | ||
51 | * | ||
52 | * Device ownership issues as mentioned above for pci_map_single are | ||
53 | * the same here. | ||
54 | */ | ||
55 | extern int dma_map_sg(struct device *dev, struct scatterlist *sg, int nents, | ||
56 | enum dma_data_direction direction); | ||
57 | |||
58 | /* | ||
59 | * Unmap a set of streaming mode DMA translations. | ||
60 | * Again, cpu read rules concerning calls here are the same as for | ||
61 | * pci_unmap_single() above. | ||
62 | */ | ||
63 | extern void dma_unmap_sg(struct device *dev, struct scatterlist *sg, | ||
64 | int nhwentries, enum dma_data_direction direction); | ||
65 | |||
66 | #endif /* _BLACKFIN_DMA_MAPPING_H */ | ||