Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
raspberrypi-kernel
提交
4c8f8062
R
raspberrypi-kernel
项目概览
openeuler
/
raspberrypi-kernel
通知
13
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
raspberrypi-kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
4c8f8062
编写于
5月 28, 2014
作者:
M
Mike Turquette
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'clk-fixes' into clk-next
上级
b59e8696
51784380
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
46 addition
and
22 deletion
+46
-22
drivers/clk/st/clkgen-pll.c
drivers/clk/st/clkgen-pll.c
+3
-1
drivers/clk/tegra/clk-pll.c
drivers/clk/tegra/clk-pll.c
+43
-21
未找到文件。
drivers/clk/st/clkgen-pll.c
浏览文件 @
4c8f8062
...
...
@@ -521,8 +521,10 @@ static struct clk * __init clkgen_odf_register(const char *parent_name,
gate
->
lock
=
odf_lock
;
div
=
kzalloc
(
sizeof
(
*
div
),
GFP_KERNEL
);
if
(
!
div
)
if
(
!
div
)
{
kfree
(
gate
);
return
ERR_PTR
(
-
ENOMEM
);
}
div
->
flags
=
CLK_DIVIDER_ONE_BASED
|
CLK_DIVIDER_ALLOW_ZERO
;
div
->
reg
=
reg
+
pll_data
->
odf
[
odf
].
offset
;
...
...
drivers/clk/tegra/clk-pll.c
浏览文件 @
4c8f8062
...
...
@@ -58,9 +58,9 @@
#define PLLDU_LFCON_SET_DIVN 600
#define PLLE_BASE_DIVCML_SHIFT 24
#define PLLE_BASE_DIVCML_
WIDTH 4
#define PLLE_BASE_DIVCML_
MASK 0xf
#define PLLE_BASE_DIVP_SHIFT 16
#define PLLE_BASE_DIVP_WIDTH
7
#define PLLE_BASE_DIVP_WIDTH
6
#define PLLE_BASE_DIVN_SHIFT 8
#define PLLE_BASE_DIVN_WIDTH 8
#define PLLE_BASE_DIVM_SHIFT 0
...
...
@@ -193,6 +193,14 @@
#define divp_mask(p) (p->params->flags & TEGRA_PLLU ? PLLU_POST_DIVP_MASK :\
mask(p->params->div_nmp->divp_width))
#define divm_shift(p) (p)->params->div_nmp->divm_shift
#define divn_shift(p) (p)->params->div_nmp->divn_shift
#define divp_shift(p) (p)->params->div_nmp->divp_shift
#define divm_mask_shifted(p) (divm_mask(p) << divm_shift(p))
#define divn_mask_shifted(p) (divn_mask(p) << divn_shift(p))
#define divp_mask_shifted(p) (divp_mask(p) << divp_shift(p))
#define divm_max(p) (divm_mask(p))
#define divn_max(p) (divn_mask(p))
#define divp_max(p) (1 << (divp_mask(p)))
...
...
@@ -486,13 +494,12 @@ static void _update_pll_mnp(struct tegra_clk_pll *pll,
}
else
{
val
=
pll_readl_base
(
pll
);
val
&=
~
((
divm_mask
(
pll
)
<<
div_nmp
->
divm_shift
)
|
(
divn_mask
(
pll
)
<<
div_nmp
->
divn_shift
)
|
(
divp_mask
(
pll
)
<<
div_nmp
->
divp_shift
));
val
&=
~
(
divm_mask_shifted
(
pll
)
|
divn_mask_shifted
(
pll
)
|
divp_mask_shifted
(
pll
));
val
|=
(
(
cfg
->
m
<<
div_nmp
->
divm_shift
)
|
(
cfg
->
n
<<
div_nmp
->
divn_shift
)
|
(
cfg
->
p
<<
div_nmp
->
divp_shift
));
val
|=
(
cfg
->
m
<<
divm_shift
(
pll
)
)
|
(
cfg
->
n
<<
divn_shift
(
pll
)
)
|
(
cfg
->
p
<<
divp_shift
(
pll
));
pll_writel_base
(
val
,
pll
);
}
...
...
@@ -740,11 +747,12 @@ static int clk_plle_enable(struct clk_hw *hw)
if
(
pll
->
params
->
flags
&
TEGRA_PLLE_CONFIGURE
)
{
/* configure dividers */
val
=
pll_readl_base
(
pll
);
val
&=
~
(
divm_mask
(
pll
)
|
divn_mask
(
pll
)
|
divp_mask
(
pll
));
val
&=
~
(
PLLE_BASE_DIVCML_WIDTH
<<
PLLE_BASE_DIVCML_SHIFT
);
val
|=
sel
.
m
<<
pll
->
params
->
div_nmp
->
divm_shift
;
val
|=
sel
.
n
<<
pll
->
params
->
div_nmp
->
divn_shift
;
val
|=
sel
.
p
<<
pll
->
params
->
div_nmp
->
divp_shift
;
val
&=
~
(
divp_mask_shifted
(
pll
)
|
divn_mask_shifted
(
pll
)
|
divm_mask_shifted
(
pll
));
val
&=
~
(
PLLE_BASE_DIVCML_MASK
<<
PLLE_BASE_DIVCML_SHIFT
);
val
|=
sel
.
m
<<
divm_shift
(
pll
);
val
|=
sel
.
n
<<
divn_shift
(
pll
);
val
|=
sel
.
p
<<
divp_shift
(
pll
);
val
|=
sel
.
cpcon
<<
PLLE_BASE_DIVCML_SHIFT
;
pll_writel_base
(
val
,
pll
);
}
...
...
@@ -755,10 +763,11 @@ static int clk_plle_enable(struct clk_hw *hw)
pll_writel_misc
(
val
,
pll
);
val
=
readl
(
pll
->
clk_base
+
PLLE_SS_CTRL
);
val
&=
~
PLLE_SS_COEFFICIENTS_MASK
;
val
|=
PLLE_SS_DISABLE
;
writel
(
val
,
pll
->
clk_base
+
PLLE_SS_CTRL
);
val
|
=
pll_readl_base
(
pll
);
val
=
pll_readl_base
(
pll
);
val
|=
(
PLL_BASE_BYPASS
|
PLL_BASE_ENABLE
);
pll_writel_base
(
val
,
pll
);
...
...
@@ -1302,10 +1311,11 @@ static int clk_plle_tegra114_enable(struct clk_hw *hw)
pll_writel
(
val
,
PLLE_SS_CTRL
,
pll
);
val
=
pll_readl_base
(
pll
);
val
&=
~
(
divm_mask
(
pll
)
|
divn_mask
(
pll
)
|
divp_mask
(
pll
));
val
&=
~
(
PLLE_BASE_DIVCML_WIDTH
<<
PLLE_BASE_DIVCML_SHIFT
);
val
|=
sel
.
m
<<
pll
->
params
->
div_nmp
->
divm_shift
;
val
|=
sel
.
n
<<
pll
->
params
->
div_nmp
->
divn_shift
;
val
&=
~
(
divp_mask_shifted
(
pll
)
|
divn_mask_shifted
(
pll
)
|
divm_mask_shifted
(
pll
));
val
&=
~
(
PLLE_BASE_DIVCML_MASK
<<
PLLE_BASE_DIVCML_SHIFT
);
val
|=
sel
.
m
<<
divm_shift
(
pll
);
val
|=
sel
.
n
<<
divn_shift
(
pll
);
val
|=
sel
.
cpcon
<<
PLLE_BASE_DIVCML_SHIFT
;
pll_writel_base
(
val
,
pll
);
udelay
(
1
);
...
...
@@ -1441,6 +1451,15 @@ struct clk *tegra_clk_register_pll(const char *name, const char *parent_name,
return
clk
;
}
static
struct
div_nmp
pll_e_nmp
=
{
.
divn_shift
=
PLLE_BASE_DIVN_SHIFT
,
.
divn_width
=
PLLE_BASE_DIVN_WIDTH
,
.
divm_shift
=
PLLE_BASE_DIVM_SHIFT
,
.
divm_width
=
PLLE_BASE_DIVM_WIDTH
,
.
divp_shift
=
PLLE_BASE_DIVP_SHIFT
,
.
divp_width
=
PLLE_BASE_DIVP_WIDTH
,
};
struct
clk
*
tegra_clk_register_plle
(
const
char
*
name
,
const
char
*
parent_name
,
void
__iomem
*
clk_base
,
void
__iomem
*
pmc
,
unsigned
long
flags
,
struct
tegra_clk_pll_params
*
pll_params
,
...
...
@@ -1451,6 +1470,10 @@ struct clk *tegra_clk_register_plle(const char *name, const char *parent_name,
pll_params
->
flags
|=
TEGRA_PLL_LOCK_MISC
|
TEGRA_PLL_BYPASS
;
pll_params
->
flags
|=
TEGRA_PLL_HAS_LOCK_ENABLE
;
if
(
!
pll_params
->
div_nmp
)
pll_params
->
div_nmp
=
&
pll_e_nmp
;
pll
=
_tegra_init_pll
(
clk_base
,
pmc
,
pll_params
,
lock
);
if
(
IS_ERR
(
pll
))
return
ERR_CAST
(
pll
);
...
...
@@ -1588,9 +1611,8 @@ struct clk *tegra_clk_register_pllre(const char *name, const char *parent_name,
int
m
;
m
=
_pll_fixed_mdiv
(
pll_params
,
parent_rate
);
val
=
m
<<
PLL_BASE_DIVM_SHIFT
;
val
|=
(
pll_params
->
vco_min
/
parent_rate
)
<<
PLL_BASE_DIVN_SHIFT
;
val
=
m
<<
divm_shift
(
pll
);
val
|=
(
pll_params
->
vco_min
/
parent_rate
)
<<
divn_shift
(
pll
);
pll_writel_base
(
val
,
pll
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录