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
dae78db1
Commit
dae78db1
authored
Jul 15, 2003
by
Dave Jones
Committed by
Dave Jones
Jul 15, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[CPUFREQ] Convert Longhaul v1 over to bitfields too.
parent
94db5ad4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
13 deletions
+21
-13
arch/i386/kernel/cpu/cpufreq/longhaul.c
arch/i386/kernel/cpu/cpufreq/longhaul.c
+9
-13
arch/i386/kernel/cpu/cpufreq/longhaul.h
arch/i386/kernel/cpu/cpufreq/longhaul.h
+12
-0
No files found.
arch/i386/kernel/cpu/cpufreq/longhaul.c
View file @
dae78db1
...
...
@@ -285,7 +285,7 @@ static int longhaul_get_cpu_mult (void)
/**
* longhaul_set_cpu_frequency()
* @clock_ratio_index :
index of clock_ratio[] for new frequency
* @clock_ratio_index :
bitpattern of the new multiplier.
*
* Sets a new clock ratio, and -if applicable- a new Front Side Bus
*/
...
...
@@ -295,6 +295,7 @@ static void longhaul_setstate (unsigned int clock_ratio_index)
int
vidindex
,
i
;
struct
cpufreq_freqs
freqs
;
union
msr_longhaul
longhaul
;
union
msr_bcr2
bcr2
;
if
(
clock_ratio
[
clock_ratio_index
]
==
-
1
)
return
;
...
...
@@ -312,25 +313,20 @@ static void longhaul_setstate (unsigned int clock_ratio_index)
dprintk
(
KERN_INFO
PFX
"FSB:%d Mult(x10):%d
\n
"
,
fsb
*
100
,
clock_ratio
[
clock_ratio_index
]);
/* "bits" contains the bitpattern of the new multiplier.
we now need to transform it to the desired format. */
switch
(
longhaul_version
)
{
case
1
:
// rdmsr (MSR_VIA_BCR2, lo, hi
);
rdmsrl
(
MSR_VIA_BCR2
,
bcr2
.
val
);
/* Enable software clock multiplier */
// lo |= (1<<19);
/* desired multiplier */
// lo &= ~(1<<23|1<<24|1<<25|1<<26);
// lo |= (bits<<23);
// wrmsr (MSR_VIA_BCR2, lo, hi);
bcr2
.
bits
.
ESOFTBF
=
1
;
bcr2
.
bits
.
CLOCKMUL
=
clock_ratio_index
;
wrmsrl
(
MSR_VIA_BCR2
,
bcr2
.
val
);
__hlt
();
/* Disable software clock multiplier */
// rdmsr (MSR_VIA_BCR2, lo, hi
);
// lo &= ~(1<<19)
;
// wrmsr (MSR_VIA_BCR2, lo, hi
);
rdmsrl
(
MSR_VIA_BCR2
,
bcr2
.
val
);
bcr2
.
bits
.
ESOFTBF
=
0
;
wrmsrl
(
MSR_VIA_BCR2
,
bcr2
.
val
);
break
;
case
2
:
...
...
arch/i386/kernel/cpu/cpufreq/longhaul.h
View file @
dae78db1
...
...
@@ -7,6 +7,17 @@
* VIA-specific information
*/
union
msr_bcr2
{
struct
{
unsigned
Reseved
:
19
,
// 18:0
ESOFTBF:
1
,
// 19
Reserved2:
3
,
// 22:20
CLOCKMUL:
4
,
// 26:23
Reserved3:
5
;
// 31:27
}
bits
;
unsigned
long
val
;
};
union
msr_longhaul
{
struct
{
unsigned
RevisionID
:
4
,
// 3:0
...
...
@@ -35,3 +46,4 @@ union msr_longhaul {
}
bits
;
unsigned
long
long
val
;
};
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