44 static const u32 voltage_mask =
45 (0x1f << 24) | (0x1f << 16) | (0x1f << 8) | 0x1f;
56 static const u32 frequencies_from_sku_vco[][4][8] = {
58 { 0xcd, 0xbc, 0x9b, 0x8a, 0x79, 0x78, 0x67, 0x56 },
59 { 0xcd, 0xac, 0x9b, 0x8a, 0x89, 0x78, 0x67, 0x56 },
60 { 0xac, 0x9b, 0x9a, 0x89, 0x89, 0x68, 0x56, 0x45 },
61 { 0xab, 0x9a, 0x79, 0x68, 0x57, 0x56, 0x45, 0x34 },
70 { 0xcd, 0xcd, 0xbc, 0x9b, 0x79, 0x78, 0x67, 0x56 },
71 { 0xde, 0xcd, 0xac, 0x9b, 0x89, 0x78, 0x67, 0x56 },
72 { 0xcd, 0xac, 0x9b, 0x9a, 0x89, 0x68, 0x56, 0x45 },
73 { 0xac, 0xab, 0x9a, 0x79, 0x68, 0x56, 0x45, 0x34 },
77 { 0xef, 0xde, 0xcd, 0xac, 0x89, 0x78, 0x67, 0x56 },
78 { 0xef, 0xde, 0xac, 0x9b, 0x89, 0x68, 0x56, 0x45 },
79 { 0xce, 0xbd, 0xab, 0x9a, 0x68, 0x57, 0x45, 0x34 },
83 const int reg_limit = low_power_mode ? 1 : 4;
89 if (!low_power_mode) {
97 for (i = 0; i < reg_limit; ++i) {
98 const int mchbar = 0x1110 + (i * 4);
100 [sku_index][vco_index][i * 2 + 0]);
102 [sku_index][vco_index][i * 2 + 1]);
105 if (low_power_mode) {
250 const int cpu_supports_super_lfm =
#define mchbar_setbits32(addr, set)
static __always_inline void mchbar_write16(const uintptr_t offset, const uint16_t value)
static __always_inline void mchbar_write8(const uintptr_t offset, const uint8_t value)
static __always_inline void mchbar_clrsetbits8(uintptr_t offset, uint8_t clear, uint8_t set)
static __always_inline void mchbar_write32(const uintptr_t offset, const uint32_t value)
#define mchbar_clrbits8(addr, clear)
#define mchbar_clrbits16(addr, clear)
#define mchbar_setbits8(addr, set)
static __always_inline void mchbar_clrsetbits32(uintptr_t offset, uint32_t clear, uint32_t set)
static __always_inline uint32_t mchbar_read32(const uintptr_t offset)
#define mchbar_clrbits32(addr, clear)
static __always_inline void mchbar_clrsetbits16(uintptr_t offset, uint16_t clear, uint16_t set)
static __always_inline uint16_t mchbar_read16(const uintptr_t offset)
#define mchbar_setbits16(addr, set)
int raminit_read_vco_index(void)
static __always_inline msr_t rdmsr(unsigned int index)
void init_pm(const sysinfo_t *const sysinfo, int do_freq_scaling_cfg)
static int sku_freq_index(const gmch_gfx_t sku, const int low_power_mode)
static void init_freq_scaling(const gmch_gfx_t sku, const int low_power_mode)
#define MSR_EXTENDED_CONFIG
struct timings selected_timings