Skip to content

Commit 5e742bd

Browse files
Graham Mooredinguyen702
authored andcommitted
FogBugz #172665: Sample driver for DMA transfer to FPGA soft IP (FIFO)
-This fpga-dma driver is an example driver for a specific FPGA soft IP -The soft IP presents a FIFO which can be read and written through the debugfs interface -The DMA transfer code uses 'generic' dma interfaces -The fpga-dma driver uses generic register and DMA definitions in the devicetree V2: -Device tree changes removed from socfpga_cyclone5.dts and documented in Documentation/devicetree/bindings/arm/altera/fpga-dma.txt V3: -Formatting changes, used Lindent script to format fpga-dma.c V4: -More formatting changes, lined up #defines, alphabetize headers Signed-off-by: Graham Moore <[email protected]>
1 parent 3230fa8 commit 5e742bd

File tree

4 files changed

+720
-0
lines changed

4 files changed

+720
-0
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
Altera FPGA DMA FIFO driver
2+
3+
Required properties:
4+
- compatible : "altr,fpga-dma";
5+
6+
- reg : CSR and DATA register resource definitions (address and length).
7+
8+
- reg-names : Names of the register resources. Should be "csr", "data".
9+
10+
- dmas : DMA request lines. Should be <&pdma 0 &pdma 1>
11+
12+
- dma-names : Names of DMA request lines. Should be "tx", "rx".
13+
14+
Example:
15+
16+
fpgadma: fifo {
17+
#address-cells = <1>;
18+
#size-cells = <1>;
19+
compatible = "altr,fpga-dma";
20+
reg = <0xff230000 0x20>, <0xc0011000 0x400>;
21+
reg-names = "csr", "data";
22+
dmas = <&pdma 0 &pdma 1>;
23+
dma-names = "tx", "rx";
24+
};
25+

arch/arm/mach-socfpga/Kconfig

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,8 @@ config SOCFPGA_SUSPEND
2727
Select this if you want to enable Suspend-to-RAM on SOCFPGA
2828
platforms.
2929
endif
30+
config FPGADMA
31+
tristate "FPGA DMA FIFO driver"
32+
depends on DMA_ENGINE
33+
help
34+
Sample FPGA DMA driver, for testing with special FPGA FIFO image

arch/arm/mach-socfpga/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,4 @@ obj-$(CONFIG_SMP) += headsmp.o platsmp.o
88
obj-$(CONFIG_SOCFPGA_SUSPEND) += pm.o self-refresh.o
99
obj-$(CONFIG_EDAC_ALTERA_L2C) += l2_cache.o
1010
obj-$(CONFIG_EDAC_ALTERA_OCRAM) += ocram.o
11+
obj-$(CONFIG_FPGADMA) += fpga-dma.o

0 commit comments

Comments
 (0)