Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
bug2833
cloud-kernel
提交
33ac02aa
cloud-kernel
项目概览
bug2833
/
cloud-kernel
与 Fork 源项目一致
Fork自
openanolis / cloud-kernel
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
cloud-kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
33ac02aa
编写于
7月 29, 2005
作者:
L
Linus Torvalds
浏览文件
操作
浏览文件
下载
差异文件
Merge master.kernel.org:/pub/scm/linux/kernel/git/davej/cpufreq
上级
e0d7ff16
2bcad935
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
38 addition
and
33 deletion
+38
-33
arch/i386/kernel/cpu/cpufreq/powernow-k8.c
arch/i386/kernel/cpu/cpufreq/powernow-k8.c
+17
-18
arch/i386/kernel/cpu/cpufreq/powernow-k8.h
arch/i386/kernel/cpu/cpufreq/powernow-k8.h
+19
-13
drivers/cpufreq/cpufreq.c
drivers/cpufreq/cpufreq.c
+2
-2
未找到文件。
arch/i386/kernel/cpu/cpufreq/powernow-k8.c
浏览文件 @
33ac02aa
/*
* (c) 2003, 2004 Advanced Micro Devices, Inc.
* (c) 2003, 2004
, 2005
Advanced Micro Devices, Inc.
* Your use of this code is subject to the terms and conditions of the
* GNU general public license version 2. See "COPYING" or
* http://www.gnu.org/licenses/gpl.html
...
...
@@ -44,7 +44,7 @@
#define PFX "powernow-k8: "
#define BFX PFX "BIOS error: "
#define VERSION "version 1.
40.2
"
#define VERSION "version 1.
50.3
"
#include "powernow-k8.h"
/* serialize freq changes */
...
...
@@ -231,7 +231,7 @@ static int write_new_vid(struct powernow_k8_data *data, u32 vid)
/*
* Reduce the vid by the max of step or reqvid.
* Decreasing vid codes represent increasing voltages:
* vid of 0 is 1.550V, vid of 0x1e is 0.800V, vid of
0x1f
is off.
* vid of 0 is 1.550V, vid of 0x1e is 0.800V, vid of
VID_OFF
is off.
*/
static
int
decrease_vid_code_by_step
(
struct
powernow_k8_data
*
data
,
u32
reqvid
,
u32
step
)
{
...
...
@@ -466,7 +466,7 @@ static int check_supported_cpu(unsigned int cpu)
eax
=
cpuid_eax
(
CPUID_PROCESSOR_SIGNATURE
);
if
(((
eax
&
CPUID_USE_XFAM_XMOD
)
!=
CPUID_USE_XFAM_XMOD
)
||
((
eax
&
CPUID_XFAM
)
!=
CPUID_XFAM_K8
)
||
((
eax
&
CPUID_XMOD
)
>
CPUID_XMOD_REV_
E
))
{
((
eax
&
CPUID_XMOD
)
>
CPUID_XMOD_REV_
F
))
{
printk
(
KERN_INFO
PFX
"Processor cpuid %x not supported
\n
"
,
eax
);
goto
out
;
}
...
...
@@ -695,6 +695,7 @@ static void powernow_k8_acpi_pst_values(struct powernow_k8_data *data, unsigned
data
->
irt
=
(
data
->
acpi_data
.
states
[
index
].
control
>>
IRT_SHIFT
)
&
IRT_MASK
;
data
->
rvo
=
(
data
->
acpi_data
.
states
[
index
].
control
>>
RVO_SHIFT
)
&
RVO_MASK
;
data
->
exttype
=
(
data
->
acpi_data
.
states
[
index
].
control
>>
EXT_TYPE_SHIFT
)
&
EXT_TYPE_MASK
;
data
->
plllock
=
(
data
->
acpi_data
.
states
[
index
].
control
>>
PLL_L_SHIFT
)
&
PLL_L_MASK
;
data
->
vidmvs
=
1
<<
((
data
->
acpi_data
.
states
[
index
].
control
>>
MVS_SHIFT
)
&
MVS_MASK
);
data
->
vstable
=
(
data
->
acpi_data
.
states
[
index
].
control
>>
VST_SHIFT
)
&
VST_MASK
;
...
...
@@ -734,8 +735,13 @@ static int powernow_k8_cpu_init_acpi(struct powernow_k8_data *data)
}
for
(
i
=
0
;
i
<
data
->
acpi_data
.
state_count
;
i
++
)
{
if
(
data
->
exttype
)
{
u32
fid
=
data
->
acpi_data
.
states
[
i
].
status
&
FID_MASK
;
u32
vid
=
(
data
->
acpi_data
.
states
[
i
].
status
>>
VID_SHIFT
)
&
VID_MASK
;
}
else
{
u32
fid
=
data
->
acpi_data
.
states
[
i
].
control
&
FID_MASK
;
u32
vid
=
(
data
->
acpi_data
.
states
[
i
].
control
>>
VID_SHIFT
)
&
VID_MASK
;
}
dprintk
(
" %d : fid 0x%x, vid 0x%x
\n
"
,
i
,
fid
,
vid
);
...
...
@@ -752,7 +758,7 @@ static int powernow_k8_cpu_init_acpi(struct powernow_k8_data *data)
}
/* verify voltage is OK - BIOSs are using "off" to indicate invalid */
if
(
vid
==
0x1f
)
{
if
(
vid
==
VID_OFF
)
{
dprintk
(
"invalid vid %u, ignoring
\n
"
,
vid
);
powernow_table
[
i
].
frequency
=
CPUFREQ_ENTRY_INVALID
;
continue
;
...
...
@@ -929,15 +935,6 @@ static int powernowk8_target(struct cpufreq_policy *pol, unsigned targfreq, unsi
down
(
&
fidvid_sem
);
for_each_cpu_mask
(
i
,
cpu_core_map
[
pol
->
cpu
])
{
/* make sure the sibling is initialized */
if
(
!
powernow_data
[
i
])
{
ret
=
0
;
up
(
&
fidvid_sem
);
goto
err_out
;
}
}
powernow_k8_acpi_pst_values
(
data
,
newstate
);
if
(
transition_frequency
(
data
,
newstate
))
{
...
...
@@ -977,7 +974,7 @@ static int __init powernowk8_cpu_init(struct cpufreq_policy *pol)
{
struct
powernow_k8_data
*
data
;
cpumask_t
oldmask
=
CPU_MASK_ALL
;
int
rc
;
int
rc
,
i
;
if
(
!
check_supported_cpu
(
pol
->
cpu
))
return
-
ENODEV
;
...
...
@@ -1063,7 +1060,9 @@ static int __init powernowk8_cpu_init(struct cpufreq_policy *pol)
printk
(
"cpu_init done, current fid 0x%x, vid 0x%x
\n
"
,
data
->
currfid
,
data
->
currvid
);
powernow_data
[
pol
->
cpu
]
=
data
;
for_each_cpu_mask
(
i
,
cpu_core_map
[
pol
->
cpu
])
{
powernow_data
[
i
]
=
data
;
}
return
0
;
...
...
arch/i386/kernel/cpu/cpufreq/powernow-k8.h
浏览文件 @
33ac02aa
/*
* (c) 2003, 2004 Advanced Micro Devices, Inc.
* (c) 2003, 2004
, 2005
Advanced Micro Devices, Inc.
* Your use of this code is subject to the terms and conditions of the
* GNU general public license version 2. See "COPYING" or
* http://www.gnu.org/licenses/gpl.html
...
...
@@ -19,6 +19,7 @@ struct powernow_k8_data {
u32
vidmvs
;
/* usable value calculated from mvs */
u32
vstable
;
/* voltage stabilization time, units 20 us */
u32
plllock
;
/* pll lock time, units 1 us */
u32
exttype
;
/* extended interface = 1 */
/* keep track of the current fid / vid */
u32
currvid
,
currfid
;
...
...
@@ -41,7 +42,7 @@ struct powernow_k8_data {
#define CPUID_XFAM 0x0ff00000
/* extended family */
#define CPUID_XFAM_K8 0
#define CPUID_XMOD 0x000f0000
/* extended model */
#define CPUID_XMOD_REV_
E 0x0002
0000
#define CPUID_XMOD_REV_
F 0x0004
0000
#define CPUID_USE_XFAM_XMOD 0x00000f00
#define CPUID_GET_MAX_CAPABILITIES 0x80000000
#define CPUID_FREQ_VOLT_CAPABILITIES 0x80000007
...
...
@@ -57,8 +58,8 @@ struct powernow_k8_data {
/* Field definitions within the FID VID Low Control MSR : */
#define MSR_C_LO_INIT_FID_VID 0x00010000
#define MSR_C_LO_NEW_VID 0x0000
1
f00
#define MSR_C_LO_NEW_FID 0x000000
2
f
#define MSR_C_LO_NEW_VID 0x0000
3
f00
#define MSR_C_LO_NEW_FID 0x000000
3
f
#define MSR_C_LO_VID_SHIFT 8
/* Field definitions within the FID VID High Control MSR : */
...
...
@@ -66,15 +67,16 @@ struct powernow_k8_data {
/* Field definitions within the FID VID Low Status MSR : */
#define MSR_S_LO_CHANGE_PENDING 0x80000000
/* cleared when completed */
#define MSR_S_LO_MAX_RAMP_VID 0x
1
f000000
#define MSR_S_LO_MAX_RAMP_VID 0x
3
f000000
#define MSR_S_LO_MAX_FID 0x003f0000
#define MSR_S_LO_START_FID 0x00003f00
#define MSR_S_LO_CURRENT_FID 0x0000003f
/* Field definitions within the FID VID High Status MSR : */
#define MSR_S_HI_MAX_WORKING_VID 0x001f0000
#define MSR_S_HI_START_VID 0x00001f00
#define MSR_S_HI_CURRENT_VID 0x0000001f
#define MSR_S_HI_MIN_WORKING_VID 0x3f000000
#define MSR_S_HI_MAX_WORKING_VID 0x003f0000
#define MSR_S_HI_START_VID 0x00003f00
#define MSR_S_HI_CURRENT_VID 0x0000003f
#define MSR_C_HI_STP_GNT_BENIGN 0x00000001
/*
...
...
@@ -99,13 +101,15 @@ struct powernow_k8_data {
#define MIN_FREQ_RESOLUTION 200
/* fids jump by 2 matching freq jumps by 200 */
#define MAX_FID 0x2a
/* Spec only gives FID values as far as 5 GHz */
#define LEAST_VID 0x
1
e
/* Lowest (numerically highest) useful vid value */
#define LEAST_VID 0x
3
e
/* Lowest (numerically highest) useful vid value */
#define MIN_FREQ 800
/* Min and max freqs, per spec */
#define MAX_FREQ 5000
#define INVALID_FID_MASK 0xffffffc1
/* not a valid fid if these bits are set */
#define INVALID_VID_MASK 0xffffffe0
/* not a valid vid if these bits are set */
#define INVALID_VID_MASK 0xffffffc0
/* not a valid vid if these bits are set */
#define VID_OFF 0x3f
#define STOP_GRANT_5NS 1
/* min poss memory access latency for voltage change */
...
...
@@ -121,12 +125,14 @@ struct powernow_k8_data {
#define IRT_SHIFT 30
#define RVO_SHIFT 28
#define EXT_TYPE_SHIFT 27
#define PLL_L_SHIFT 20
#define MVS_SHIFT 18
#define VST_SHIFT 11
#define VID_SHIFT 6
#define IRT_MASK 3
#define RVO_MASK 3
#define EXT_TYPE_MASK 1
#define PLL_L_MASK 0x7f
#define MVS_MASK 3
#define VST_MASK 0x7f
...
...
drivers/cpufreq/cpufreq.c
浏览文件 @
33ac02aa
...
...
@@ -1130,7 +1130,7 @@ int cpufreq_driver_target(struct cpufreq_policy *policy,
unsigned
int
target_freq
,
unsigned
int
relation
)
{
unsigned
int
ret
;
int
ret
;
policy
=
cpufreq_cpu_get
(
policy
->
cpu
);
if
(
!
policy
)
...
...
@@ -1151,7 +1151,7 @@ EXPORT_SYMBOL_GPL(cpufreq_driver_target);
static
int
__cpufreq_governor
(
struct
cpufreq_policy
*
policy
,
unsigned
int
event
)
{
int
ret
=
-
EINVAL
;
int
ret
;
if
(
!
try_module_get
(
policy
->
governor
->
owner
))
return
-
EINVAL
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录