Merge tag 'dm-pull-20jul20-take2a' of https://gitlab.denx.de/u-boot/custodians/u...
[platform/kernel/u-boot.git] / arch / x86 / cpu / broadwell / cpu_full.c
index d1f3c07..706f68f 100644 (file)
@@ -8,6 +8,8 @@
 #include <common.h>
 #include <dm.h>
 #include <cpu.h>
+#include <init.h>
+#include <log.h>
 #include <asm/cpu.h>
 #include <asm/cpu_x86.h>
 #include <asm/cpu_common.h>
@@ -18,6 +20,7 @@
 #include <asm/arch/cpu.h>
 #include <asm/arch/pch.h>
 #include <asm/arch/rcb.h>
+#include <linux/delay.h>
 
 struct cpu_broadwell_priv {
        bool ht_disabled;
@@ -329,15 +332,6 @@ static int bsp_init_before_ap_bringup(struct udevice *dev)
        return 0;
 }
 
-static int cpu_config_tdp_levels(void)
-{
-       msr_t platform_info;
-
-       /* Bits 34:33 indicate how many levels supported */
-       platform_info = msr_read(MSR_PLATFORM_INFO);
-       return (platform_info.hi >> 1) & 3;
-}
-
 static void set_max_ratio(void)
 {
        msr_t msr, perf_ctl;
@@ -360,7 +354,7 @@ static void set_max_ratio(void)
        msr_write(MSR_IA32_PERF_CTL, perf_ctl);
 
        debug("cpu: frequency set to %d\n",
-             ((perf_ctl.lo >> 8) & 0xff) * CPU_BCLK);
+             ((perf_ctl.lo >> 8) & 0xff) * INTEL_BCLK_MHZ);
 }
 
 int broadwell_init(struct udevice *dev)
@@ -479,9 +473,9 @@ static void configure_misc(void)
        msr_t msr;
 
        msr = msr_read(MSR_IA32_MISC_ENABLE);
-       msr.lo |= (1 << 0);       /* Fast String enable */
-       msr.lo |= (1 << 3);       /* TM1/TM2/EMTTM enable */
-       msr.lo |= (1 << 16);      /* Enhanced SpeedStep Enable */
+       msr.lo |= MISC_ENABLE_FAST_STRING;
+       msr.lo |= MISC_ENABLE_TM1;
+       msr.lo |= MISC_ENABLE_ENHANCED_SPEEDSTEP;
        msr_write(MSR_IA32_MISC_ENABLE, msr);
 
        /* Disable thermal interrupts */
@@ -632,12 +626,12 @@ void cpu_set_power_limits(int power_limit_1_time)
        }
 }
 
-static int broadwell_get_info(struct udevice *dev, struct cpu_info *info)
+static int broadwell_get_info(const struct udevice *dev, struct cpu_info *info)
 {
-       return cpu_intel_get_info(info, BROADWELL_BCLK);
+       return cpu_intel_get_info(info, INTEL_BCLK_MHZ);
 }
 
-static int broadwell_get_count(struct udevice *dev)
+static int broadwell_get_count(const struct udevice *dev)
 {
        return 4;
 }