From 4cdd2f8ce112bdad7f9db9d2feec171e45ca24f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ky=C3=B6sti=20M=C3=A4lkki?= Date: Thu, 14 Jun 2018 06:49:38 +0300 Subject: soc/amd/common: Always set GetBiosCallout MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The entire StdHeader field is really supposed to be forked from a template for each entry into the AGESA API. Current code assumes only Callout would be relevant, which is not quite the case. Change-Id: I0cc66d01d62fa8dc6bb7c9f9fab6fa4753827554 Signed-off-by: Kyösti Mälkki Reviewed-on: https://review.coreboot.org/27111 Tested-by: build bot (Jenkins) Reviewed-by: Garrett Kirkendall Reviewed-by: Marshall Dawson --- src/soc/amd/common/block/pi/agesawrapper.c | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) (limited to 'src/soc/amd/common') diff --git a/src/soc/amd/common/block/pi/agesawrapper.c b/src/soc/amd/common/block/pi/agesawrapper.c index 436bf8f253..a05614151e 100644 --- a/src/soc/amd/common/block/pi/agesawrapper.c +++ b/src/soc/amd/common/block/pi/agesawrapper.c @@ -2,6 +2,7 @@ * This file is part of the coreboot project. * * Copyright (C) 2012 - 2017 Advanced Micro Devices, Inc. + * Copyright (C) 2018 Kyösti Mälkki * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -75,6 +76,9 @@ static AGESA_STATUS agesawrapper_readeventlog(UINT8 HeapStatus) static AGESA_STATUS create_struct(AMD_INTERFACE_PARAMS *interface_struct) { + /* Should clone entire StdHeader here. */ + interface_struct->StdHeader.CalloutPtr = &GetBiosCallout; + AGESA_STATUS status = AmdCreateStruct(interface_struct); if (status == AGESA_SUCCESS) return status; @@ -98,7 +102,6 @@ AGESA_STATUS agesawrapper_amdinitreset(void) .AllocationMethod = ByHost, .NewStructSize = sizeof(AMD_RESET_PARAMS), .NewStructPtr = &ResetParams, - .StdHeader.CalloutPtr = &GetBiosCallout }; create_struct(&AmdParamStruct); SetFchResetParams(&ResetParams.FchInterface); @@ -120,7 +123,6 @@ AGESA_STATUS agesawrapper_amdinitearly(void) AMD_INTERFACE_PARAMS AmdParamStruct = { .AgesaFunctionName = AMD_INIT_EARLY, .AllocationMethod = PreMemHeap, - .StdHeader.CalloutPtr = &GetBiosCallout, }; create_struct(&AmdParamStruct); @@ -180,7 +182,6 @@ AGESA_STATUS agesawrapper_amdinitpost(void) AMD_INTERFACE_PARAMS AmdParamStruct = { .AgesaFunctionName = AMD_INIT_POST, .AllocationMethod = PreMemHeap, - .StdHeader.CalloutPtr = &GetBiosCallout, }; AMD_POST_PARAMS *PostParams; @@ -238,7 +239,6 @@ AGESA_STATUS agesawrapper_amdinitenv(void) AMD_INTERFACE_PARAMS AmdParamStruct = { .AgesaFunctionName = AMD_INIT_ENV, .AllocationMethod = PostMemDram, - .StdHeader.CalloutPtr = &GetBiosCallout, }; AMD_ENV_PARAMS *EnvParams; @@ -291,7 +291,6 @@ AGESA_STATUS agesawrapper_amdinitmid(void) AMD_INTERFACE_PARAMS AmdParamStruct = { .AgesaFunctionName = AMD_INIT_MID, .AllocationMethod = PostMemDram, - .StdHeader.CalloutPtr = &GetBiosCallout, }; AMD_MID_PARAMS *MidParams; @@ -321,7 +320,6 @@ AGESA_STATUS agesawrapper_amdinitlate(void) AMD_INTERFACE_PARAMS AmdParamStruct = { .AgesaFunctionName = AMD_INIT_LATE, .AllocationMethod = PostMemDram, - .StdHeader.CalloutPtr = &GetBiosCallout, }; AMD_LATE_PARAMS *LateParams; @@ -391,7 +389,6 @@ AGESA_STATUS agesawrapper_amdinitrtb(void) AMD_INTERFACE_PARAMS AmdParamStruct = { .AgesaFunctionName = AMD_INIT_RTB, .AllocationMethod = PostMemDram, - .StdHeader.CalloutPtr = &GetBiosCallout, }; AMD_RTB_PARAMS *RtbParams; @@ -425,7 +422,6 @@ AGESA_STATUS agesawrapper_amdinitresume(void) AMD_INTERFACE_PARAMS AmdParamStruct = { .AgesaFunctionName = AMD_INIT_RESUME, .AllocationMethod = PreMemHeap, - .StdHeader.CalloutPtr = &GetBiosCallout, }; AMD_RESUME_PARAMS *InitResumeParams; size_t nv_size; @@ -457,7 +453,6 @@ AGESA_STATUS agesawrapper_amds3laterestore(void) AMD_INTERFACE_PARAMS AmdParamStruct = { .AgesaFunctionName = AMD_S3LATE_RESTORE, .AllocationMethod = ByHost, - .StdHeader.CalloutPtr = &GetBiosCallout, }; AMD_S3LATE_PARAMS *S3LateParams; size_t vol_size; @@ -493,7 +488,6 @@ AGESA_STATUS agesawrapper_amds3finalrestore(void) AMD_INTERFACE_PARAMS AmdParamStruct = { .AgesaFunctionName = AMD_S3FINAL_RESTORE, .AllocationMethod = ByHost, - .StdHeader.CalloutPtr = &GetBiosCallout, }; AMD_S3FINAL_PARAMS *S3FinalParams; size_t vol_size; -- cgit v1.2.3