Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
9b80ac47
Commit
9b80ac47
authored
Oct 06, 2003
by
Linus Torvalds
Browse files
Options
Browse Files
Download
Plain Diff
Merge
bk://linux-dj.bkbits.net/cpufreq
into home.osdl.org:/home/torvalds/v2.5/linux
parents
9c203f3d
c2ffde0c
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
135 additions
and
57 deletions
+135
-57
arch/i386/kernel/cpu/cpufreq/Kconfig
arch/i386/kernel/cpu/cpufreq/Kconfig
+2
-2
arch/i386/kernel/cpu/cpufreq/longhaul.c
arch/i386/kernel/cpu/cpufreq/longhaul.c
+13
-11
arch/i386/kernel/cpu/cpufreq/longhaul.h
arch/i386/kernel/cpu/cpufreq/longhaul.h
+98
-23
arch/i386/kernel/cpu/cpufreq/powernow-k8.c
arch/i386/kernel/cpu/cpufreq/powernow-k8.c
+16
-15
arch/i386/kernel/cpu/cpufreq/powernow-k8.h
arch/i386/kernel/cpu/cpufreq/powernow-k8.h
+3
-3
drivers/cpufreq/Kconfig
drivers/cpufreq/Kconfig
+3
-3
No files found.
arch/i386/kernel/cpu/cpufreq/Kconfig
View file @
9b80ac47
...
...
@@ -12,7 +12,7 @@ config CPU_FREQ
because the lower the clock speed, the less power the CPU consumes.
For more information, take a look at linux/Documentation/cpu-freq or
at <http://www.
brodo.de
/cpufreq/>
at <http://www.
codemonkey.org.uk/projects
/cpufreq/>
If in doubt, say N.
...
...
@@ -90,7 +90,7 @@ config X86_POWERNOW_K7
config X86_POWERNOW_K8
tristate "AMD Opteron/Athlon64 PowerNow!"
depends on CPU_FREQ
_TABLE
depends on CPU_FREQ
&& EXPERIMENTAL
help
This adds the CPUFreq driver for mobile AMD Opteron/Athlon64 processors.
...
...
arch/i386/kernel/cpu/cpufreq/longhaul.c
View file @
9b80ac47
...
...
@@ -373,7 +373,7 @@ static int longhaul_cpu_init (struct cpufreq_policy *policy)
case
6
:
cpuname
=
"C3 'Samuel' [C5A]"
;
longhaul_version
=
1
;
memcpy
(
clock_ratio
,
longhaul1_clock_ratio
,
sizeof
(
longhau
l1_clock_ratio
));
memcpy
(
clock_ratio
,
samuel1_clock_ratio
,
sizeof
(
samue
l1_clock_ratio
));
memcpy
(
eblcr_table
,
samuel1_eblcr
,
sizeof
(
samuel1_eblcr
));
break
;
...
...
@@ -382,13 +382,17 @@ static int longhaul_cpu_init (struct cpufreq_policy *policy)
case
0
:
cpuname
=
"C3 'Samuel 2' [C5B]"
;
longhaul_version
=
1
;
memcpy
(
clock_ratio
,
longhaul1_clock_ratio
,
sizeof
(
longhaul1_clock_ratio
));
/* Note, this is not a typo, early Samuel2's had Samuel1 ratios. */
memcpy
(
clock_ratio
,
samuel1_clock_ratio
,
sizeof
(
samuel1_clock_ratio
));
memcpy
(
eblcr_table
,
samuel2_eblcr
,
sizeof
(
samuel2_eblcr
));
break
;
case
1
...
15
:
cpuname
=
"C3 'Ezra' [C5C]"
;
if
(
c
->
x86_mask
<
8
)
cpuname
=
"C3 'Samuel 2' [C5B]"
;
else
cpuname
=
"C3 'Ezra' [C5C]"
;
longhaul_version
=
2
;
memcpy
(
clock_ratio
,
longhaul2_clock_ratio
,
sizeof
(
longhaul2
_clock_ratio
));
memcpy
(
clock_ratio
,
ezra_clock_ratio
,
sizeof
(
ezra
_clock_ratio
));
memcpy
(
eblcr_table
,
ezra_eblcr
,
sizeof
(
ezra_eblcr
));
break
;
}
...
...
@@ -398,14 +402,16 @@ static int longhaul_cpu_init (struct cpufreq_policy *policy)
cpuname
=
"C3 'Ezra-T [C5M]"
;
longhaul_version
=
3
;
numscales
=
32
;
memcpy
(
clock_ratio
,
longhaul3_clock_ratio
,
sizeof
(
longhaul3
_clock_ratio
));
memcpy
(
eblcr_table
,
c5m_eblcr
,
sizeof
(
c5m
_eblcr
));
memcpy
(
clock_ratio
,
ezrat_clock_ratio
,
sizeof
(
ezrat
_clock_ratio
));
memcpy
(
eblcr_table
,
ezrat_eblcr
,
sizeof
(
ezrat
_eblcr
));
break
;
/*
case 9:
cpuname = "C3 'Nehemiah' [C5N]";
longhaul_version=3;
numscales=32;
memcpy (clock_ratio, nehemiah_clock_ratio, sizeof(nehemiah_clock_ratio));
memcpy (eblcr_table, nehemiah_eblcr, sizeof(nehemiah_eblcr));
*/
default:
cpuname
=
"Unknown"
;
...
...
@@ -445,12 +451,8 @@ static int __init longhaul_init (void)
return
-
ENODEV
;
switch
(
c
->
x86_model
)
{
case
6
...
7
:
case
6
...
8
:
return
cpufreq_register_driver
(
&
longhaul_driver
);
case
8
:
printk
(
KERN_INFO
PFX
"Ezra-T unsupported: Waiting on updated docs "
"from VIA before this is usable.
\n
"
);
break
;
case
9
:
printk
(
KERN_INFO
PFX
"Nehemiah unsupported: Waiting on working silicon "
"from VIA before this is usable.
\n
"
);
...
...
arch/i386/kernel/cpu/cpufreq/longhaul.h
View file @
9b80ac47
...
...
@@ -56,7 +56,7 @@ union msr_longhaul {
/*
* VIA C3 Samuel 1 & Samuel 2 (stepping 0)
*/
static
int
__initdata
longhau
l1_clock_ratio
[
16
]
=
{
static
int
__initdata
samue
l1_clock_ratio
[
16
]
=
{
-
1
,
/* 0000 -> RESERVED */
30
,
/* 0001 -> 3.0x */
40
,
/* 0010 -> 4.0x */
...
...
@@ -95,27 +95,8 @@ static int __initdata samuel1_eblcr[16] = {
};
/*
* VIA C3 Samuel2 Stepping 1->15
& VIA C3 Ezra
* VIA C3 Samuel2 Stepping 1->15
*/
static
int
__initdata
longhaul2_clock_ratio
[
16
]
=
{
100
,
/* 0000 -> 10.0x */
30
,
/* 0001 -> 3.0x */
40
,
/* 0010 -> 4.0x */
90
,
/* 0011 -> 9.0x */
95
,
/* 0100 -> 9.5x */
35
,
/* 0101 -> 3.5x */
45
,
/* 0110 -> 4.5x */
55
,
/* 0111 -> 5.5x */
60
,
/* 1000 -> 6.0x */
70
,
/* 1001 -> 7.0x */
80
,
/* 1010 -> 8.0x */
50
,
/* 1011 -> 5.0x */
65
,
/* 1100 -> 6.5x */
75
,
/* 1101 -> 7.5x */
85
,
/* 1110 -> 8.5x */
120
,
/* 1111 -> 12.0x */
};
static
int
__initdata
samuel2_eblcr
[
16
]
=
{
50
,
/* 0000 -> 5.0x */
30
,
/* 0001 -> 3.0x */
...
...
@@ -135,6 +116,28 @@ static int __initdata samuel2_eblcr[16] = {
65
,
/* 1111 -> 6.5x */
};
/*
* VIA C3 Ezra
*/
static
int
__initdata
ezra_clock_ratio
[
16
]
=
{
100
,
/* 0000 -> 10.0x */
30
,
/* 0001 -> 3.0x */
40
,
/* 0010 -> 4.0x */
90
,
/* 0011 -> 9.0x */
95
,
/* 0100 -> 9.5x */
35
,
/* 0101 -> 3.5x */
45
,
/* 0110 -> 4.5x */
55
,
/* 0111 -> 5.5x */
60
,
/* 1000 -> 6.0x */
70
,
/* 1001 -> 7.0x */
80
,
/* 1010 -> 8.0x */
50
,
/* 1011 -> 5.0x */
65
,
/* 1100 -> 6.5x */
75
,
/* 1101 -> 7.5x */
85
,
/* 1110 -> 8.5x */
120
,
/* 1111 -> 12.0x */
};
static
int
__initdata
ezra_eblcr
[
16
]
=
{
50
,
/* 0000 -> 5.0x */
30
,
/* 0001 -> 3.0x */
...
...
@@ -157,7 +160,7 @@ static int __initdata ezra_eblcr[16] = {
/*
* VIA C3 (Ezra-T) [C5M].
*/
static
int
__initdata
longhaul3
_clock_ratio
[
32
]
=
{
static
int
__initdata
ezrat
_clock_ratio
[
32
]
=
{
100
,
/* 0000 -> 10.0x */
30
,
/* 0001 -> 3.0x */
40
,
/* 0010 -> 4.0x */
...
...
@@ -193,7 +196,7 @@ static int __initdata longhaul3_clock_ratio[32] = {
-
1
,
/* 1111 -> RESERVED (12.0x) */
};
static
int
__initdata
c5m
_eblcr
[
32
]
=
{
static
int
__initdata
ezrat
_eblcr
[
32
]
=
{
50
,
/* 0000 -> 5.0x */
30
,
/* 0001 -> 3.0x */
40
,
/* 0010 -> 4.0x */
...
...
@@ -229,7 +232,79 @@ static int __initdata c5m_eblcr[32] = {
145
,
/* 1111 -> 14.5x */
};
/*
* VIA C3 Nehemiah */
static
int
__initdata
nehemiah_clock_ratio
[
32
]
=
{
100
,
/* 0000 -> 10.0x */
160
,
/* 0001 -> 16.0x */
-
1
,
/* 0010 -> RESERVED */
90
,
/* 0011 -> 9.0x */
95
,
/* 0100 -> 9.5x */
-
1
,
/* 0101 -> RESERVED */
-
1
,
/* 0110 -> RESERVED */
55
,
/* 0111 -> 5.5x */
60
,
/* 1000 -> 6.0x */
70
,
/* 1001 -> 7.0x */
80
,
/* 1010 -> 8.0x */
50
,
/* 1011 -> 5.0x */
65
,
/* 1100 -> 6.5x */
75
,
/* 1101 -> 7.5x */
85
,
/* 1110 -> 8.5x */
120
,
/* 1111 -> 12.0x */
100
,
/* 0000 -> 10.0x */
110
,
/* 0001 -> 11.0x */
120
,
/* 0010 -> 12.0x */
90
,
/* 0011 -> 9.0x */
105
,
/* 0100 -> 10.5x */
115
,
/* 0101 -> 11.5x */
125
,
/* 0110 -> 12.5x */
135
,
/* 0111 -> 13.5x */
140
,
/* 1000 -> 14.0x */
150
,
/* 1001 -> 15.0x */
160
,
/* 1010 -> 16.0x */
130
,
/* 1011 -> 13.0x */
145
,
/* 1100 -> 14.5x */
155
,
/* 1101 -> 15.5x */
-
1
,
/* 1110 -> RESERVED */
120
,
/* 1111 -> 12.0x */
};
static
int
__initdata
nehemiah_eblcr
[
32
]
=
{
50
,
/* 0000 -> 5.0x */
160
,
/* 0001 -> 16.0x */
-
1
,
/* 0010 -> RESERVED */
100
,
/* 0011 -> 10.0x */
55
,
/* 0100 -> 5.5x */
-
1
,
/* 0101 -> RESERVED */
-
1
,
/* 0110 -> RESERVED */
95
,
/* 0111 -> 9.5x */
90
,
/* 1000 -> 9.0x */
70
,
/* 1001 -> 7.0x */
80
,
/* 1010 -> 8.0x */
60
,
/* 1011 -> 6.0x */
120
,
/* 1100 -> 12.0x */
75
,
/* 1101 -> 7.5x */
85
,
/* 1110 -> 8.5x */
65
,
/* 1111 -> 6.5x */
90
,
/* 0000 -> 9.0x */
110
,
/* 0001 -> 11.0x */
120
,
/* 0010 -> 12.0x */
100
,
/* 0011 -> 10.0x */
135
,
/* 0100 -> 13.5x */
115
,
/* 0101 -> 11.5x */
125
,
/* 0110 -> 12.5x */
105
,
/* 0111 -> 10.5x */
130
,
/* 1000 -> 13.0x */
150
,
/* 1001 -> 15.0x */
160
,
/* 1010 -> 16.0x */
140
,
/* 1011 -> 14.0x */
120
,
/* 1100 -> 12.0x */
155
,
/* 1101 -> 15.5x */
-
1
,
/* 1110 -> RESERVED */
-
1
,
/* 1111 -> RESERVED */
};
/*
* Voltage scales. Div/Mod by 1000 to get actual voltage.
* Which scale to use depends on the VRM type in use.
...
...
arch/i386/kernel/cpu/cpufreq/powernow-k8.c
View file @
9b80ac47
...
...
@@ -72,9 +72,9 @@ static u32 batps; /* limit on the number of p states when on battery */
/* - set by BIOS in the PSB/PST */
static
struct
cpufreq_driver
cpufreq_amd64_driver
=
{
.
verify
=
drv
_verify
,
.
target
=
drv
_target
,
.
init
=
drv
_cpu_init
,
.
verify
=
powernowk8
_verify
,
.
target
=
powernowk8
_target
,
.
init
=
powernowk8
_cpu_init
,
.
name
=
"cpufreq-amd64"
,
.
owner
=
THIS_MODULE
,
};
...
...
@@ -90,7 +90,7 @@ find_freq_from_fid(u32 fid)
}
/* Return a fid matching an input frequency in MHz */
u32
static
u32
find_fid_from_freq
(
u32
freq
)
{
return
(
freq
-
800
)
/
100
;
...
...
@@ -718,7 +718,7 @@ find_psb_table(void)
/* Converts a frequency (that might not necessarily be a multiple of 200) */
/* to a fid. */
u32
static
u32
find_closest_fid
(
u32
freq
,
int
searchup
)
{
if
(
searchup
==
SEARCH_UP
)
...
...
@@ -861,7 +861,7 @@ transition_frequency(u32 * preq, u32 * pmin, u32 * pmax, u32 searchup)
/* Driver entry point to switch to the target frequency */
static
int
drv
_target
(
struct
cpufreq_policy
*
pol
,
unsigned
targfreq
,
unsigned
relation
)
powernowk8
_target
(
struct
cpufreq_policy
*
pol
,
unsigned
targfreq
,
unsigned
relation
)
{
u32
checkfid
=
currfid
;
u32
checkvid
=
currvid
;
...
...
@@ -909,7 +909,7 @@ drv_target(struct cpufreq_policy *pol, unsigned targfreq, unsigned relation)
/* Driver entry point to verify the policy and range of frequencies */
static
int
drv
_verify
(
struct
cpufreq_policy
*
pol
)
powernowk8
_verify
(
struct
cpufreq_policy
*
pol
)
{
u32
min
=
pol
->
min
/
1000
;
u32
max
=
pol
->
max
/
1000
;
...
...
@@ -935,6 +935,7 @@ drv_verify(struct cpufreq_policy *pol)
return
-
ENODEV
;
}
#warning pol->policy is in undefined state here
res
=
find_match
(
&
targ
,
&
min
,
&
max
,
pol
->
policy
==
CPUFREQ_POLICY_POWERSAVE
?
SEARCH_DOWN
:
SEARCH_UP
,
0
,
0
);
...
...
@@ -947,14 +948,14 @@ drv_verify(struct cpufreq_policy *pol)
/* per CPU init entry point to the driver */
static
int
__init
drv
_cpu_init
(
struct
cpufreq_policy
*
pol
)
powernowk8
_cpu_init
(
struct
cpufreq_policy
*
pol
)
{
if
(
pol
->
cpu
!=
0
)
{
printk
(
KERN_ERR
PFX
"init not cpu 0
\n
"
);
return
-
ENODEV
;
}
pol
->
policy
=
CPUFREQ_POLICY_PERFORMANCE
;
/* boot as fast as we can */
pol
->
governor
=
CPUFREQ_DEFAULT_GOVERNOR
;
/* Take a crude guess here. */
pol
->
cpuinfo
.
transition_latency
=
((
rvo
+
8
)
*
vstable
*
VST_UNITS_20US
)
...
...
@@ -980,7 +981,7 @@ drv_cpu_init(struct cpufreq_policy *pol)
/* driver entry point for init */
static
int
__init
drv
_init
(
void
)
powernowk8
_init
(
void
)
{
int
rc
;
...
...
@@ -994,7 +995,7 @@ drv_init(void)
return
rc
;
if
(
pending_bit_stuck
())
{
printk
(
KERN_ERR
PFX
"
drv
_init fail, change pending bit set
\n
"
);
printk
(
KERN_ERR
PFX
"
powernowk8
_init fail, change pending bit set
\n
"
);
kfree
(
ppst
);
return
-
EIO
;
}
...
...
@@ -1004,9 +1005,9 @@ drv_init(void)
/* driver entry point for term */
static
void
__exit
drv
_exit
(
void
)
powernowk8
_exit
(
void
)
{
dprintk
(
KERN_INFO
PFX
"
drv
_exit
\n
"
);
dprintk
(
KERN_INFO
PFX
"
powernowk8
_exit
\n
"
);
cpufreq_unregister_driver
(
&
cpufreq_amd64_driver
);
kfree
(
ppst
);
...
...
@@ -1016,5 +1017,5 @@ MODULE_AUTHOR("Paul Devriendt <paul.devriendt@amd.com>");
MODULE_DESCRIPTION
(
"AMD Athlon 64 and Opteron processor frequency driver."
);
MODULE_LICENSE
(
"GPL"
);
module_init
(
drv
_init
);
module_exit
(
drv
_exit
);
module_init
(
powernowk8
_init
);
module_exit
(
powernowk8
_exit
);
arch/i386/kernel/cpu/cpufreq/powernow-k8.h
View file @
9b80ac47
...
...
@@ -120,7 +120,7 @@ struct pst_s {
static
inline
int
core_voltage_pre_transition
(
u32
reqvid
);
static
inline
int
core_voltage_post_transition
(
u32
reqvid
);
static
inline
int
core_frequency_transition
(
u32
reqfid
);
static
int
drv
_verify
(
struct
cpufreq_policy
*
pol
);
static
int
drv
_target
(
struct
cpufreq_policy
*
pol
,
unsigned
targfreq
,
static
int
powernowk8
_verify
(
struct
cpufreq_policy
*
pol
);
static
int
powernowk8
_target
(
struct
cpufreq_policy
*
pol
,
unsigned
targfreq
,
unsigned
relation
);
static
int
__init
drv
_cpu_init
(
struct
cpufreq_policy
*
pol
);
static
int
__init
powernowk8
_cpu_init
(
struct
cpufreq_policy
*
pol
);
drivers/cpufreq/Kconfig
View file @
9b80ac47
...
...
@@ -6,7 +6,7 @@ config CPU_FREQ_PROC_INTF
CPUFreq. Please note that it is recommended to use the sysfs
interface instead (which is built automatically).
For details, take a look at linux/Documentation/cpufreq.
For details, take a look at linux/Documentation/cpu
-
freq.
If in doubt, say N.
...
...
@@ -64,7 +64,7 @@ config CPU_FREQ_GOV_USERSPACE
be able to set the CPU dynamically, like on LART
<http://www.lart.tudelft.nl/>
For details, take a look at linux/Documentation/cpufreq.
For details, take a look at linux/Documentation/cpu
-
freq.
If in doubt, say Y.
...
...
@@ -78,6 +78,6 @@ config CPU_FREQ_24_API
the same functionality as long as "userspace" is the
selected governor for the specified CPU.
For details, take a look at linux/Documentation/cpufreq.
For details, take a look at linux/Documentation/cpu
-
freq.
If in doubt, say N.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment