Merge tag 'u-boot-imx-20191009' of https://gitlab.denx.de/u-boot/custodians/u-boot-imx
[oweals/u-boot.git] / arch / x86 / cpu / broadwell / cpu.c
index 297f1e0b682dc30080a2acc6df62d335cacae5d5..55a7439f1c103b0dacda17b27437c65c5ffd62cf 100644 (file)
@@ -41,12 +41,9 @@ int arch_cpu_init_dm(void)
 
 void set_max_freq(void)
 {
-       msr_t msr, perf_ctl, platform_info;
+       msr_t msr, perf_ctl;
 
-       /* Check for configurable TDP option */
-       platform_info = msr_read(MSR_PLATFORM_INFO);
-
-       if ((platform_info.hi >> 1) & 3) {
+       if (cpu_config_tdp_levels()) {
                /* Set to nominal TDP ratio */
                msr = msr_read(MSR_CONFIG_TDP_NOMINAL);
                perf_ctl.lo = (msr.lo & 0xff) << 8;
@@ -57,10 +54,10 @@ void set_max_freq(void)
        }
 
        perf_ctl.hi = 0;
-       msr_write(IA32_PERF_CTL, perf_ctl);
+       msr_write(MSR_IA32_PERF_CTL, perf_ctl);
 
        debug("CPU: frequency set to %d MHz\n",
-             ((perf_ctl.lo >> 8) & 0xff) * CPU_BCLK);
+             ((perf_ctl.lo >> 8) & 0xff) * INTEL_BCLK_MHZ);
 }
 
 int arch_cpu_init(void)