Krystian Hebel has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/30475
Change subject: agesawrapper.c: check if HOP_COUNT_TABLE exists before AmdInitLate() ......................................................................
agesawrapper.c: check if HOP_COUNT_TABLE exists before AmdInitLate()
If HOP_COUNT_TABLE doesn't exist AmdInitLate() returns error when creating CDIT, which scaries users. This patch checks if mentioned table exists and turns off CDIT generation when it doesn't.
After this patch AGESA_UNSUPPORTED is returned due to a bug in AGESA which cannot be walked around without disabling DMI table generation (`AGESA_STATUS Status = TRUE`, present in open source version of AGESA too).
Change-Id: I868aa840ad3495a66a9d70b7803af237e7d5f049 Signed-off-by: Krystian Hebel krystian.hebel@3mdeb.com --- M src/northbridge/amd/pi/agesawrapper.c 1 file changed, 15 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/75/30475/1
diff --git a/src/northbridge/amd/pi/agesawrapper.c b/src/northbridge/amd/pi/agesawrapper.c index 3021b81..dfce5b1 100644 --- a/src/northbridge/amd/pi/agesawrapper.c +++ b/src/northbridge/amd/pi/agesawrapper.c @@ -255,12 +255,18 @@ AGESA_STATUS Status; AMD_INTERFACE_PARAMS AmdParamStruct; AMD_LATE_PARAMS *AmdLateParams; + AGESA_BUFFER_PARAMS BufParams;
LibAmdMemFill (&AmdParamStruct, 0, sizeof(AMD_INTERFACE_PARAMS), &(AmdParamStruct.StdHeader));
+ LibAmdMemFill (&BufParams, + 0, + sizeof(AGESA_BUFFER_PARAMS), + &(BufParams.StdHeader)); + AmdParamStruct.AgesaFunctionName = AMD_INIT_LATE; AmdParamStruct.AllocationMethod = PostMemDram; AmdParamStruct.StdHeader.AltImageBasePtr = 0; @@ -274,6 +280,15 @@ AmdLateParams = (AMD_LATE_PARAMS *)AmdParamStruct.NewStructPtr; AmdLateParams->GnbLateConfiguration.GnbIoapicId = CONFIG_MAX_CPUS + 1; AmdLateParams->GnbLateConfiguration.FchIoapicId = CONFIG_MAX_CPUS; + + /* Code for creating CDIT requires hop count table. If it is not + * present AGESA_ERROR is returned, which confuses users. */ + BufParams.BufferHandle = HOP_COUNT_TABLE_HANDLE; + Status = HeapManagerCallout(AGESA_LOCATE_BUFFER, 0, &BufParams); + if (Status != AGESA_SUCCESS) { + AmdLateParams->PlatformConfig.UserOptionCdit = 0; + } + Status = AmdInitLate(AmdLateParams); if (Status != AGESA_SUCCESS) { agesawrapper_amdreadeventlog(AmdLateParams->StdHeader.HeapStatus);