soc/amd/common: Always set GetBiosCallout

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 <kyosti.malkki@gmail.com>
Reviewed-on: https://review.coreboot.org/27111
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>
diff --git a/src/soc/amd/common/block/pi/agesawrapper.c b/src/soc/amd/common/block/pi/agesawrapper.c
index 436bf8f..a056141 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 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 @@
 		.AllocationMethod = ByHost,
 		.NewStructSize = sizeof(AMD_RESET_PARAMS),
 		.NewStructPtr = &ResetParams,
-		.StdHeader.CalloutPtr = &GetBiosCallout
 	};
 	create_struct(&AmdParamStruct);
 	SetFchResetParams(&ResetParams.FchInterface);
@@ -120,7 +123,6 @@
 	AMD_INTERFACE_PARAMS AmdParamStruct = {
 		.AgesaFunctionName = AMD_INIT_EARLY,
 		.AllocationMethod = PreMemHeap,
-		.StdHeader.CalloutPtr = &GetBiosCallout,
 	};
 
 	create_struct(&AmdParamStruct);
@@ -180,7 +182,6 @@
 	AMD_INTERFACE_PARAMS AmdParamStruct = {
 		.AgesaFunctionName = AMD_INIT_POST,
 		.AllocationMethod = PreMemHeap,
-		.StdHeader.CalloutPtr = &GetBiosCallout,
 	};
 	AMD_POST_PARAMS *PostParams;
 
@@ -238,7 +239,6 @@
 	AMD_INTERFACE_PARAMS AmdParamStruct = {
 		.AgesaFunctionName = AMD_INIT_ENV,
 		.AllocationMethod = PostMemDram,
-		.StdHeader.CalloutPtr = &GetBiosCallout,
 	};
 	AMD_ENV_PARAMS *EnvParams;
 
@@ -291,7 +291,6 @@
 	AMD_INTERFACE_PARAMS AmdParamStruct = {
 		.AgesaFunctionName = AMD_INIT_MID,
 		.AllocationMethod = PostMemDram,
-		.StdHeader.CalloutPtr = &GetBiosCallout,
 	};
 	AMD_MID_PARAMS *MidParams;
 
@@ -321,7 +320,6 @@
 	AMD_INTERFACE_PARAMS AmdParamStruct = {
 		.AgesaFunctionName = AMD_INIT_LATE,
 		.AllocationMethod = PostMemDram,
-		.StdHeader.CalloutPtr = &GetBiosCallout,
 	};
 	AMD_LATE_PARAMS *LateParams;
 
@@ -391,7 +389,6 @@
 	AMD_INTERFACE_PARAMS AmdParamStruct = {
 		.AgesaFunctionName = AMD_INIT_RTB,
 		.AllocationMethod = PostMemDram,
-		.StdHeader.CalloutPtr = &GetBiosCallout,
 	};
 	AMD_RTB_PARAMS *RtbParams;
 
@@ -425,7 +422,6 @@
 	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 @@
 	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 @@
 	AMD_INTERFACE_PARAMS AmdParamStruct = {
 		.AgesaFunctionName = AMD_S3FINAL_RESTORE,
 		.AllocationMethod = ByHost,
-		.StdHeader.CalloutPtr = &GetBiosCallout,
 	};
 	AMD_S3FINAL_PARAMS *S3FinalParams;
 	size_t vol_size;