Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
cloud-kernel
提交
bcb4b619
cloud-kernel
项目概览
openanolis
/
cloud-kernel
大约 2 年 前同步成功
通知
173
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看板
提交
bcb4b619
编写于
12月 10, 2015
作者:
V
Vinod Koul
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'fix/edma' into fixes
上级
e958e079
ae0add74
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
40 addition
and
25 deletion
+40
-25
Documentation/devicetree/bindings/dma/ti-edma.txt
Documentation/devicetree/bindings/dma/ti-edma.txt
+4
-6
drivers/dma/edma.c
drivers/dma/edma.c
+35
-18
include/linux/platform_data/edma.h
include/linux/platform_data/edma.h
+1
-1
未找到文件。
Documentation/devicetree/bindings/dma/ti-edma.txt
浏览文件 @
bcb4b619
...
@@ -22,8 +22,7 @@ Required properties:
...
@@ -22,8 +22,7 @@ Required properties:
Optional properties:
Optional properties:
- ti,hwmods: Name of the hwmods associated to the eDMA CC
- ti,hwmods: Name of the hwmods associated to the eDMA CC
- ti,edma-memcpy-channels: List of channels allocated to be used for memcpy, iow
- ti,edma-memcpy-channels: List of channels allocated to be used for memcpy, iow
these channels will be SW triggered channels. The list must
these channels will be SW triggered channels. See example.
contain 16 bits numbers, see example.
- ti,edma-reserved-slot-ranges: PaRAM slot ranges which should not be used by
- ti,edma-reserved-slot-ranges: PaRAM slot ranges which should not be used by
the driver, they are allocated to be used by for example the
the driver, they are allocated to be used by for example the
DSP. See example.
DSP. See example.
...
@@ -56,10 +55,9 @@ edma: edma@49000000 {
...
@@ -56,10 +55,9 @@ edma: edma@49000000 {
ti,tptcs = <&edma_tptc0 7>, <&edma_tptc1 7>, <&edma_tptc2 0>;
ti,tptcs = <&edma_tptc0 7>, <&edma_tptc1 7>, <&edma_tptc2 0>;
/* Channel 20 and 21 is allocated for memcpy */
/* Channel 20 and 21 is allocated for memcpy */
ti,edma-memcpy-channels = /bits/ 16 <20 21>;
ti,edma-memcpy-channels = <20 21>;
/* The following PaRAM slots are reserved: 35-45 and 100-110 */
/* The following PaRAM slots are reserved: 35-44 and 100-109 */
ti,edma-reserved-slot-ranges = /bits/ 16 <35 10>,
ti,edma-reserved-slot-ranges = <35 10>, <100 10>;
/bits/ 16 <100 10>;
};
};
edma_tptc0: tptc@49800000 {
edma_tptc0: tptc@49800000 {
...
...
drivers/dma/edma.c
浏览文件 @
bcb4b619
...
@@ -1752,16 +1752,14 @@ static enum dma_status edma_tx_status(struct dma_chan *chan,
...
@@ -1752,16 +1752,14 @@ static enum dma_status edma_tx_status(struct dma_chan *chan,
return
ret
;
return
ret
;
}
}
static
bool
edma_is_memcpy_channel
(
int
ch_num
,
u16
*
memcpy_channels
)
static
bool
edma_is_memcpy_channel
(
int
ch_num
,
s32
*
memcpy_channels
)
{
{
s16
*
memcpy_ch
=
memcpy_channels
;
if
(
!
memcpy_channels
)
if
(
!
memcpy_channels
)
return
false
;
return
false
;
while
(
*
memcpy_ch
!=
-
1
)
{
while
(
*
memcpy_ch
annels
!=
-
1
)
{
if
(
*
memcpy_ch
==
ch_num
)
if
(
*
memcpy_ch
annels
==
ch_num
)
return
true
;
return
true
;
memcpy_ch
++
;
memcpy_ch
annels
++
;
}
}
return
false
;
return
false
;
}
}
...
@@ -1775,7 +1773,7 @@ static void edma_dma_init(struct edma_cc *ecc, bool legacy_mode)
...
@@ -1775,7 +1773,7 @@ static void edma_dma_init(struct edma_cc *ecc, bool legacy_mode)
{
{
struct
dma_device
*
s_ddev
=
&
ecc
->
dma_slave
;
struct
dma_device
*
s_ddev
=
&
ecc
->
dma_slave
;
struct
dma_device
*
m_ddev
=
NULL
;
struct
dma_device
*
m_ddev
=
NULL
;
s
16
*
memcpy_channels
=
ecc
->
info
->
memcpy_channels
;
s
32
*
memcpy_channels
=
ecc
->
info
->
memcpy_channels
;
int
i
,
j
;
int
i
,
j
;
dma_cap_zero
(
s_ddev
->
cap_mask
);
dma_cap_zero
(
s_ddev
->
cap_mask
);
...
@@ -1996,16 +1994,16 @@ static struct edma_soc_info *edma_setup_info_from_dt(struct device *dev,
...
@@ -1996,16 +1994,16 @@ static struct edma_soc_info *edma_setup_info_from_dt(struct device *dev,
prop
=
of_find_property
(
dev
->
of_node
,
"ti,edma-memcpy-channels"
,
&
sz
);
prop
=
of_find_property
(
dev
->
of_node
,
"ti,edma-memcpy-channels"
,
&
sz
);
if
(
prop
)
{
if
(
prop
)
{
const
char
pname
[]
=
"ti,edma-memcpy-channels"
;
const
char
pname
[]
=
"ti,edma-memcpy-channels"
;
size_t
nelm
=
sz
/
sizeof
(
s
16
);
size_t
nelm
=
sz
/
sizeof
(
s
32
);
s
16
*
memcpy_ch
;
s
32
*
memcpy_ch
;
memcpy_ch
=
devm_kcalloc
(
dev
,
nelm
+
1
,
sizeof
(
s
16
),
memcpy_ch
=
devm_kcalloc
(
dev
,
nelm
+
1
,
sizeof
(
s
32
),
GFP_KERNEL
);
GFP_KERNEL
);
if
(
!
memcpy_ch
)
if
(
!
memcpy_ch
)
return
ERR_PTR
(
-
ENOMEM
);
return
ERR_PTR
(
-
ENOMEM
);
ret
=
of_property_read_u
16
_array
(
dev
->
of_node
,
pname
,
ret
=
of_property_read_u
32
_array
(
dev
->
of_node
,
pname
,
(
u
16
*
)
memcpy_ch
,
nelm
);
(
u
32
*
)
memcpy_ch
,
nelm
);
if
(
ret
)
if
(
ret
)
return
ERR_PTR
(
ret
);
return
ERR_PTR
(
ret
);
...
@@ -2017,31 +2015,50 @@ static struct edma_soc_info *edma_setup_info_from_dt(struct device *dev,
...
@@ -2017,31 +2015,50 @@ static struct edma_soc_info *edma_setup_info_from_dt(struct device *dev,
&
sz
);
&
sz
);
if
(
prop
)
{
if
(
prop
)
{
const
char
pname
[]
=
"ti,edma-reserved-slot-ranges"
;
const
char
pname
[]
=
"ti,edma-reserved-slot-ranges"
;
u32
(
*
tmp
)[
2
];
s16
(
*
rsv_slots
)[
2
];
s16
(
*
rsv_slots
)[
2
];
size_t
nelm
=
sz
/
sizeof
(
*
rsv_slots
);
size_t
nelm
=
sz
/
sizeof
(
*
tmp
);
struct
edma_rsv_info
*
rsv_info
;
struct
edma_rsv_info
*
rsv_info
;
int
i
;
if
(
!
nelm
)
if
(
!
nelm
)
return
info
;
return
info
;
tmp
=
kcalloc
(
nelm
,
sizeof
(
*
tmp
),
GFP_KERNEL
);
if
(
!
tmp
)
return
ERR_PTR
(
-
ENOMEM
);
rsv_info
=
devm_kzalloc
(
dev
,
sizeof
(
*
rsv_info
),
GFP_KERNEL
);
rsv_info
=
devm_kzalloc
(
dev
,
sizeof
(
*
rsv_info
),
GFP_KERNEL
);
if
(
!
rsv_info
)
if
(
!
rsv_info
)
{
kfree
(
tmp
);
return
ERR_PTR
(
-
ENOMEM
);
return
ERR_PTR
(
-
ENOMEM
);
}
rsv_slots
=
devm_kcalloc
(
dev
,
nelm
+
1
,
sizeof
(
*
rsv_slots
),
rsv_slots
=
devm_kcalloc
(
dev
,
nelm
+
1
,
sizeof
(
*
rsv_slots
),
GFP_KERNEL
);
GFP_KERNEL
);
if
(
!
rsv_slots
)
if
(
!
rsv_slots
)
{
kfree
(
tmp
);
return
ERR_PTR
(
-
ENOMEM
);
return
ERR_PTR
(
-
ENOMEM
);
}
ret
=
of_property_read_u16_array
(
dev
->
of_node
,
pname
,
ret
=
of_property_read_u32_array
(
dev
->
of_node
,
pname
,
(
u16
*
)
rsv_slots
,
nelm
*
2
);
(
u32
*
)
tmp
,
nelm
*
2
);
if
(
ret
)
if
(
ret
)
{
kfree
(
tmp
);
return
ERR_PTR
(
ret
);
return
ERR_PTR
(
ret
);
}
for
(
i
=
0
;
i
<
nelm
;
i
++
)
{
rsv_slots
[
i
][
0
]
=
tmp
[
i
][
0
];
rsv_slots
[
i
][
1
]
=
tmp
[
i
][
1
];
}
rsv_slots
[
nelm
][
0
]
=
-
1
;
rsv_slots
[
nelm
][
0
]
=
-
1
;
rsv_slots
[
nelm
][
1
]
=
-
1
;
rsv_slots
[
nelm
][
1
]
=
-
1
;
info
->
rsv
=
rsv_info
;
info
->
rsv
=
rsv_info
;
info
->
rsv
->
rsv_slots
=
(
const
s16
(
*
)[
2
])
rsv_slots
;
info
->
rsv
->
rsv_slots
=
(
const
s16
(
*
)[
2
])
rsv_slots
;
kfree
(
tmp
);
}
}
return
info
;
return
info
;
...
...
include/linux/platform_data/edma.h
浏览文件 @
bcb4b619
...
@@ -72,7 +72,7 @@ struct edma_soc_info {
...
@@ -72,7 +72,7 @@ struct edma_soc_info {
struct
edma_rsv_info
*
rsv
;
struct
edma_rsv_info
*
rsv
;
/* List of channels allocated for memcpy, terminated with -1 */
/* List of channels allocated for memcpy, terminated with -1 */
s
16
*
memcpy_channels
;
s
32
*
memcpy_channels
;
s8
(
*
queue_priority_mapping
)[
2
];
s8
(
*
queue_priority_mapping
)[
2
];
const
s16
(
*
xbar_chans
)[
2
];
const
s16
(
*
xbar_chans
)[
2
];
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录