From ef04f4e3d3f9e4aa23e0a48cc93dd4176131ad78 Mon Sep 17 00:00:00 2001 From: Subrata Banik Date: Tue, 11 Aug 2020 18:13:04 +0530 Subject: drivers/intel/fsp2_0: Fill EFI_CPU_PHYSICAL_LOCATION structure information Latest EDK2 code inside "UefiCpuPkg\Library\RegisterCpuFeaturesLib\CpuFeaturesInitialize.c" is now looking for EFI_CPU_PHYSICAL_LOCATION structure variables hence coreboot need to fill required information (package, core and thread count). TEST=Able to see package, core and thread information as part of FSP debug log. Change-Id: Ieccf20a116d59aaafbbec3fe0adad9a48931cb59 Signed-off-by: Subrata Banik Reviewed-on: https://review.coreboot.org/c/coreboot/+/44390 Tested-by: build bot (Jenkins) Reviewed-by: Angel Pons Reviewed-by: Sridhar Siricilla Reviewed-by: Aamir Bohra --- src/drivers/intel/fsp2_0/ppi/mp_service_ppi.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'src/drivers/intel/fsp2_0') diff --git a/src/drivers/intel/fsp2_0/ppi/mp_service_ppi.c b/src/drivers/intel/fsp2_0/ppi/mp_service_ppi.c index 5b964d51fb..03184e16ca 100644 --- a/src/drivers/intel/fsp2_0/ppi/mp_service_ppi.c +++ b/src/drivers/intel/fsp2_0/ppi/mp_service_ppi.c @@ -10,6 +10,7 @@ #include #define BSP_CPU_SLOT 0 +#define SINGLE_CHIP_PACKAGE 0 static efi_return_status_t mp_get_number_of_processors(const efi_pei_services **ignored1, efi_pei_mp_services_ppi *ignored2, @@ -31,6 +32,8 @@ static efi_return_status_t mp_get_processor_info(const efi_uintn_t processor_number, efi_processor_information *processor_info_buffer) { + unsigned int num_virt_cores, num_phys_cores; + if (cpu_index() < 0) return FSP_DEVICE_ERROR; @@ -48,7 +51,14 @@ static efi_return_status_t mp_get_processor_info(const if (processor_number == BSP_CPU_SLOT) processor_info_buffer->StatusFlag |= PROCESSOR_AS_BSP_BIT; - /* TODO: Fill EFI_CPU_PHYSICAL_LOCATION structure information */ + /* Fill EFI_CPU_PHYSICAL_LOCATION structure information */ + cpu_read_topology(&num_phys_cores, &num_virt_cores); + + /* FSP will add one to the value in this Package field */ + processor_info_buffer->Location.Package = SINGLE_CHIP_PACKAGE; + processor_info_buffer->Location.Core = num_phys_cores; + processor_info_buffer->Location.Thread = num_virt_cores; + return FSP_SUCCESS; } -- cgit v1.2.3