diff options
author | Pratik Prajapati <pratikkumar.v.prajapati@intel.com> | 2017-09-13 13:45:31 -0700 |
---|---|---|
committer | Aaron Durbin <adurbin@chromium.org> | 2017-09-15 16:21:11 +0000 |
commit | b45b22f6b217d1b7aebe2583188839e7906c0a52 (patch) | |
tree | 93b42405236dda5645e1a76047dd1829db409f65 /src/soc/intel/skylake/cpu.c | |
parent | 1638a85b495fbf32680a3baf141ef959cb201257 (diff) |
soc/intel/common/sgx: Define and use soc_fill_sgx_param()
To remove chip.h dependency from SGX common code
- Create API soc_fill_sgx_param() and use it in sgx.c
- Implement same API for skylake/kabylake
- define sgx_param structure
Also include intelblocks/sgx.h instead of soc/msr.h
Change-Id: I358f0817bec5dd6cd147a645675b5688969a04e0
Signed-off-by: Pratik Prajapati <pratikkumar.v.prajapati@intel.com>
Reviewed-on: https://review.coreboot.org/21528
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Diffstat (limited to 'src/soc/intel/skylake/cpu.c')
-rw-r--r-- | src/soc/intel/skylake/cpu.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/soc/intel/skylake/cpu.c b/src/soc/intel/skylake/cpu.c index 1e12c6509f..ca844df07c 100644 --- a/src/soc/intel/skylake/cpu.c +++ b/src/soc/intel/skylake/cpu.c @@ -504,3 +504,18 @@ void cpu_lock_sgx_memory(void) wrmsr(MSR_LT_LOCK_MEMORY, msr); } } + +int soc_fill_sgx_param(struct sgx_param *sgx_param) +{ + device_t dev = SA_DEV_ROOT; + assert(dev != NULL); + config_t *conf = dev->chip_info; + + if (!conf) { + printk(BIOS_ERR, "Failed to get chip_info for SGX param\n"); + return -1; + } + + sgx_param->enable = conf->sgx_enable; + return 0; +} |