From 57f8386a2bfa2ca794b687cfc7846dab690fd438 Mon Sep 17 00:00:00 2001 From: Pratik Prajapati Date: Mon, 14 Aug 2017 13:47:03 -0700 Subject: intel/common/sgx: Use intel_mp_current_microcode() to get microcode pointer Get microcode patch pointer from intel_mp_current_microcode() api of mp_init and change sgx_configure function signature to drop microcode_patch param. Change-Id: I9196c30ec7ea52d7184a96b33835def197e2c799 Signed-off-by: Pratik Prajapati Reviewed-on: https://review.coreboot.org/21009 Reviewed-by: Aaron Durbin Tested-by: build bot (Jenkins) --- src/soc/intel/common/block/include/intelblocks/sgx.h | 2 +- src/soc/intel/common/block/sgx/sgx.c | 6 +++++- src/soc/intel/skylake/cpu.c | 4 ++-- 3 files changed, 8 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/soc/intel/common/block/include/intelblocks/sgx.h b/src/soc/intel/common/block/include/intelblocks/sgx.h index 03d4ab5123..bdc35540dc 100644 --- a/src/soc/intel/common/block/include/intelblocks/sgx.h +++ b/src/soc/intel/common/block/include/intelblocks/sgx.h @@ -25,6 +25,6 @@ void cpu_lock_sgx_memory(void); /* * Configure SGX. */ -void sgx_configure(const void *microcode_patch); +void sgx_configure(void); #endif /* SOC_INTEL_COMMON_BLOCK_SGX_H */ diff --git a/src/soc/intel/common/block/sgx/sgx.c b/src/soc/intel/common/block/sgx/sgx.c index 5a0b61dda6..525e6859a9 100644 --- a/src/soc/intel/common/block/sgx/sgx.c +++ b/src/soc/intel/common/block/sgx/sgx.c @@ -13,11 +13,13 @@ * GNU General Public License for more details. */ +#include #include #include #include #include #include +#include #include #include #include @@ -125,10 +127,12 @@ static void activate_sgx(void) } } -void sgx_configure(const void *microcode_patch) +void sgx_configure(void) { device_t dev = SA_DEV_ROOT; + assert(dev != NULL); config_t *conf = dev->chip_info; + const void *microcode_patch = intel_mp_current_microcode(); if (!conf->sgx_enable || !is_sgx_supported()) return; diff --git a/src/soc/intel/skylake/cpu.c b/src/soc/intel/skylake/cpu.c index 1a081915a2..fe9c00841d 100644 --- a/src/soc/intel/skylake/cpu.c +++ b/src/soc/intel/skylake/cpu.c @@ -438,7 +438,7 @@ void soc_core_init(device_t cpu, const void *microcode) enable_turbo(); /* Configure SGX */ - sgx_configure(microcode); + sgx_configure(); } static int adjust_apic_id(int index, int apic_id) @@ -505,7 +505,7 @@ void soc_init_cpus(struct bus *cpu_bus, const void *microcode) * here to get SGX enabled on BSP. This behavior needs to root-caused * and we shall not have this redundant call. */ - sgx_configure(microcode); + sgx_configure(); } int soc_skip_ucode_update(u32 current_patch_id, u32 new_patch_id) -- cgit v1.2.3