Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
cloud-kernel
提交
76891cc8
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看板
提交
76891cc8
编写于
8月 23, 2015
作者:
V
Vinod Koul
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'topic/ti-xbar' into for-linus
上级
59b0fbdf
28eb232f
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
31 addition
and
10 deletion
+31
-10
drivers/dma/ti-dma-crossbar.c
drivers/dma/ti-dma-crossbar.c
+31
-10
未找到文件。
drivers/dma/ti-dma-crossbar.c
浏览文件 @
76891cc8
...
...
@@ -20,16 +20,19 @@
#define TI_XBAR_OUTPUTS 127
#define TI_XBAR_INPUTS 256
static
DEFINE_IDR
(
map_idr
);
#define TI_XBAR_EDMA_OFFSET 0
#define TI_XBAR_SDMA_OFFSET 1
struct
ti_dma_xbar_data
{
void
__iomem
*
iomem
;
struct
dma_router
dmarouter
;
struct
idr
map_idr
;
u16
safe_val
;
/* Value to rest the crossbar lines */
u32
xbar_requests
;
/* number of DMA requests connected to XBAR */
u32
dma_requests
;
/* number of DMA requests forwarded to DMA */
u32
dma_offset
;
};
struct
ti_dma_xbar_map
{
...
...
@@ -51,7 +54,7 @@ static void ti_dma_xbar_free(struct device *dev, void *route_data)
map
->
xbar_in
,
map
->
xbar_out
);
ti_dma_xbar_write
(
xbar
->
iomem
,
map
->
xbar_out
,
xbar
->
safe_val
);
idr_remove
(
&
map_idr
,
map
->
xbar_out
);
idr_remove
(
&
xbar
->
map_idr
,
map
->
xbar_out
);
kfree
(
map
);
}
...
...
@@ -81,12 +84,11 @@ static void *ti_dma_xbar_route_allocate(struct of_phandle_args *dma_spec,
return
ERR_PTR
(
-
ENOMEM
);
}
map
->
xbar_out
=
idr_alloc
(
&
map_idr
,
NULL
,
0
,
xbar
->
dma_requests
,
map
->
xbar_out
=
idr_alloc
(
&
xbar
->
map_idr
,
NULL
,
0
,
xbar
->
dma_requests
,
GFP_KERNEL
);
map
->
xbar_in
=
(
u16
)
dma_spec
->
args
[
0
];
/* The DMA request is 1 based in sDMA */
dma_spec
->
args
[
0
]
=
map
->
xbar_out
+
1
;
dma_spec
->
args
[
0
]
=
map
->
xbar_out
+
xbar
->
dma_offset
;
dev_dbg
(
&
pdev
->
dev
,
"Mapping XBAR%u to DMA%d
\n
"
,
map
->
xbar_in
,
map
->
xbar_out
);
...
...
@@ -96,9 +98,22 @@ static void *ti_dma_xbar_route_allocate(struct of_phandle_args *dma_spec,
return
map
;
}
static
const
struct
of_device_id
ti_dma_master_match
[]
=
{
{
.
compatible
=
"ti,omap4430-sdma"
,
.
data
=
(
void
*
)
TI_XBAR_SDMA_OFFSET
,
},
{
.
compatible
=
"ti,edma3"
,
.
data
=
(
void
*
)
TI_XBAR_EDMA_OFFSET
,
},
{},
};
static
int
ti_dma_xbar_probe
(
struct
platform_device
*
pdev
)
{
struct
device_node
*
node
=
pdev
->
dev
.
of_node
;
const
struct
of_device_id
*
match
;
struct
device_node
*
dma_node
;
struct
ti_dma_xbar_data
*
xbar
;
struct
resource
*
res
;
...
...
@@ -113,12 +128,20 @@ static int ti_dma_xbar_probe(struct platform_device *pdev)
if
(
!
xbar
)
return
-
ENOMEM
;
idr_init
(
&
xbar
->
map_idr
);
dma_node
=
of_parse_phandle
(
node
,
"dma-masters"
,
0
);
if
(
!
dma_node
)
{
dev_err
(
&
pdev
->
dev
,
"Can't get DMA master node
\n
"
);
return
-
ENODEV
;
}
match
=
of_match_node
(
ti_dma_master_match
,
dma_node
);
if
(
!
match
)
{
dev_err
(
&
pdev
->
dev
,
"DMA master is not supported
\n
"
);
return
-
EINVAL
;
}
if
(
of_property_read_u32
(
dma_node
,
"dma-requests"
,
&
xbar
->
dma_requests
))
{
dev_info
(
&
pdev
->
dev
,
...
...
@@ -139,17 +162,15 @@ static int ti_dma_xbar_probe(struct platform_device *pdev)
xbar
->
safe_val
=
(
u16
)
safe_val
;
res
=
platform_get_resource
(
pdev
,
IORESOURCE_MEM
,
0
);
if
(
!
res
)
return
-
ENODEV
;
iomem
=
devm_ioremap_resource
(
&
pdev
->
dev
,
res
);
if
(
!
iomem
)
return
-
ENOMEM
;
if
(
IS_ERR
(
iomem
)
)
return
PTR_ERR
(
iomem
)
;
xbar
->
iomem
=
iomem
;
xbar
->
dmarouter
.
dev
=
&
pdev
->
dev
;
xbar
->
dmarouter
.
route_free
=
ti_dma_xbar_free
;
xbar
->
dma_offset
=
(
u32
)
match
->
data
;
platform_set_drvdata
(
pdev
,
xbar
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录