Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
tapasco
tapasco
Commits
0e6426c0
Commit
0e6426c0
authored
Jul 19, 2017
by
Jaco Hofmann
Browse files
Move dma_mask selection to pcie_device
(cherry picked from commit
451e93e3
)
parent
e9cffe94
Changes
2
Hide whitespace changes
Inline
Side-by-side
platform/vc709/module/char_device_dma.c
View file @
0e6426c0
...
...
@@ -300,18 +300,6 @@ static int dma_initialize(void) {
fflink_notice
(
"Initializing private data"
);
dma_init_pdata
(
&
priv_data
);
dma_set_mask_and_coherent
(
&
get_pcie_dev
()
->
dev
,
DMA_BIT_MASK
(
DMA_MAX_BIT
));
/* get buffers for dma, this could possibly go wrong */
if
(
DMA_MAX_BIT
==
32
)
{
zone
=
GFP_DMA32
;
}
else
if
(
DMA_MAX_BIT
==
64
)
{
zone
=
GFP_DMA32
;
}
else
{
fflink_warn
(
"Wrong bit mask setting - only 32/64 supported, but have %d
\n
"
,
DMA_MAX_BIT
);
err_return
=
-
EFAULT
;
goto
open_failed
;
}
err_1
=
dma_alloc_pbufs
(
&
priv_data
.
kvirt_h2l
,
&
priv_data
.
dma_handle_h2l
,
zone
,
PCI_DMA_TODEVICE
);
err_2
=
dma_alloc_pbufs
(
&
priv_data
.
kvirt_l2h
,
&
priv_data
.
dma_handle_l2h
,
zone
,
PCI_DMA_FROMDEVICE
);
...
...
platform/vc709/module/pcie_device.c
View file @
0e6426c0
...
...
@@ -95,8 +95,23 @@ error_pci_en:
* */
static
int
configure_device
(
struct
pci_dev
*
pdev
)
{
fflink_warn
(
"Settings of MPS: %d and Maximum Read Request %d
\n
"
,
pcie_get_mps
(
pdev
),
pcie_get_readrq
(
pdev
));
fflink_info
(
"Settings of MPS: %d and Maximum Read Request %d
\n
"
,
pcie_get_mps
(
pdev
),
pcie_get_readrq
(
pdev
));
if
(
!
dma_set_mask
(
&
pdev
->
dev
,
DMA_BIT_MASK
(
64
)))
{
fflink_info
(
"dma_set_mask: Using 64 bit dma addresses
\n
"
);
dma_set_coherent_mask
(
&
pdev
->
dev
,
DMA_BIT_MASK
(
64
));
}
else
if
(
!
dma_set_mask
(
&
pdev
->
dev
,
DMA_BIT_MASK
(
32
)))
{
fflink_info
(
"dma_set_mask: Using 32 bit dma addresses
\n
"
);
dma_set_coherent_mask
(
&
pdev
->
dev
,
DMA_BIT_MASK
(
32
));
}
else
{
fflink_warn
(
"No suitable dma available
\n
"
);
goto
mask_error
;
}
return
0
;
mask_error:
return
-
ENODEV
;
}
/**
* @brief Register specific function with msi interrupt line
...
...
Write
Preview
Supports
Markdown
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