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
Kirill Smelkov
linux
Commits
8ccc19ef
Commit
8ccc19ef
authored
Apr 06, 2004
by
Dave Jones
Committed by
Dave Jones
Apr 06, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[CPUFREQ] Merge a bunch of extra powernow-k8 helpers.
parent
0235c1be
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
2 deletions
+29
-2
arch/i386/kernel/cpu/cpufreq/powernow-k8.c
arch/i386/kernel/cpu/cpufreq/powernow-k8.c
+29
-2
No files found.
arch/i386/kernel/cpu/cpufreq/powernow-k8.c
View file @
8ccc19ef
...
...
@@ -39,12 +39,23 @@
static
struct
powernow_k8_data
*
powernow_data
[
NR_CPUS
];
/* Return a frequency in MHz, given an input fid */
/* Return a frequency in MHz, given an input fid */
static
u32
find_freq_from_fid
(
u32
fid
)
{
return
800
+
(
fid
*
100
);
return
800
+
(
fid
*
100
);
}
/* Return a frequency in KHz, given an input fid */
static
u32
find_khz_freq_from_fid
(
u32
fid
)
{
return
1000
*
find_freq_from_fid
(
fid
);
}
/* Return a voltage in miliVolts, given an input vid */
static
u32
find_millivolts_from_vid
(
struct
powernow_k8_data
*
data
,
u32
vid
)
{
return
1550
-
vid
*
25
;
}
/* Return the vco fid for an input fid */
static
u32
convert_fid_to_vco_fid
(
u32
fid
)
...
...
@@ -106,6 +117,22 @@ static void count_off_vst(struct powernow_k8_data *data)
return
;
}
/* need to init the control msr to a safe value (for each cpu) */
static
void
fidvid_msr_init
(
void
)
{
u32
lo
,
hi
;
u8
fid
,
vid
;
rdmsr
(
MSR_FIDVID_STATUS
,
lo
,
hi
);
vid
=
hi
&
MSR_S_HI_CURRENT_VID
;
fid
=
lo
&
MSR_S_LO_CURRENT_FID
;
lo
=
fid
|
(
vid
<<
MSR_C_LO_VID_SHIFT
);
hi
=
MSR_C_HI_STP_GNT_BENIGN
;
dprintk
(
PFX
"cpu%d, init lo %x, hi %x
\n
"
,
smp_processor_id
(),
lo
,
hi
);
wrmsr
(
MSR_FIDVID_CTL
,
lo
,
hi
);
}
/* write the new fid value along with the other control fields to the msr */
static
int
write_new_fid
(
struct
powernow_k8_data
*
data
,
u32
fid
)
{
...
...
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