diff options
author | Mark Langsdorf <mark.langsdorf@amd.com> | 2007-10-17 17:52:08 -0400 |
---|---|---|
committer | Dave Jones <davej@redhat.com> | 2007-10-22 16:30:33 -0400 |
commit | c5829cd07ec4c08daa7ff91c821af9b2ac7748df (patch) | |
tree | 7950a61bb4afe118297c375671af869838c3d18e /arch/x86/kernel/cpu/cpufreq/powernow-k8.h | |
parent | 63bd8c48e04bbbc9cee3d752857914609d8d406f (diff) |
[CPUFREQ] architectural pstate driver for powernow-k8
This patch should apply cleanly to the 2.6.23-git7 kernel. It changes the
powernow-k8 driver code that deals with 3rd generation Opteron, Phenom,
and later processors to match the architectural pstate driver described
in the AMD64 Architecture Programmer's Manual Volume 2 Chapter 18. The
initial implementation of the hardware pstate driver for PowerNow!
used some processor-version specific features, and would not be
maintainable in the long term as the processor features changed.
This architectural driver should work on all future AMD processors.
Signed-off-by: Mark Langsdorf <mark.langsdorf@amd.com>
Signed-off-by: Andreas Herrmann <andreas.herrmann3@amd.com>
Signed-off-by: Dave Jones <davej@redhat.com>
Diffstat (limited to 'arch/x86/kernel/cpu/cpufreq/powernow-k8.h')
-rw-r--r-- | arch/x86/kernel/cpu/cpufreq/powernow-k8.h | 20 |
1 files changed, 6 insertions, 14 deletions
diff --git a/arch/x86/kernel/cpu/cpufreq/powernow-k8.h b/arch/x86/kernel/cpu/cpufreq/powernow-k8.h index b06c812208ca..8ae88f181286 100644 --- a/arch/x86/kernel/cpu/cpufreq/powernow-k8.h +++ b/arch/x86/kernel/cpu/cpufreq/powernow-k8.h | |||
@@ -10,6 +10,7 @@ struct powernow_k8_data { | |||
10 | 10 | ||
11 | u32 numps; /* number of p-states */ | 11 | u32 numps; /* number of p-states */ |
12 | u32 batps; /* number of p-states supported on battery */ | 12 | u32 batps; /* number of p-states supported on battery */ |
13 | u32 max_hw_pstate; /* maximum legal hardware pstate */ | ||
13 | 14 | ||
14 | /* these values are constant when the PSB is used to determine | 15 | /* these values are constant when the PSB is used to determine |
15 | * vid/fid pairings, but are modified during the ->target() call | 16 | * vid/fid pairings, but are modified during the ->target() call |
@@ -21,8 +22,8 @@ struct powernow_k8_data { | |||
21 | u32 plllock; /* pll lock time, units 1 us */ | 22 | u32 plllock; /* pll lock time, units 1 us */ |
22 | u32 exttype; /* extended interface = 1 */ | 23 | u32 exttype; /* extended interface = 1 */ |
23 | 24 | ||
24 | /* keep track of the current fid / vid or did */ | 25 | /* keep track of the current fid / vid or pstate */ |
25 | u32 currvid, currfid, currdid; | 26 | u32 currvid, currfid, currpstate; |
26 | 27 | ||
27 | /* the powernow_table includes all frequency and vid/fid pairings: | 28 | /* the powernow_table includes all frequency and vid/fid pairings: |
28 | * fid are the lower 8 bits of the index, vid are the upper 8 bits. | 29 | * fid are the lower 8 bits of the index, vid are the upper 8 bits. |
@@ -87,23 +88,14 @@ struct powernow_k8_data { | |||
87 | 88 | ||
88 | /* Hardware Pstate _PSS and MSR definitions */ | 89 | /* Hardware Pstate _PSS and MSR definitions */ |
89 | #define USE_HW_PSTATE 0x00000080 | 90 | #define USE_HW_PSTATE 0x00000080 |
90 | #define HW_PSTATE_FID_MASK 0x0000003f | ||
91 | #define HW_PSTATE_DID_MASK 0x000001c0 | ||
92 | #define HW_PSTATE_DID_SHIFT 6 | ||
93 | #define HW_PSTATE_MASK 0x00000007 | 91 | #define HW_PSTATE_MASK 0x00000007 |
94 | #define HW_PSTATE_VALID_MASK 0x80000000 | 92 | #define HW_PSTATE_VALID_MASK 0x80000000 |
95 | #define HW_FID_INDEX_SHIFT 8 | 93 | #define HW_PSTATE_MAX_MASK 0x000000f0 |
96 | #define HW_FID_INDEX_MASK 0x0000ff00 | 94 | #define HW_PSTATE_MAX_SHIFT 4 |
97 | #define HW_DID_INDEX_SHIFT 16 | ||
98 | #define HW_DID_INDEX_MASK 0x00ff0000 | ||
99 | #define HW_WATTS_MASK 0xff | ||
100 | #define HW_PWR_DVR_MASK 0x300 | ||
101 | #define HW_PWR_DVR_SHIFT 8 | ||
102 | #define HW_PWR_MAX_MULT 3 | ||
103 | #define MAX_HW_PSTATE 8 /* hw pstate supports up to 8 */ | ||
104 | #define MSR_PSTATE_DEF_BASE 0xc0010064 /* base of Pstate MSRs */ | 95 | #define MSR_PSTATE_DEF_BASE 0xc0010064 /* base of Pstate MSRs */ |
105 | #define MSR_PSTATE_STATUS 0xc0010063 /* Pstate Status MSR */ | 96 | #define MSR_PSTATE_STATUS 0xc0010063 /* Pstate Status MSR */ |
106 | #define MSR_PSTATE_CTRL 0xc0010062 /* Pstate control MSR */ | 97 | #define MSR_PSTATE_CTRL 0xc0010062 /* Pstate control MSR */ |
98 | #define MSR_PSTATE_CUR_LIMIT 0xc0010061 /* pstate current limit MSR */ | ||
107 | 99 | ||
108 | /* define the two driver architectures */ | 100 | /* define the two driver architectures */ |
109 | #define CPU_OPTERON 0 | 101 | #define CPU_OPTERON 0 |