Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
Kernel
提交
454bfda9
K
Kernel
项目概览
openeuler
/
Kernel
1 年多 前同步成功
通知
8
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
K
Kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
454bfda9
编写于
4月 16, 2015
作者:
V
Vineet Gupta
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
ARC: remove the unused platform helpers from dma mapping API
Signed-off-by:
N
Vineet Gupta
<
vgupta@synopsys.com
>
上级
7c42eaf6
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
9 addition
and
38 deletion
+9
-38
arch/arc/Kconfig
arch/arc/Kconfig
+0
-4
arch/arc/include/asm/dma-mapping.h
arch/arc/include/asm/dma-mapping.h
+5
-26
arch/arc/mm/dma.c
arch/arc/mm/dma.c
+4
-8
未找到文件。
arch/arc/Kconfig
浏览文件 @
454bfda9
...
...
@@ -117,10 +117,6 @@ config CPU_BIG_ENDIAN
help
Build kernel for Big Endian Mode of ARC CPU
# If a platform can't work with 0x8000_0000 based dma_addr_t
config ARC_PLAT_NEEDS_CPU_TO_DMA
bool
config SMP
bool "Symmetric Multi-Processing (Incomplete)"
default n
...
...
arch/arc/include/asm/dma-mapping.h
浏览文件 @
454bfda9
...
...
@@ -14,23 +14,6 @@
#include <asm-generic/dma-coherent.h>
#include <asm/cacheflush.h>
#ifndef CONFIG_ARC_PLAT_NEEDS_CPU_TO_DMA
/*
* dma_map_* API take cpu addresses, which is kernel logical address in the
* untranslated address space (0x8000_0000) based. The dma address (bus addr)
* ideally needs to be 0x0000_0000 based hence these glue routines.
* However given that intermediate bus bridges can ignore the high bit, we can
* do with these routines being no-ops.
* If a platform/device comes up which sriclty requires 0 based bus addr
* (e.g. AHB-PCI bridge on Angel4 board), then it can provide it's own versions
*/
#define plat_dma_addr_to_kernel(dev, addr) ((unsigned long)(addr))
#define plat_kernel_addr_to_dma(dev, ptr) ((dma_addr_t)(ptr))
#else
#include <plat/dma_addr.h>
#endif
void
*
dma_alloc_noncoherent
(
struct
device
*
dev
,
size_t
size
,
dma_addr_t
*
dma_handle
,
gfp_t
gfp
);
...
...
@@ -94,7 +77,7 @@ dma_map_single(struct device *dev, void *cpu_addr, size_t size,
enum
dma_data_direction
dir
)
{
_dma_cache_sync
((
unsigned
long
)
cpu_addr
,
size
,
dir
);
return
plat_kernel_addr_to_dma
(
dev
,
cpu_addr
)
;
return
(
dma_addr_t
)
cpu_addr
;
}
static
inline
void
...
...
@@ -147,16 +130,14 @@ static inline void
dma_sync_single_for_cpu
(
struct
device
*
dev
,
dma_addr_t
dma_handle
,
size_t
size
,
enum
dma_data_direction
dir
)
{
_dma_cache_sync
(
plat_dma_addr_to_kernel
(
dev
,
dma_handle
),
size
,
DMA_FROM_DEVICE
);
_dma_cache_sync
(
dma_handle
,
size
,
DMA_FROM_DEVICE
);
}
static
inline
void
dma_sync_single_for_device
(
struct
device
*
dev
,
dma_addr_t
dma_handle
,
size_t
size
,
enum
dma_data_direction
dir
)
{
_dma_cache_sync
(
plat_dma_addr_to_kernel
(
dev
,
dma_handle
),
size
,
DMA_TO_DEVICE
);
_dma_cache_sync
(
dma_handle
,
size
,
DMA_TO_DEVICE
);
}
static
inline
void
...
...
@@ -164,8 +145,7 @@ dma_sync_single_range_for_cpu(struct device *dev, dma_addr_t dma_handle,
unsigned
long
offset
,
size_t
size
,
enum
dma_data_direction
direction
)
{
_dma_cache_sync
(
plat_dma_addr_to_kernel
(
dev
,
dma_handle
)
+
offset
,
size
,
DMA_FROM_DEVICE
);
_dma_cache_sync
(
dma_handle
+
offset
,
size
,
DMA_FROM_DEVICE
);
}
static
inline
void
...
...
@@ -173,8 +153,7 @@ dma_sync_single_range_for_device(struct device *dev, dma_addr_t dma_handle,
unsigned
long
offset
,
size_t
size
,
enum
dma_data_direction
direction
)
{
_dma_cache_sync
(
plat_dma_addr_to_kernel
(
dev
,
dma_handle
)
+
offset
,
size
,
DMA_TO_DEVICE
);
_dma_cache_sync
(
dma_handle
+
offset
,
size
,
DMA_TO_DEVICE
);
}
static
inline
void
...
...
arch/arc/mm/dma.c
浏览文件 @
454bfda9
...
...
@@ -14,8 +14,6 @@
* Cache bit off in the TLB entry.
*
* The default DMA address == Phy address which is 0x8000_0000 based.
* A platform/device can make it zero based, by over-riding
* plat_{dma,kernel}_addr_to_{kernel,dma}
*/
#include <linux/dma-mapping.h>
...
...
@@ -37,7 +35,7 @@ void *dma_alloc_noncoherent(struct device *dev, size_t size,
return
NULL
;
/* This is bus address, platform dependent */
*
dma_handle
=
plat_kernel_addr_to_dma
(
dev
,
paddr
)
;
*
dma_handle
=
(
dma_addr_t
)
paddr
;
return
paddr
;
}
...
...
@@ -46,8 +44,7 @@ EXPORT_SYMBOL(dma_alloc_noncoherent);
void
dma_free_noncoherent
(
struct
device
*
dev
,
size_t
size
,
void
*
vaddr
,
dma_addr_t
dma_handle
)
{
free_pages_exact
((
void
*
)
plat_dma_addr_to_kernel
(
dev
,
dma_handle
),
size
);
free_pages_exact
((
void
*
)
dma_handle
,
size
);
}
EXPORT_SYMBOL
(
dma_free_noncoherent
);
...
...
@@ -67,7 +64,7 @@ void *dma_alloc_coherent(struct device *dev, size_t size,
memset
(
kvaddr
,
0
,
size
);
/* This is bus address, platform dependent */
*
dma_handle
=
plat_kernel_addr_to_dma
(
dev
,
paddr
)
;
*
dma_handle
=
(
dma_addr_t
)
paddr
;
return
kvaddr
;
}
...
...
@@ -78,8 +75,7 @@ void dma_free_coherent(struct device *dev, size_t size, void *kvaddr,
{
iounmap
((
void
__force
__iomem
*
)
kvaddr
);
free_pages_exact
((
void
*
)
plat_dma_addr_to_kernel
(
dev
,
dma_handle
),
size
);
free_pages_exact
((
void
*
)
dma_handle
,
size
);
}
EXPORT_SYMBOL
(
dma_free_coherent
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录