Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
f2e3d553
Commit
f2e3d553
authored
Mar 16, 2016
by
Vineet Gupta
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ARC: dma: reintroduce platform specific dma<->phys
Signed-off-by:
Vineet Gupta
<
vgupta@synopsys.com
>
parent
f5db19e9
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
5 deletions
+14
-5
arch/arc/Kconfig
arch/arc/Kconfig
+3
-0
arch/arc/include/asm/dma-mapping.h
arch/arc/include/asm/dma-mapping.h
+7
-0
arch/arc/mm/dma.c
arch/arc/mm/dma.c
+4
-5
No files found.
arch/arc/Kconfig
View file @
f2e3d553
...
...
@@ -468,6 +468,9 @@ config ARCH_PHYS_ADDR_T_64BIT
config ARCH_DMA_ADDR_T_64BIT
bool
config ARC_PLAT_NEEDS_PHYS_TO_DMA
bool
config ARC_CURR_IN_REG
bool "Dedicate Register r25 for current_task pointer"
default y
...
...
arch/arc/include/asm/dma-mapping.h
View file @
f2e3d553
...
...
@@ -11,6 +11,13 @@
#ifndef ASM_ARC_DMA_MAPPING_H
#define ASM_ARC_DMA_MAPPING_H
#ifndef CONFIG_ARC_PLAT_NEEDS_PHYS_TO_DMA
#define plat_dma_to_phys(dev, dma_handle) ((phys_addr_t)(dma_handle))
#define plat_phys_to_dma(dev, paddr) ((dma_addr_t)(paddr))
#else
#include <plat/dma.h>
#endif
extern
struct
dma_map_ops
arc_dma_ops
;
static
inline
struct
dma_map_ops
*
get_dma_ops
(
struct
device
*
dev
)
...
...
arch/arc/mm/dma.c
View file @
f2e3d553
...
...
@@ -60,8 +60,7 @@ static void *arc_dma_alloc(struct device *dev, size_t size,
/* This is linear addr (0x8000_0000 based) */
paddr
=
page_to_phys
(
page
);
/* For now bus address is exactly same as paddr */
*
dma_handle
=
paddr
;
*
dma_handle
=
plat_phys_to_dma
(
dev
,
paddr
);
/* This is kernel Virtual address (0x7000_0000 based) */
if
(
need_kvaddr
)
{
...
...
@@ -134,7 +133,7 @@ static dma_addr_t arc_dma_map_page(struct device *dev, struct page *page,
{
phys_addr_t
paddr
=
page_to_phys
(
page
)
+
offset
;
_dma_cache_sync
(
paddr
,
size
,
dir
);
return
(
dma_addr_t
)
paddr
;
return
plat_phys_to_dma
(
dev
,
paddr
)
;
}
static
int
arc_dma_map_sg
(
struct
device
*
dev
,
struct
scatterlist
*
sg
,
...
...
@@ -153,13 +152,13 @@ static int arc_dma_map_sg(struct device *dev, struct scatterlist *sg,
static
void
arc_dma_sync_single_for_cpu
(
struct
device
*
dev
,
dma_addr_t
dma_handle
,
size_t
size
,
enum
dma_data_direction
dir
)
{
_dma_cache_sync
(
dma_handle
,
size
,
DMA_FROM_DEVICE
);
_dma_cache_sync
(
plat_dma_to_phys
(
dev
,
dma_handle
)
,
size
,
DMA_FROM_DEVICE
);
}
static
void
arc_dma_sync_single_for_device
(
struct
device
*
dev
,
dma_addr_t
dma_handle
,
size_t
size
,
enum
dma_data_direction
dir
)
{
_dma_cache_sync
(
dma_handle
,
size
,
DMA_TO_DEVICE
);
_dma_cache_sync
(
plat_dma_to_phys
(
dev
,
dma_handle
)
,
size
,
DMA_TO_DEVICE
);
}
static
void
arc_dma_sync_sg_for_cpu
(
struct
device
*
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