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 <subrata.banik@intel.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/44390 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Angel Pons <th3fanbus@gmail.com> Reviewed-by: Sridhar Siricilla <sridhar.siricilla@intel.com> Reviewed-by: Aamir Bohra <aamir.bohra@intel.com>
This commit is contained in:
parent
e0836b0fcb
commit
ef04f4e3d3
|
@ -10,6 +10,7 @@
|
||||||
#include <intelblocks/mp_init.h>
|
#include <intelblocks/mp_init.h>
|
||||||
|
|
||||||
#define BSP_CPU_SLOT 0
|
#define BSP_CPU_SLOT 0
|
||||||
|
#define SINGLE_CHIP_PACKAGE 0
|
||||||
|
|
||||||
static efi_return_status_t mp_get_number_of_processors(const
|
static efi_return_status_t mp_get_number_of_processors(const
|
||||||
efi_pei_services **ignored1, efi_pei_mp_services_ppi *ignored2,
|
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_uintn_t processor_number,
|
||||||
efi_processor_information *processor_info_buffer)
|
efi_processor_information *processor_info_buffer)
|
||||||
{
|
{
|
||||||
|
unsigned int num_virt_cores, num_phys_cores;
|
||||||
|
|
||||||
if (cpu_index() < 0)
|
if (cpu_index() < 0)
|
||||||
return FSP_DEVICE_ERROR;
|
return FSP_DEVICE_ERROR;
|
||||||
|
|
||||||
|
@ -48,7 +51,14 @@ static efi_return_status_t mp_get_processor_info(const
|
||||||
if (processor_number == BSP_CPU_SLOT)
|
if (processor_number == BSP_CPU_SLOT)
|
||||||
processor_info_buffer->StatusFlag |= PROCESSOR_AS_BSP_BIT;
|
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;
|
return FSP_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue