Attention is currently required from: Christian Walter, Johnny Lin, Tim Chu.
Arthur Heymans has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/77600?usp=email )
Change subject: soc/intel/xeon_sp: Scan and allocate resources on all stacks ......................................................................
soc/intel/xeon_sp: Scan and allocate resources on all stacks
The code can now deal with stacks that have no resources so just hook them all up.
Signed-off-by: Arthur Heymans arthur@aheymans.xyz Change-Id: Ie3e19bbd4683237ecfc427d32aa29f55964d80a5 --- M src/soc/intel/xeon_sp/acpi.c M src/soc/intel/xeon_sp/chip_common.c M src/soc/intel/xeon_sp/cpx/soc_util.c M src/soc/intel/xeon_sp/include/soc/util.h M src/soc/intel/xeon_sp/memmap.c M src/soc/intel/xeon_sp/skx/soc_util.c M src/soc/intel/xeon_sp/spr/soc_util.c M src/soc/intel/xeon_sp/util.c 8 files changed, 8 insertions(+), 24 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/00/77600/1
diff --git a/src/soc/intel/xeon_sp/acpi.c b/src/soc/intel/xeon_sp/acpi.c index 61d5186..80c95de 100644 --- a/src/soc/intel/xeon_sp/acpi.c +++ b/src/soc/intel/xeon_sp/acpi.c @@ -104,9 +104,9 @@ for (int stack = 0; stack < MAX_IIO_STACK; ++stack) { const STACK_RES *ri = &hob->PlatformData.IIO_resource[socket].StackRes[stack]; - if (!stack_needs_resource_alloc(ri)) - continue; uint32_t ioapic_base = ri->IoApicBase; + if (ioapic_base == 0) + continue; assert(index < ARRAY_SIZE(xeonsp_ioapic_bases)); xeonsp_ioapic_bases[index++] = ioapic_base; if (!CONFIG(XEON_SP_HAVE_IIO_IOAPIC)) diff --git a/src/soc/intel/xeon_sp/chip_common.c b/src/soc/intel/xeon_sp/chip_common.c index 8e4533e..38562a7 100644 --- a/src/soc/intel/xeon_sp/chip_common.c +++ b/src/soc/intel/xeon_sp/chip_common.c @@ -122,7 +122,7 @@ continue;
const STACK_RES *ri = &hob->PlatformData.IIO_resource[s].StackRes[x]; - if (!stack_needs_resource_alloc(ri)) + if (ri->BusBase < ri->BusLimit) continue; struct device_path path; path.type = DEVICE_PATH_DOMAIN; diff --git a/src/soc/intel/xeon_sp/cpx/soc_util.c b/src/soc/intel/xeon_sp/cpx/soc_util.c index fb76014..64efb61 100644 --- a/src/soc/intel/xeon_sp/cpx/soc_util.c +++ b/src/soc/intel/xeon_sp/cpx/soc_util.c @@ -25,14 +25,9 @@ return *memmap_addr; }
-bool stack_needs_resource_alloc(const STACK_RES *res) -{ - return res->Personality == TYPE_UBOX_IIO; -} - bool is_iio_stack_res(const STACK_RES *res) { - return stack_needs_resource_alloc(res); + return res->Personality == TYPE_UBOX_IIO; }
uint8_t get_stack_busno(const uint8_t stack) diff --git a/src/soc/intel/xeon_sp/include/soc/util.h b/src/soc/intel/xeon_sp/include/soc/util.h index 8482efd..8e80c64 100644 --- a/src/soc/intel/xeon_sp/include/soc/util.h +++ b/src/soc/intel/xeon_sp/include/soc/util.h @@ -23,7 +23,6 @@ };
void get_iiostack_info(struct iiostack_resource *info); -bool stack_needs_resource_alloc(const STACK_RES *res); bool is_iio_stack_res(const STACK_RES *res); void bios_done_msr(void *unused);
diff --git a/src/soc/intel/xeon_sp/memmap.c b/src/soc/intel/xeon_sp/memmap.c index e73143f..a9236a9 100644 --- a/src/soc/intel/xeon_sp/memmap.c +++ b/src/soc/intel/xeon_sp/memmap.c @@ -74,7 +74,7 @@ for (int stack = 0; stack < MAX_IIO_STACK; ++stack) { const STACK_RES *ri = &hob->PlatformData.IIO_resource[socket].StackRes[stack]; - if (!stack_needs_resource_alloc(ri)) + if (ri->VtdBarAddress == 0) continue; uint8_t bus = ri->BusBase; dev = VTD_DEV(bus); diff --git a/src/soc/intel/xeon_sp/skx/soc_util.c b/src/soc/intel/xeon_sp/skx/soc_util.c index d7e3efc1..93f28d0 100644 --- a/src/soc/intel/xeon_sp/skx/soc_util.c +++ b/src/soc/intel/xeon_sp/skx/soc_util.c @@ -54,15 +54,9 @@ return memmap_addr; }
-bool stack_needs_resource_alloc(const STACK_RES *res) -{ - // TODO: do we have situation with only bux 0 and one stack? - return res->BusBase < res->BusLimit; -} - bool is_iio_stack_res(const STACK_RES *res) { - return stack_needs_resource_alloc(res); + return res->BusBase < res->BusLimit; }
uint8_t get_stack_busno(const uint8_t stack) diff --git a/src/soc/intel/xeon_sp/spr/soc_util.c b/src/soc/intel/xeon_sp/spr/soc_util.c index e885bba..c87a8b0 100644 --- a/src/soc/intel/xeon_sp/spr/soc_util.c +++ b/src/soc/intel/xeon_sp/spr/soc_util.c @@ -68,11 +68,6 @@ return hob->Element; }
-bool stack_needs_resource_alloc(const STACK_RES *res) -{ - return res->Personality == TYPE_UBOX_IIO || res->Personality == TYPE_DINO; -} - bool is_iio_stack_res(const STACK_RES *res) { return res->Personality == TYPE_UBOX_IIO; diff --git a/src/soc/intel/xeon_sp/util.c b/src/soc/intel/xeon_sp/util.c index c9f4c55..3780afb 100644 --- a/src/soc/intel/xeon_sp/util.c +++ b/src/soc/intel/xeon_sp/util.c @@ -1,5 +1,6 @@ /* SPDX-License-Identifier: GPL-2.0-only */
+#include "include/soc/util.h" #include <assert.h> #include <commonlib/sort.h> #include <console/console.h> @@ -114,7 +115,7 @@ for (int x = 0; x < MAX_IIO_STACK; ++x) { const STACK_RES *ri; ri = &hob->PlatformData.IIO_resource[socket].StackRes[x]; - if (!stack_needs_resource_alloc(ri)) + if (!is_iio_stack_res(ri)) continue; assert(info->no_of_stacks < (CONFIG_MAX_SOCKET * MAX_IIO_STACK)); memcpy(&info->res[info->no_of_stacks++], ri, sizeof(STACK_RES));