Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
cloud-kernel
提交
f2e3d553
cloud-kernel
项目概览
openanolis
/
cloud-kernel
1 年多 前同步成功
通知
160
Star
36
Fork
7
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
10
列表
看板
标记
里程碑
合并请求
2
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
cloud-kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
10
Issue
10
列表
看板
标记
里程碑
合并请求
2
合并请求
2
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
f2e3d553
编写于
3月 16, 2016
作者:
V
Vineet Gupta
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
ARC: dma: reintroduce platform specific dma<->phys
Signed-off-by:
N
Vineet Gupta
<
vgupta@synopsys.com
>
上级
f5db19e9
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
14 addition
and
5 deletion
+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
未找到文件。
arch/arc/Kconfig
浏览文件 @
f2e3d553
...
@@ -468,6 +468,9 @@ config ARCH_PHYS_ADDR_T_64BIT
...
@@ -468,6 +468,9 @@ config ARCH_PHYS_ADDR_T_64BIT
config ARCH_DMA_ADDR_T_64BIT
config ARCH_DMA_ADDR_T_64BIT
bool
bool
config ARC_PLAT_NEEDS_PHYS_TO_DMA
bool
config ARC_CURR_IN_REG
config ARC_CURR_IN_REG
bool "Dedicate Register r25 for current_task pointer"
bool "Dedicate Register r25 for current_task pointer"
default y
default y
...
...
arch/arc/include/asm/dma-mapping.h
浏览文件 @
f2e3d553
...
@@ -11,6 +11,13 @@
...
@@ -11,6 +11,13 @@
#ifndef ASM_ARC_DMA_MAPPING_H
#ifndef ASM_ARC_DMA_MAPPING_H
#define 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
;
extern
struct
dma_map_ops
arc_dma_ops
;
static
inline
struct
dma_map_ops
*
get_dma_ops
(
struct
device
*
dev
)
static
inline
struct
dma_map_ops
*
get_dma_ops
(
struct
device
*
dev
)
...
...
arch/arc/mm/dma.c
浏览文件 @
f2e3d553
...
@@ -60,8 +60,7 @@ static void *arc_dma_alloc(struct device *dev, size_t size,
...
@@ -60,8 +60,7 @@ static void *arc_dma_alloc(struct device *dev, size_t size,
/* This is linear addr (0x8000_0000 based) */
/* This is linear addr (0x8000_0000 based) */
paddr
=
page_to_phys
(
page
);
paddr
=
page_to_phys
(
page
);
/* For now bus address is exactly same as paddr */
*
dma_handle
=
plat_phys_to_dma
(
dev
,
paddr
);
*
dma_handle
=
paddr
;
/* This is kernel Virtual address (0x7000_0000 based) */
/* This is kernel Virtual address (0x7000_0000 based) */
if
(
need_kvaddr
)
{
if
(
need_kvaddr
)
{
...
@@ -134,7 +133,7 @@ static dma_addr_t arc_dma_map_page(struct device *dev, struct page *page,
...
@@ -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
;
phys_addr_t
paddr
=
page_to_phys
(
page
)
+
offset
;
_dma_cache_sync
(
paddr
,
size
,
dir
);
_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
,
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,
...
@@ -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
,
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_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
,
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_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
,
static
void
arc_dma_sync_sg_for_cpu
(
struct
device
*
dev
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录