Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
S
Simple PCIe FMC carrier SPEC
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
50
Issues
50
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
Simple PCIe FMC carrier SPEC
Commits
bc13ae65
Commit
bc13ae65
authored
May 04, 2020
by
Federico Vaga
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sw:drv: pass DMA engine to app device as resource
Signed-off-by:
Federico Vaga
<
federico.vaga@cern.ch
>
parent
291f39b9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
2 deletions
+21
-2
spec-core-fpga.c
software/kernel/spec-core-fpga.c
+21
-2
No files found.
software/kernel/spec-core-fpga.c
View file @
bc13ae65
...
...
@@ -9,6 +9,7 @@
#include <linux/ioport.h>
#include <linux/gpio/consumer.h>
#include <linux/irqdomain.h>
#include <linux/dmaengine.h>
#include <linux/mfd/core.h>
#include <linux/spi/spi.h>
#include <linux/spi/flash.h>
...
...
@@ -767,11 +768,28 @@ static int spec_fpga_app_init_res_irq(struct spec_fpga *spec_fpga,
return
0
;
}
static
void
spec_fpga_app_init_res_dma
(
struct
spec_fpga
*
spec_fpga
,
struct
resource
*
res
)
{
struct
dma_device
*
dma
=
platform_get_drvdata
(
spec_fpga
->
dma_pdev
);
res
->
name
=
"app-dma"
;
res
->
flags
=
IORESOURCE_DMA
;
if
(
dma
)
{
res
->
start
=
0
;
res
->
start
|=
dma
->
dev_id
<<
16
;
}
else
{
dev_warn
(
&
spec_fpga
->
dev
,
"Not able to find DMA engine
\n
"
);
res
->
start
=
-
1
;
}
}
#define SPEC_FPGA_APP_NAME_MAX 47
#define SPEC_FPGA_APP_IRQ_BASE 6
#define SPEC_FPGA_APP_RES_IRQ_START
1
#define SPEC_FPGA_APP_RES_N (32 - SPEC_FPGA_APP_IRQ_BASE + 1
)
#define SPEC_FPGA_APP_RES_IRQ_START
2
#define SPEC_FPGA_APP_RES_N (32 - SPEC_FPGA_APP_IRQ_BASE + 1
+ 1)
/* IRQs MEM DMA */
#define SPEC_FPGA_APP_RES_MEM 0
#define SPEC_FPGA_APP_RES_DMA 1
static
int
spec_fpga_app_init
(
struct
spec_fpga
*
spec_fpga
)
{
unsigned
int
res_n
=
SPEC_FPGA_APP_RES_N
;
...
...
@@ -792,6 +810,7 @@ static int spec_fpga_app_init(struct spec_fpga *spec_fpga)
err
=
0
;
goto
err_free
;
}
spec_fpga_app_init_res_dma
(
spec_fpga
,
&
res
[
SPEC_FPGA_APP_RES_DMA
]);
err
=
spec_fpga_app_init_res_irq
(
spec_fpga
,
SPEC_FPGA_APP_IRQ_BASE
,
&
res
[
SPEC_FPGA_APP_RES_IRQ_START
],
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment