From 9e66506d33eac67bfa814ccba1c9ccd06bb5b107 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Fri, 11 Mar 2016 22:06:54 -0700 Subject: [PATCH] x86: Move microcode code to a common location This code is used on several Intel CPUs. Move it into a common location. Signed-off-by: Simon Glass Reviewed-by: Bin Meng --- arch/x86/cpu/intel_common/Makefile | 3 +++ arch/x86/cpu/intel_common/car.S | 2 +- .../{ivybridge/microcode_intel.c => intel_common/microcode.c} | 4 +++- arch/x86/cpu/ivybridge/Makefile | 1 - arch/x86/cpu/ivybridge/cpu.c | 2 +- arch/x86/include/asm/{arch-ivybridge => }/microcode.h | 0 6 files changed, 8 insertions(+), 4 deletions(-) rename arch/x86/cpu/{ivybridge/microcode_intel.c => intel_common/microcode.c} (98%) rename arch/x86/include/asm/{arch-ivybridge => }/microcode.h (100%) diff --git a/arch/x86/cpu/intel_common/Makefile b/arch/x86/cpu/intel_common/Makefile index 5dd95739a0..ca4e171d20 100644 --- a/arch/x86/cpu/intel_common/Makefile +++ b/arch/x86/cpu/intel_common/Makefile @@ -5,3 +5,6 @@ # obj-$(CONFIG_HAVE_MRC) += car.o +ifndef CONFIG_TARGET_EFI +obj-y += microcode.o +endif diff --git a/arch/x86/cpu/intel_common/car.S b/arch/x86/cpu/intel_common/car.S index 1defabf91f..81ac976ddd 100644 --- a/arch/x86/cpu/intel_common/car.S +++ b/arch/x86/cpu/intel_common/car.S @@ -12,12 +12,12 @@ */ #include +#include #include #include #include #include #include -#include #define MTRR_PHYS_BASE_MSR(reg) (0x200 + 2 * (reg)) #define MTRR_PHYS_MASK_MSR(reg) (0x200 + 2 * (reg) + 1) diff --git a/arch/x86/cpu/ivybridge/microcode_intel.c b/arch/x86/cpu/intel_common/microcode.c similarity index 98% rename from arch/x86/cpu/ivybridge/microcode_intel.c rename to arch/x86/cpu/intel_common/microcode.c index 2440a97c48..3054fabfde 100644 --- a/arch/x86/cpu/ivybridge/microcode_intel.c +++ b/arch/x86/cpu/intel_common/microcode.c @@ -12,10 +12,12 @@ #include #include #include +#include #include #include #include -#include + +DECLARE_GLOBAL_DATA_PTR; /** * struct microcode_update - standard microcode header from Intel diff --git a/arch/x86/cpu/ivybridge/Makefile b/arch/x86/cpu/ivybridge/Makefile index b117f0deb2..78006f12b3 100644 --- a/arch/x86/cpu/ivybridge/Makefile +++ b/arch/x86/cpu/ivybridge/Makefile @@ -13,7 +13,6 @@ obj-y += gma.o obj-y += lpc.o obj-y += me_status.o obj-y += model_206ax.o -obj-y += microcode_intel.o obj-y += northbridge.o obj-y += report_platform.o obj-y += sata.o diff --git a/arch/x86/cpu/ivybridge/cpu.c b/arch/x86/cpu/ivybridge/cpu.c index 5d839a7e1b..f0e733bc33 100644 --- a/arch/x86/cpu/ivybridge/cpu.c +++ b/arch/x86/cpu/ivybridge/cpu.c @@ -19,13 +19,13 @@ #include #include #include +#include #include #include #include #include #include #include -#include #include #include diff --git a/arch/x86/include/asm/arch-ivybridge/microcode.h b/arch/x86/include/asm/microcode.h similarity index 100% rename from arch/x86/include/asm/arch-ivybridge/microcode.h rename to arch/x86/include/asm/microcode.h -- 2.30.2