Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
kernel_linux
提交
185a6cdb
K
kernel_linux
项目概览
OpenHarmony
/
kernel_linux
上一次同步 4 年多
通知
15
Star
8
Fork
2
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
K
kernel_linux
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
185a6cdb
编写于
4月 10, 2018
作者:
V
Vinod Koul
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'topic/qcom' into for-linus
上级
f18b4619
5b4a6895
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
49 addition
and
14 deletion
+49
-14
Documentation/devicetree/bindings/dma/qcom_bam_dma.txt
Documentation/devicetree/bindings/dma/qcom_bam_dma.txt
+4
-0
drivers/dma/qcom/bam_dma.c
drivers/dma/qcom/bam_dma.c
+45
-14
未找到文件。
Documentation/devicetree/bindings/dma/qcom_bam_dma.txt
浏览文件 @
185a6cdb
...
...
@@ -15,6 +15,10 @@ Required properties:
the secure world.
- qcom,controlled-remotely : optional, indicates that the bam is controlled by
remote proccessor i.e. execution environment.
- num-channels : optional, indicates supported number of DMA channels in a
remotely controlled bam.
- qcom,num-ees : optional, indicates supported number of Execution Environments
in a remotely controlled bam.
Example:
...
...
drivers/dma/qcom/bam_dma.c
浏览文件 @
185a6cdb
...
...
@@ -393,6 +393,7 @@ struct bam_device {
struct
device_dma_parameters
dma_parms
;
struct
bam_chan
*
channels
;
u32
num_channels
;
u32
num_ees
;
/* execution environment ID, from DT */
u32
ee
;
...
...
@@ -934,12 +935,15 @@ static void bam_apply_new_config(struct bam_chan *bchan,
struct
bam_device
*
bdev
=
bchan
->
bdev
;
u32
maxburst
;
if
(
dir
==
DMA_DEV_TO_MEM
)
maxburst
=
bchan
->
slave
.
src_maxburst
;
else
maxburst
=
bchan
->
slave
.
dst_maxburst
;
if
(
!
bdev
->
controlled_remotely
)
{
if
(
dir
==
DMA_DEV_TO_MEM
)
maxburst
=
bchan
->
slave
.
src_maxburst
;
else
maxburst
=
bchan
->
slave
.
dst_maxburst
;
writel_relaxed
(
maxburst
,
bam_addr
(
bdev
,
0
,
BAM_DESC_CNT_TRSHLD
));
writel_relaxed
(
maxburst
,
bam_addr
(
bdev
,
0
,
BAM_DESC_CNT_TRSHLD
));
}
bchan
->
reconfigure
=
0
;
}
...
...
@@ -1128,15 +1132,19 @@ static int bam_init(struct bam_device *bdev)
u32
val
;
/* read revision and configuration information */
val
=
readl_relaxed
(
bam_addr
(
bdev
,
0
,
BAM_REVISION
))
>>
NUM_EES_SHIFT
;
val
&=
NUM_EES_MASK
;
if
(
!
bdev
->
num_ees
)
{
val
=
readl_relaxed
(
bam_addr
(
bdev
,
0
,
BAM_REVISION
));
bdev
->
num_ees
=
(
val
>>
NUM_EES_SHIFT
)
&
NUM_EES_MASK
;
}
/* check that configured EE is within range */
if
(
bdev
->
ee
>=
val
)
if
(
bdev
->
ee
>=
bdev
->
num_ees
)
return
-
EINVAL
;
val
=
readl_relaxed
(
bam_addr
(
bdev
,
0
,
BAM_NUM_PIPES
));
bdev
->
num_channels
=
val
&
BAM_NUM_PIPES_MASK
;
if
(
!
bdev
->
num_channels
)
{
val
=
readl_relaxed
(
bam_addr
(
bdev
,
0
,
BAM_NUM_PIPES
));
bdev
->
num_channels
=
val
&
BAM_NUM_PIPES_MASK
;
}
if
(
bdev
->
controlled_remotely
)
return
0
;
...
...
@@ -1232,9 +1240,25 @@ static int bam_dma_probe(struct platform_device *pdev)
bdev
->
controlled_remotely
=
of_property_read_bool
(
pdev
->
dev
.
of_node
,
"qcom,controlled-remotely"
);
if
(
bdev
->
controlled_remotely
)
{
ret
=
of_property_read_u32
(
pdev
->
dev
.
of_node
,
"num-channels"
,
&
bdev
->
num_channels
);
if
(
ret
)
dev_err
(
bdev
->
dev
,
"num-channels unspecified in dt
\n
"
);
ret
=
of_property_read_u32
(
pdev
->
dev
.
of_node
,
"qcom,num-ees"
,
&
bdev
->
num_ees
);
if
(
ret
)
dev_err
(
bdev
->
dev
,
"num-ees unspecified in dt
\n
"
);
}
bdev
->
bamclk
=
devm_clk_get
(
bdev
->
dev
,
"bam_clk"
);
if
(
IS_ERR
(
bdev
->
bamclk
))
return
PTR_ERR
(
bdev
->
bamclk
);
if
(
IS_ERR
(
bdev
->
bamclk
))
{
if
(
!
bdev
->
controlled_remotely
)
return
PTR_ERR
(
bdev
->
bamclk
);
bdev
->
bamclk
=
NULL
;
}
ret
=
clk_prepare_enable
(
bdev
->
bamclk
);
if
(
ret
)
{
...
...
@@ -1309,6 +1333,11 @@ static int bam_dma_probe(struct platform_device *pdev)
if
(
ret
)
goto
err_unregister_dma
;
if
(
bdev
->
controlled_remotely
)
{
pm_runtime_disable
(
&
pdev
->
dev
);
return
0
;
}
pm_runtime_irq_safe
(
&
pdev
->
dev
);
pm_runtime_set_autosuspend_delay
(
&
pdev
->
dev
,
BAM_DMA_AUTOSUSPEND_DELAY
);
pm_runtime_use_autosuspend
(
&
pdev
->
dev
);
...
...
@@ -1392,7 +1421,8 @@ static int __maybe_unused bam_dma_suspend(struct device *dev)
{
struct
bam_device
*
bdev
=
dev_get_drvdata
(
dev
);
pm_runtime_force_suspend
(
dev
);
if
(
!
bdev
->
controlled_remotely
)
pm_runtime_force_suspend
(
dev
);
clk_unprepare
(
bdev
->
bamclk
);
...
...
@@ -1408,7 +1438,8 @@ static int __maybe_unused bam_dma_resume(struct device *dev)
if
(
ret
)
return
ret
;
pm_runtime_force_resume
(
dev
);
if
(
!
bdev
->
controlled_remotely
)
pm_runtime_force_resume
(
dev
);
return
0
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录