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
ae47b9d7
Commit
ae47b9d7
authored
Jul 18, 2019
by
Federico Vaga
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sw:drv: prepare code to load DMA engine
Signed-off-by:
Federico Vaga
<
federico.vaga@cern.ch
>
parent
8dd2efb8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
0 deletions
+32
-0
spec-core-fpga.c
software/kernel/spec-core-fpga.c
+32
-0
No files found.
software/kernel/spec-core-fpga.c
View file @
ae47b9d7
...
...
@@ -55,6 +55,10 @@ enum spec_fpga_csr_offsets {
SPEC_FPGA_CSR_PCB_REV
=
SPEC_FPGA_MEM_CSR_START
+
0x14
,
};
enum
spec_fpga_csr_fields
{
SPEC_FPGA_CSR_DDR_STATUS_DONE
=
0x1
,
};
enum
spec_fpga_therm_offsets
{
SPEC_FPGA_THERM_SERID_MSB
=
SPEC_FPGA_MEM_THERM_START
+
0x0
,
SPEC_FPGA_THERM_SERID_LSB
=
SPEC_FPGA_MEM_THERM_START
+
0x4
,
...
...
@@ -253,6 +257,28 @@ static void spec_fpga_vic_exit(struct spec_fpga *spec_fpga)
}
}
/* DMA engine */
static
int
spec_fpga_dma_init
(
struct
spec_fpga
*
spec_fpga
)
{
uint32_t
ddr_status
;
if
(
!
(
spec_fpga
->
meta
->
cap
&
SPEC_META_CAP_DMA
))
return
0
;
ddr_status
=
ioread32
(
spec_fpga
->
fpga
+
SPEC_FPGA_CSR_DDR_STATUS
);
if
(
!
(
ddr_status
&
SPEC_FPGA_CSR_DDR_STATUS_DONE
))
{
dev_err
(
&
spec_fpga
->
dev
,
"Failed to load DMA engine: DDR controller not calibrated.
\n
"
);
return
-
ENODEV
;
}
return
0
;
}
static
void
spec_fpga_dma_exit
(
struct
spec_fpga
*
spec_fpga
)
{
}
/* MFD devices */
enum
spec_fpga_mfd_devs_enum
{
SPEC_FPGA_MFD_FMC_I2C
=
0
,
...
...
@@ -818,6 +844,9 @@ int spec_fpga_init(struct spec_gn412x *spec_gn412x)
err
=
spec_fpga_vic_init
(
spec_fpga
);
if
(
err
)
goto
err_vic
;
err
=
spec_fpga_dma_init
(
spec_fpga
);
if
(
err
)
goto
err_dma
;
err
=
spec_fpga_devices_init
(
spec_fpga
);
if
(
err
)
goto
err_devs
;
...
...
@@ -836,6 +865,8 @@ err_app:
err_fmc:
spec_fpga_devices_exit
(
spec_fpga
);
err_devs:
spec_fpga_dma_exit
(
spec_fpga
);
err_dma:
spec_fpga_vic_exit
(
spec_fpga
);
err_vic:
device_unregister
(
&
spec_fpga
->
dev
);
...
...
@@ -860,6 +891,7 @@ int spec_fpga_exit(struct spec_gn412x *spec_gn412x)
spec_fpga_app_exit
(
spec_fpga
);
spec_fmc_exit
(
spec_fpga
);
spec_fpga_devices_exit
(
spec_fpga
);
spec_fpga_dma_exit
(
spec_fpga
);
spec_fpga_vic_exit
(
spec_fpga
);
device_unregister
(
&
spec_fpga
->
dev
);
...
...
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