summaryrefslogtreecommitdiffstats
path: root/src/soc/intel/xeon_sp/spr/soc_util.c
diff options
context:
space:
mode:
authorPatrick Rudolph <patrick.rudolph@9elements.com>2023-07-14 17:44:33 +0200
committerFelix Held <felix-coreboot@felixheld.de>2023-07-18 13:45:14 +0000
commitac02857b975fdccc84709231088a098baf716c84 (patch)
treee089b70ff5802df2de0fb3fcba9d09f063302791 /src/soc/intel/xeon_sp/spr/soc_util.c
parentc56df92d9018cf6599446a818c1f6443b4de1fa9 (diff)
downloadcoreboot-ac02857b975fdccc84709231088a098baf716c84.tar.gz
coreboot-ac02857b975fdccc84709231088a098baf716c84.tar.bz2
coreboot-ac02857b975fdccc84709231088a098baf716c84.zip
soc/intel/xeon_sp: Skip empty sockets
The current Sapphire Rapids code assumes that all sockets have working CPUs. On multi-socket platforms a CPU might be missing or was disabled due to an error. The variable PlatformData.numofIIO and the variable SystemStatus.numCpus reflect the working CPUs, but not the actual socket count. Update the code to iterate over sockets until PlatformData.numofIIO IIOs have been found. This is required as FSP doesn't sort IIOs by working/non working status. This resolves invalid ACPI table generation and it fixes a crash as commands were sent to a disabled CPU. TEST: Disabled Socket1 on IBM/SBP1. Change-Id: I237b6392764bbdb3b96013f577a10a4394ba9c6e Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/76559 Reviewed-by: Arthur Heymans <arthur@aheymans.xyz> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src/soc/intel/xeon_sp/spr/soc_util.c')
-rw-r--r--src/soc/intel/xeon_sp/spr/soc_util.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/soc/intel/xeon_sp/spr/soc_util.c b/src/soc/intel/xeon_sp/spr/soc_util.c
index 67cb0638b029..f35214512137 100644
--- a/src/soc/intel/xeon_sp/spr/soc_util.c
+++ b/src/soc/intel/xeon_sp/spr/soc_util.c
@@ -129,7 +129,7 @@ uint32_t get_socket_stack_busno(uint32_t socket, uint32_t stack)
{
const IIO_UDS *hob = get_iio_uds();
- assert(socket < hob->SystemStatus.numCpus && stack < MAX_LOGIC_IIO_STACK);
+ assert(socket < CONFIG_MAX_SOCKET && stack < MAX_LOGIC_IIO_STACK);
return hob->PlatformData.IIO_resource[socket].StackRes[stack].BusBase;
}
@@ -138,7 +138,7 @@ uint32_t get_ubox_busno(uint32_t socket, uint8_t offset)
{
const IIO_UDS *hob = get_iio_uds();
- assert(socket < hob->SystemStatus.numCpus);
+ assert(socket < CONFIG_MAX_SOCKET);
for (int stack = 0; stack < MAX_LOGIC_IIO_STACK; ++stack) {
if (hob->PlatformData.IIO_resource[socket].StackRes[stack].Personality
== TYPE_UBOX)