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>
This commit is contained in:
committed by
Aaron Durbin
parent
1638a85b49
commit
b45b22f6b2
@@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user