soc/intel/xeon_sp: Introduce soc_cpu_is_enabled

Add a function to check if the CPU placed at the specified socket was
found usable during QPI init. This is useful for multi-socket
platforms were a CPU is missing or has been disabled due to an error.

Change-Id: I135968fcc905928b9bc6511e3ddbd7d12bad0096
Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/76556
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
This commit is contained in:
Patrick Rudolph 2023-07-14 17:18:18 +02:00 committed by Lean Sheng Tan
parent 971ea286dd
commit b096d625d5
3 changed files with 14 additions and 1 deletions

View File

@ -13,6 +13,7 @@ msr_t read_msr_ppin(void);
int get_platform_thread_count(void); int get_platform_thread_count(void);
const IIO_UDS *get_iio_uds(void); const IIO_UDS *get_iio_uds(void);
unsigned int soc_get_num_cpus(void); unsigned int soc_get_num_cpus(void);
bool soc_cpu_is_enabled(const size_t idx);
void set_bios_init_completion(void); void set_bios_init_completion(void);
uint8_t soc_get_iio_ioapicid(int socket, int stack); uint8_t soc_get_iio_ioapicid(int socket, int stack);

View File

@ -394,7 +394,7 @@ void uncore_inject_dsdt(const struct device *device)
const STACK_RES *ri = const STACK_RES *ri =
&hob->PlatformData.IIO_resource[socket].StackRes[stack]; &hob->PlatformData.IIO_resource[socket].StackRes[stack];
stack_enabled = hob->PlatformData.IIO_resource[socket].Valid && stack_enabled = soc_cpu_is_enabled(socket) &&
ri->Personality < TYPE_RESERVED; ri->Personality < TYPE_RESERVED;
printk(BIOS_DEBUG, "%s processing socket: %d, stack: %d, type: %d\n", printk(BIOS_DEBUG, "%s processing socket: %d, stack: %d, type: %d\n",

View File

@ -118,6 +118,18 @@ void get_iiostack_info(struct iiostack_resource *info)
} }
} }
/*
* Returns true if the CPU in the specified socket was found
* during QPI init, false otherwise.
*/
bool soc_cpu_is_enabled(const size_t idx)
{
const IIO_UDS *hob = get_iio_uds();
assert(idx < CONFIG_MAX_SOCKET);
return hob->PlatformData.IIO_resource[idx].Valid;
}
unsigned int soc_get_num_cpus(void) unsigned int soc_get_num_cpus(void)
{ {
/* The FSP IIO UDS HOB has field numCpus, it is actually socket count */ /* The FSP IIO UDS HOB has field numCpus, it is actually socket count */