Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
cloud-kernel
提交
8f86f362
cloud-kernel
项目概览
openanolis
/
cloud-kernel
接近 2 年 前同步成功
通知
170
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看板
提交
8f86f362
编写于
11月 04, 2011
作者:
T
Tony Lindgren
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'omap_clock_fixes_3.2' of
git://git.pwsan.com/linux-2.6
into fixes
上级
994c0e99
1194d7b8
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
142 addition
and
28 deletion
+142
-28
arch/arm/mach-omap2/clkt_dpll.c
arch/arm/mach-omap2/clkt_dpll.c
+35
-16
arch/arm/mach-omap2/clock.h
arch/arm/mach-omap2/clock.h
+2
-0
arch/arm/mach-omap2/clock44xx.h
arch/arm/mach-omap2/clock44xx.h
+7
-0
arch/arm/mach-omap2/clock44xx_data.c
arch/arm/mach-omap2/clock44xx_data.c
+23
-9
arch/arm/mach-omap2/dpll3xxx.c
arch/arm/mach-omap2/dpll3xxx.c
+6
-3
arch/arm/mach-omap2/dpll44xx.c
arch/arm/mach-omap2/dpll44xx.c
+69
-0
未找到文件。
arch/arm/mach-omap2/clkt_dpll.c
浏览文件 @
8f86f362
...
@@ -46,10 +46,19 @@
...
@@ -46,10 +46,19 @@
(DPLL_SCALE_FACTOR / DPLL_SCALE_BASE))
(DPLL_SCALE_FACTOR / DPLL_SCALE_BASE))
/* DPLL valid Fint frequency band limits - from 34xx TRM Section 4.7.6.2 */
/* DPLL valid Fint frequency band limits - from 34xx TRM Section 4.7.6.2 */
#define DPLL_FINT_BAND1_MIN 750000
#define OMAP3430_DPLL_FINT_BAND1_MIN 750000
#define DPLL_FINT_BAND1_MAX 2100000
#define OMAP3430_DPLL_FINT_BAND1_MAX 2100000
#define DPLL_FINT_BAND2_MIN 7500000
#define OMAP3430_DPLL_FINT_BAND2_MIN 7500000
#define DPLL_FINT_BAND2_MAX 21000000
#define OMAP3430_DPLL_FINT_BAND2_MAX 21000000
/*
* DPLL valid Fint frequency range for OMAP36xx and OMAP4xxx.
* From device data manual section 4.3 "DPLL and DLL Specifications".
*/
#define OMAP3PLUS_DPLL_FINT_JTYPE_MIN 500000
#define OMAP3PLUS_DPLL_FINT_JTYPE_MAX 2500000
#define OMAP3PLUS_DPLL_FINT_MIN 32000
#define OMAP3PLUS_DPLL_FINT_MAX 52000000
/* _dpll_test_fint() return codes */
/* _dpll_test_fint() return codes */
#define DPLL_FINT_UNDERFLOW -1
#define DPLL_FINT_UNDERFLOW -1
...
@@ -71,33 +80,43 @@
...
@@ -71,33 +80,43 @@
static
int
_dpll_test_fint
(
struct
clk
*
clk
,
u8
n
)
static
int
_dpll_test_fint
(
struct
clk
*
clk
,
u8
n
)
{
{
struct
dpll_data
*
dd
;
struct
dpll_data
*
dd
;
long
fint
;
long
fint
,
fint_min
,
fint_max
;
int
ret
=
0
;
int
ret
=
0
;
dd
=
clk
->
dpll_data
;
dd
=
clk
->
dpll_data
;
/* DPLL divider must result in a valid jitter correction val */
/* DPLL divider must result in a valid jitter correction val */
fint
=
clk
->
parent
->
rate
/
n
;
fint
=
clk
->
parent
->
rate
/
n
;
if
(
fint
<
DPLL_FINT_BAND1_MIN
)
{
if
(
cpu_is_omap24xx
())
{
/* Should not be called for OMAP2, so warn if it is called */
WARN
(
1
,
"No fint limits available for OMAP2!
\n
"
);
return
DPLL_FINT_INVALID
;
}
else
if
(
cpu_is_omap3430
())
{
fint_min
=
OMAP3430_DPLL_FINT_BAND1_MIN
;
fint_max
=
OMAP3430_DPLL_FINT_BAND2_MAX
;
}
else
if
(
dd
->
flags
&
DPLL_J_TYPE
)
{
fint_min
=
OMAP3PLUS_DPLL_FINT_JTYPE_MIN
;
fint_max
=
OMAP3PLUS_DPLL_FINT_JTYPE_MAX
;
}
else
{
fint_min
=
OMAP3PLUS_DPLL_FINT_MIN
;
fint_max
=
OMAP3PLUS_DPLL_FINT_MAX
;
}
if
(
fint
<
fint_min
)
{
pr_debug
(
"rejecting n=%d due to Fint failure, "
pr_debug
(
"rejecting n=%d due to Fint failure, "
"lowering max_divider
\n
"
,
n
);
"lowering max_divider
\n
"
,
n
);
dd
->
max_divider
=
n
;
dd
->
max_divider
=
n
;
ret
=
DPLL_FINT_UNDERFLOW
;
ret
=
DPLL_FINT_UNDERFLOW
;
}
else
if
(
fint
>
fint_max
)
{
}
else
if
(
fint
>
DPLL_FINT_BAND1_MAX
&&
fint
<
DPLL_FINT_BAND2_MIN
)
{
pr_debug
(
"rejecting n=%d due to Fint failure
\n
"
,
n
);
ret
=
DPLL_FINT_INVALID
;
}
else
if
(
fint
>
DPLL_FINT_BAND2_MAX
)
{
pr_debug
(
"rejecting n=%d due to Fint failure, "
pr_debug
(
"rejecting n=%d due to Fint failure, "
"boosting min_divider
\n
"
,
n
);
"boosting min_divider
\n
"
,
n
);
dd
->
min_divider
=
n
;
dd
->
min_divider
=
n
;
ret
=
DPLL_FINT_INVALID
;
ret
=
DPLL_FINT_INVALID
;
}
else
if
(
cpu_is_omap3430
()
&&
fint
>
OMAP3430_DPLL_FINT_BAND1_MAX
&&
fint
<
OMAP3430_DPLL_FINT_BAND2_MIN
)
{
pr_debug
(
"rejecting n=%d due to Fint failure
\n
"
,
n
);
ret
=
DPLL_FINT_INVALID
;
}
}
return
ret
;
return
ret
;
...
...
arch/arm/mach-omap2/clock.h
浏览文件 @
8f86f362
...
@@ -66,6 +66,8 @@ void omap3_noncore_dpll_disable(struct clk *clk);
...
@@ -66,6 +66,8 @@ void omap3_noncore_dpll_disable(struct clk *clk);
int
omap4_dpllmx_gatectrl_read
(
struct
clk
*
clk
);
int
omap4_dpllmx_gatectrl_read
(
struct
clk
*
clk
);
void
omap4_dpllmx_allow_gatectrl
(
struct
clk
*
clk
);
void
omap4_dpllmx_allow_gatectrl
(
struct
clk
*
clk
);
void
omap4_dpllmx_deny_gatectrl
(
struct
clk
*
clk
);
void
omap4_dpllmx_deny_gatectrl
(
struct
clk
*
clk
);
long
omap4_dpll_regm4xen_round_rate
(
struct
clk
*
clk
,
unsigned
long
target_rate
);
unsigned
long
omap4_dpll_regm4xen_recalc
(
struct
clk
*
clk
);
#ifdef CONFIG_OMAP_RESET_CLOCKS
#ifdef CONFIG_OMAP_RESET_CLOCKS
void
omap2_clk_disable_unused
(
struct
clk
*
clk
);
void
omap2_clk_disable_unused
(
struct
clk
*
clk
);
...
...
arch/arm/mach-omap2/clock44xx.h
浏览文件 @
8f86f362
...
@@ -8,6 +8,13 @@
...
@@ -8,6 +8,13 @@
#ifndef __ARCH_ARM_MACH_OMAP2_CLOCK44XX_H
#ifndef __ARCH_ARM_MACH_OMAP2_CLOCK44XX_H
#define __ARCH_ARM_MACH_OMAP2_CLOCK44XX_H
#define __ARCH_ARM_MACH_OMAP2_CLOCK44XX_H
/*
* OMAP4430_REGM4XEN_MULT: If the CM_CLKMODE_DPLL_ABE.DPLL_REGM4XEN bit is
* set, then the DPLL's lock frequency is multiplied by 4 (OMAP4430 TRM
* vV Section 3.6.3.3.1 "DPLLs Output Clocks Parameters")
*/
#define OMAP4430_REGM4XEN_MULT 4
int
omap4xxx_clk_init
(
void
);
int
omap4xxx_clk_init
(
void
);
#endif
#endif
arch/arm/mach-omap2/clock44xx_data.c
浏览文件 @
8f86f362
...
@@ -270,8 +270,8 @@ static struct clk dpll_abe_ck = {
...
@@ -270,8 +270,8 @@ static struct clk dpll_abe_ck = {
.
dpll_data
=
&
dpll_abe_dd
,
.
dpll_data
=
&
dpll_abe_dd
,
.
init
=
&
omap2_init_dpll_parent
,
.
init
=
&
omap2_init_dpll_parent
,
.
ops
=
&
clkops_omap3_noncore_dpll_ops
,
.
ops
=
&
clkops_omap3_noncore_dpll_ops
,
.
recalc
=
&
omap
3_dpll
_recalc
,
.
recalc
=
&
omap
4_dpll_regm4xen
_recalc
,
.
round_rate
=
&
omap
2_dpll
_round_rate
,
.
round_rate
=
&
omap
4_dpll_regm4xen
_round_rate
,
.
set_rate
=
&
omap3_noncore_dpll_set_rate
,
.
set_rate
=
&
omap3_noncore_dpll_set_rate
,
};
};
...
@@ -1195,11 +1195,25 @@ static struct clk l4_wkup_clk_mux_ck = {
...
@@ -1195,11 +1195,25 @@ static struct clk l4_wkup_clk_mux_ck = {
.
recalc
=
&
omap2_clksel_recalc
,
.
recalc
=
&
omap2_clksel_recalc
,
};
};
static
const
struct
clksel_rate
div2_2to1_rates
[]
=
{
{
.
div
=
1
,
.
val
=
1
,
.
flags
=
RATE_IN_4430
},
{
.
div
=
2
,
.
val
=
0
,
.
flags
=
RATE_IN_4430
},
{
.
div
=
0
},
};
static
const
struct
clksel
ocp_abe_iclk_div
[]
=
{
{
.
parent
=
&
aess_fclk
,
.
rates
=
div2_2to1_rates
},
{
.
parent
=
NULL
},
};
static
struct
clk
ocp_abe_iclk
=
{
static
struct
clk
ocp_abe_iclk
=
{
.
name
=
"ocp_abe_iclk"
,
.
name
=
"ocp_abe_iclk"
,
.
parent
=
&
aess_fclk
,
.
parent
=
&
aess_fclk
,
.
clksel
=
ocp_abe_iclk_div
,
.
clksel_reg
=
OMAP4430_CM1_ABE_AESS_CLKCTRL
,
.
clksel_mask
=
OMAP4430_CLKSEL_AESS_FCLK_MASK
,
.
ops
=
&
clkops_null
,
.
ops
=
&
clkops_null
,
.
recalc
=
&
followparent
_recalc
,
.
recalc
=
&
omap2_clksel
_recalc
,
};
};
static
struct
clk
per_abe_24m_fclk
=
{
static
struct
clk
per_abe_24m_fclk
=
{
...
@@ -1398,9 +1412,9 @@ static struct clk dss_dss_clk = {
...
@@ -1398,9 +1412,9 @@ static struct clk dss_dss_clk = {
};
};
static
const
struct
clksel_rate
div3_8to32_rates
[]
=
{
static
const
struct
clksel_rate
div3_8to32_rates
[]
=
{
{
.
div
=
8
,
.
val
=
0
,
.
flags
=
RATE_IN_44
XX
},
{
.
div
=
8
,
.
val
=
0
,
.
flags
=
RATE_IN_44
60
},
{
.
div
=
16
,
.
val
=
1
,
.
flags
=
RATE_IN_44
XX
},
{
.
div
=
16
,
.
val
=
1
,
.
flags
=
RATE_IN_44
60
},
{
.
div
=
32
,
.
val
=
2
,
.
flags
=
RATE_IN_44
XX
},
{
.
div
=
32
,
.
val
=
2
,
.
flags
=
RATE_IN_44
60
},
{
.
div
=
0
},
{
.
div
=
0
},
};
};
...
@@ -3403,12 +3417,12 @@ int __init omap4xxx_clk_init(void)
...
@@ -3403,12 +3417,12 @@ int __init omap4xxx_clk_init(void)
struct
omap_clk
*
c
;
struct
omap_clk
*
c
;
u32
cpu_clkflg
;
u32
cpu_clkflg
;
if
(
cpu_is_omap44
x
x
())
{
if
(
cpu_is_omap44
3
x
())
{
cpu_mask
=
RATE_IN_4430
;
cpu_mask
=
RATE_IN_4430
;
cpu_clkflg
=
CK_443X
;
cpu_clkflg
=
CK_443X
;
}
else
if
(
cpu_is_omap446x
())
{
}
else
if
(
cpu_is_omap446x
())
{
cpu_mask
=
RATE_IN_4460
;
cpu_mask
=
RATE_IN_4460
|
RATE_IN_4430
;
cpu_clkflg
=
CK_446X
;
cpu_clkflg
=
CK_446X
|
CK_443X
;
}
else
{
}
else
{
return
0
;
return
0
;
}
}
...
...
arch/arm/mach-omap2/dpll3xxx.c
浏览文件 @
8f86f362
...
@@ -390,7 +390,8 @@ int omap3_noncore_dpll_enable(struct clk *clk)
...
@@ -390,7 +390,8 @@ int omap3_noncore_dpll_enable(struct clk *clk)
* propagating?
* propagating?
*/
*/
if
(
!
r
)
if
(
!
r
)
clk
->
rate
=
omap2_get_dpll_rate
(
clk
);
clk
->
rate
=
(
clk
->
recalc
)
?
clk
->
recalc
(
clk
)
:
omap2_get_dpll_rate
(
clk
);
return
r
;
return
r
;
}
}
...
@@ -424,6 +425,7 @@ void omap3_noncore_dpll_disable(struct clk *clk)
...
@@ -424,6 +425,7 @@ void omap3_noncore_dpll_disable(struct clk *clk)
int
omap3_noncore_dpll_set_rate
(
struct
clk
*
clk
,
unsigned
long
rate
)
int
omap3_noncore_dpll_set_rate
(
struct
clk
*
clk
,
unsigned
long
rate
)
{
{
struct
clk
*
new_parent
=
NULL
;
struct
clk
*
new_parent
=
NULL
;
unsigned
long
hw_rate
;
u16
freqsel
=
0
;
u16
freqsel
=
0
;
struct
dpll_data
*
dd
;
struct
dpll_data
*
dd
;
int
ret
;
int
ret
;
...
@@ -435,7 +437,8 @@ int omap3_noncore_dpll_set_rate(struct clk *clk, unsigned long rate)
...
@@ -435,7 +437,8 @@ int omap3_noncore_dpll_set_rate(struct clk *clk, unsigned long rate)
if
(
!
dd
)
if
(
!
dd
)
return
-
EINVAL
;
return
-
EINVAL
;
if
(
rate
==
omap2_get_dpll_rate
(
clk
))
hw_rate
=
(
clk
->
recalc
)
?
clk
->
recalc
(
clk
)
:
omap2_get_dpll_rate
(
clk
);
if
(
rate
==
hw_rate
)
return
0
;
return
0
;
/*
/*
...
@@ -455,7 +458,7 @@ int omap3_noncore_dpll_set_rate(struct clk *clk, unsigned long rate)
...
@@ -455,7 +458,7 @@ int omap3_noncore_dpll_set_rate(struct clk *clk, unsigned long rate)
new_parent
=
dd
->
clk_bypass
;
new_parent
=
dd
->
clk_bypass
;
}
else
{
}
else
{
if
(
dd
->
last_rounded_rate
!=
rate
)
if
(
dd
->
last_rounded_rate
!=
rate
)
omap2_dpll_
round_rate
(
clk
,
rate
);
rate
=
clk
->
round_rate
(
clk
,
rate
);
if
(
dd
->
last_rounded_rate
==
0
)
if
(
dd
->
last_rounded_rate
==
0
)
return
-
EINVAL
;
return
-
EINVAL
;
...
...
arch/arm/mach-omap2/dpll44xx.c
浏览文件 @
8f86f362
...
@@ -19,6 +19,7 @@
...
@@ -19,6 +19,7 @@
#include <plat/clock.h>
#include <plat/clock.h>
#include "clock.h"
#include "clock.h"
#include "clock44xx.h"
#include "cm-regbits-44xx.h"
#include "cm-regbits-44xx.h"
/* Supported only on OMAP4 */
/* Supported only on OMAP4 */
...
@@ -82,3 +83,71 @@ const struct clkops clkops_omap4_dpllmx_ops = {
...
@@ -82,3 +83,71 @@ const struct clkops clkops_omap4_dpllmx_ops = {
.
deny_idle
=
omap4_dpllmx_deny_gatectrl
,
.
deny_idle
=
omap4_dpllmx_deny_gatectrl
,
};
};
/**
* omap4_dpll_regm4xen_recalc - compute DPLL rate, considering REGM4XEN bit
* @clk: struct clk * of the DPLL to compute the rate for
*
* Compute the output rate for the OMAP4 DPLL represented by @clk.
* Takes the REGM4XEN bit into consideration, which is needed for the
* OMAP4 ABE DPLL. Returns the DPLL's output rate (before M-dividers)
* upon success, or 0 upon error.
*/
unsigned
long
omap4_dpll_regm4xen_recalc
(
struct
clk
*
clk
)
{
u32
v
;
unsigned
long
rate
;
struct
dpll_data
*
dd
;
if
(
!
clk
||
!
clk
->
dpll_data
)
return
0
;
dd
=
clk
->
dpll_data
;
rate
=
omap2_get_dpll_rate
(
clk
);
/* regm4xen adds a multiplier of 4 to DPLL calculations */
v
=
__raw_readl
(
dd
->
control_reg
);
if
(
v
&
OMAP4430_DPLL_REGM4XEN_MASK
)
rate
*=
OMAP4430_REGM4XEN_MULT
;
return
rate
;
}
/**
* omap4_dpll_regm4xen_round_rate - round DPLL rate, considering REGM4XEN bit
* @clk: struct clk * of the DPLL to round a rate for
* @target_rate: the desired rate of the DPLL
*
* Compute the rate that would be programmed into the DPLL hardware
* for @clk if set_rate() were to be provided with the rate
* @target_rate. Takes the REGM4XEN bit into consideration, which is
* needed for the OMAP4 ABE DPLL. Returns the rounded rate (before
* M-dividers) upon success, -EINVAL if @clk is null or not a DPLL, or
* ~0 if an error occurred in omap2_dpll_round_rate().
*/
long
omap4_dpll_regm4xen_round_rate
(
struct
clk
*
clk
,
unsigned
long
target_rate
)
{
u32
v
;
struct
dpll_data
*
dd
;
long
r
;
if
(
!
clk
||
!
clk
->
dpll_data
)
return
-
EINVAL
;
dd
=
clk
->
dpll_data
;
/* regm4xen adds a multiplier of 4 to DPLL calculations */
v
=
__raw_readl
(
dd
->
control_reg
)
&
OMAP4430_DPLL_REGM4XEN_MASK
;
if
(
v
)
target_rate
=
target_rate
/
OMAP4430_REGM4XEN_MULT
;
r
=
omap2_dpll_round_rate
(
clk
,
target_rate
);
if
(
r
==
~
0
)
return
r
;
if
(
v
)
clk
->
dpll_data
->
last_rounded_rate
*=
OMAP4430_REGM4XEN_MULT
;
return
clk
->
dpll_data
->
last_rounded_rate
;
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录