Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
F
FMC TDC 1ns 5cha - Software
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
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
FMC TDC 1ns 5cha - Software
Commits
00e7a3c3
Commit
00e7a3c3
authored
Sep 04, 2012
by
Samuel Iglesias Gonsálvez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tdc: check DMA status register
Signed-off-by:
Samuel Iglesias Gonsálvez
<
siglesias@igalia.com
>
parent
69f622d3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
4 deletions
+14
-4
tdc_regs.h
hw/tdc_regs.h
+6
-0
tdc-fmc.c
tdc-fmc.c
+8
-4
No files found.
hw/tdc_regs.h
View file @
00e7a3c3
...
...
@@ -28,6 +28,12 @@
#define TDC_DMA_NEXT_H_R 0x1C
#define TDC_DMA_ATTRIB_R 0x20
#define TDC_DMA_STAT_IDLE BIT(0)
#define TDC_DMA_STAT_DONE BIT(1)
#define TDC_DMA_STAT_BUSY BIT(2)
#define TDC_DMA_STAT_ERR BIT(3)
#define TDC_DMA_STAT_ABORT BIT(4)
/* ACAM GPX chip registers available */
#define TDC_ACAM_CFG_REG_0 0x20000
#define TDC_ACAM_CFG_REG_1 0x20004
...
...
tdc-fmc.c
View file @
00e7a3c3
...
...
@@ -114,8 +114,12 @@ static void tdc_fmc_irq_work(struct work_struct *work)
wait_event
(
fmc_wait_dma
,
atomic_read
(
&
fmc_dma_end
));
/* DMA happened */
/* TODO: Check DMASTATR register to see if there was an error */
atomic_set
(
&
fmc_dma_end
,
0
);
/* Check the status of the DMA */
if
(
readl
(
tdc
->
base
+
TDC_DMA_STAT_R
)
&
(
TDC_DMA_STAT_ERR
|
TDC_DMA_STAT_ABORT
))
goto
dma_out
;
tdc
->
wr_pointer
=
curr_wr_ptr
;
/* Process the data */
...
...
@@ -223,9 +227,9 @@ int tdc_fmc_probe(struct fmc_device *dev)
/* XXX: Not implemented yet. Do we needed it? */
#if 0
/* Check if the device is DMA capable on 32 bits. */
if (pci_set_dma_mask(spec->pdev, DMA_BIT_MASK(
32)) < 0 ||
pci_set_consistent_dma_mask(spec->pdev, DMA_BIT_MASK(32)) < 0) {
pr_err("error setting 32-bit DMA mask.\n"
);
if (pci_set_dma_mask(spec->pdev, DMA_BIT_MASK(
64)) < 0) {
pr_err("error setting 64-bit DMA mask.\n");
kfree(tdc
);
return -ENXIO;
}
#endif
...
...
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