[coreboot-gerrit] Change in coreboot[master]: soc/amd/common: Add generic create_struct call to wrapper
Marshall Dawson (Code Review)
gerrit at coreboot.org
Thu Jan 25 23:24:48 CET 2018
Marshall Dawson has uploaded this change for review. ( https://review.coreboot.org/23440
Change subject: soc/amd/common: Add generic create_struct call to wrapper
......................................................................
soc/amd/common: Add generic create_struct call to wrapper
Create a generic function that reports an unsuccessful call to
AmdCreateStruct().
Change-Id: I2654b4f21de5a2621086142681181a687be2c8e3
Signed-off-by: Marshall Dawson <marshalldawson3rd at gmail.com>
---
M src/soc/amd/common/block/pi/agesawrapper.c
1 file changed, 18 insertions(+), 6 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/40/23440/1
diff --git a/src/soc/amd/common/block/pi/agesawrapper.c b/src/soc/amd/common/block/pi/agesawrapper.c
index 6b27111..cd71998 100644
--- a/src/soc/amd/common/block/pi/agesawrapper.c
+++ b/src/soc/amd/common/block/pi/agesawrapper.c
@@ -69,6 +69,18 @@
return Status;
}
+static AGESA_STATUS create_struct(AMD_INTERFACE_PARAMS *interface_struct)
+{
+ AGESA_STATUS status = AmdCreateStruct(interface_struct);
+ if (status == AGESA_SUCCESS)
+ return status;
+
+ printk(BIOS_ERR, "Error: AmdCreateStruct() for 0x%x returned 0x%x. "
+ "Proper system initialization may not be possible.\n",
+ interface_struct->AgesaFunctionName, status);
+ return status;
+}
+
AGESA_STATUS agesawrapper_amdinitreset(void)
{
AGESA_STATUS status;
@@ -80,7 +92,7 @@
.NewStructPtr = &AmdResetParams,
.StdHeader.CalloutPtr = &GetBiosCallout
};
- AmdCreateStruct(&AmdParamStruct);
+ create_struct(&AmdParamStruct);
SetFchResetParams(&AmdResetParams.FchInterface);
timestamp_add_now(TS_AGESA_INIT_RESET_START);
@@ -103,7 +115,7 @@
.StdHeader.CalloutPtr = &GetBiosCallout,
};
- AmdCreateStruct(&AmdParamStruct);
+ create_struct(&AmdParamStruct);
AmdEarlyParamsPtr = (AMD_EARLY_PARAMS *)AmdParamStruct.NewStructPtr;
OemCustomizeInitEarly(AmdEarlyParamsPtr);
@@ -164,7 +176,7 @@
};
AMD_POST_PARAMS *PostParams;
- AmdCreateStruct(&AmdParamStruct);
+ create_struct(&AmdParamStruct);
PostParams = (AMD_POST_PARAMS *)AmdParamStruct.NewStructPtr;
PostParams->MemConfig.UmaMode = CONFIG_GFXUMA ? UMA_AUTO : UMA_NONE;
@@ -215,7 +227,7 @@
};
AMD_ENV_PARAMS *EnvParam;
- status = AmdCreateStruct(&AmdParamStruct);
+ status = create_struct(&AmdParamStruct);
EnvParam = (AMD_ENV_PARAMS *)AmdParamStruct.NewStructPtr;
SetFchEnvParams(&EnvParam->FchInterface);
@@ -270,7 +282,7 @@
/* Enable MMIO on AMD CPU Address Map Controller */
amd_initcpuio();
- AmdCreateStruct(&AmdParamStruct);
+ create_struct(&AmdParamStruct);
MidParam = (AMD_MID_PARAMS *)AmdParamStruct.NewStructPtr;
SetFchMidParams(&MidParam->FchInterface);
@@ -302,7 +314,7 @@
* NOTE: if not call amdcreatestruct, the initializer
* (AmdInitLateInitializer) would not be called.
*/
- AmdCreateStruct(&AmdParamStruct);
+ create_struct(&AmdParamStruct);
AmdLateParams = (AMD_LATE_PARAMS *)AmdParamStruct.NewStructPtr;
timestamp_add_now(TS_AGESA_INIT_LATE_START);
--
To view, visit https://review.coreboot.org/23440
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I2654b4f21de5a2621086142681181a687be2c8e3
Gerrit-Change-Number: 23440
Gerrit-PatchSet: 1
Gerrit-Owner: Marshall Dawson <marshalldawson3rd at gmail.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.coreboot.org/pipermail/coreboot-gerrit/attachments/20180125/06dda944/attachment-0001.html>
More information about the coreboot-gerrit
mailing list