diff options
author | Kyösti Mälkki <kyosti.malkki@gmail.com> | 2018-06-14 06:57:05 +0300 |
---|---|---|
committer | Patrick Georgi <pgeorgi@google.com> | 2018-07-02 07:28:04 +0000 |
commit | 108fb8a37e06603d4bebbd784f2c1955ebbb70f8 (patch) | |
tree | a71e5793b4d45fd013019f48bf0ead47f9087e2f /src | |
parent | 58f68e80ec5f9f3d5cf65d6b9360030109b420e0 (diff) |
soc/amd/common: Fix agesawrapper CreateStruct calls
When AllocationMethod == ByHost, buffer has to be
provided by caller.
Improve code symmetry, the named parameter is now
always pointer to the struct.
Change-Id: I2085f7d5d63ef96f4bd9d5194af099634c402820
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: https://review.coreboot.org/27112
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Garrett Kirkendall <garrett.kirkendall@amd.corp-partner.google.com>
Reviewed-by: Marshall Dawson <marshalldawson3rd@gmail.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/soc/amd/common/block/pi/agesawrapper.c | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/src/soc/amd/common/block/pi/agesawrapper.c b/src/soc/amd/common/block/pi/agesawrapper.c index a05614151e..6fe8e578df 100644 --- a/src/soc/amd/common/block/pi/agesawrapper.c +++ b/src/soc/amd/common/block/pi/agesawrapper.c @@ -96,18 +96,22 @@ static AGESA_STATUS create_struct(AMD_INTERFACE_PARAMS *interface_struct) AGESA_STATUS agesawrapper_amdinitreset(void) { AGESA_STATUS status; - AMD_RESET_PARAMS ResetParams; + AMD_RESET_PARAMS _ResetParams; AMD_INTERFACE_PARAMS AmdParamStruct = { .AgesaFunctionName = AMD_INIT_RESET, .AllocationMethod = ByHost, .NewStructSize = sizeof(AMD_RESET_PARAMS), - .NewStructPtr = &ResetParams, + .NewStructPtr = &_ResetParams, }; + AMD_RESET_PARAMS *ResetParams; + create_struct(&AmdParamStruct); - SetFchResetParams(&ResetParams.FchInterface); + + ResetParams = (AMD_RESET_PARAMS *)AmdParamStruct.NewStructPtr; + SetFchResetParams(&ResetParams->FchInterface); timestamp_add_now(TS_AGESA_INIT_RESET_START); - status = AmdInitReset(&ResetParams); + status = AmdInitReset(ResetParams); timestamp_add_now(TS_AGESA_INIT_RESET_DONE); if (status != AGESA_SUCCESS) @@ -450,9 +454,12 @@ AGESA_STATUS agesawrapper_amdinitresume(void) AGESA_STATUS agesawrapper_amds3laterestore(void) { AGESA_STATUS Status; + AMD_S3LATE_PARAMS _S3LateParams; AMD_INTERFACE_PARAMS AmdParamStruct = { .AgesaFunctionName = AMD_S3LATE_RESTORE, .AllocationMethod = ByHost, + .NewStructSize = sizeof(AMD_S3LATE_PARAMS), + .NewStructPtr = &_S3LateParams, }; AMD_S3LATE_PARAMS *S3LateParams; size_t vol_size; @@ -485,9 +492,12 @@ AGESA_STATUS agesawrapper_amds3laterestore(void) AGESA_STATUS agesawrapper_amds3finalrestore(void) { AGESA_STATUS Status; + AMD_S3FINAL_PARAMS _S3FinalParams; AMD_INTERFACE_PARAMS AmdParamStruct = { .AgesaFunctionName = AMD_S3FINAL_RESTORE, .AllocationMethod = ByHost, + .NewStructSize = sizeof(AMD_S3FINAL_PARAMS), + .NewStructPtr = &_S3FinalParams, }; AMD_S3FINAL_PARAMS *S3FinalParams; size_t vol_size; |