diff options
author | Marshall Dawson <marshalldawson3rd@gmail.com> | 2017-12-13 20:59:23 -0700 |
---|---|---|
committer | Martin Roth <martinroth@google.com> | 2017-12-18 16:50:30 +0000 |
commit | 3aed84aa465bc522538c6454119afb9d6d20c82f (patch) | |
tree | ee3a1b83160339966caef29359a411e26a5e1795 | |
parent | 634428987370ad54d38715bba39373a27aa4c7bf (diff) | |
download | coreboot-3aed84aa465bc522538c6454119afb9d6d20c82f.tar.xz |
soc/amd/common: Clean up AGESA event log function
Clean up the source for agesawrapper_amdreadeventlog:
* shorten the name to help keep lines within 80 columns
* convert initializers to C99
* break the call from the callers' if() statements
* streamline the printk formatting
BUG=b:70671442
TEST=Build and run Kahlee, check console log
Change-Id: I402c75e4d65a592b9d1557c5852df03e48e206b9
Signed-off-by: Marshall Dawson <marshalldawson3rd@gmail.com>
Reviewed-on: https://review.coreboot.org/22884
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
-rw-r--r-- | src/soc/amd/common/block/include/amdblocks/agesawrapper.h | 2 | ||||
-rw-r--r-- | src/soc/amd/common/block/pi/agesawrapper.c | 50 |
2 files changed, 31 insertions, 21 deletions
diff --git a/src/soc/amd/common/block/include/amdblocks/agesawrapper.h b/src/soc/amd/common/block/include/amdblocks/agesawrapper.h index 08ac5968ca..1b4cde8228 100644 --- a/src/soc/amd/common/block/include/amdblocks/agesawrapper.h +++ b/src/soc/amd/common/block/include/amdblocks/agesawrapper.h @@ -40,7 +40,7 @@ AGESA_STATUS agesawrapper_amdinitenv(void); AGESA_STATUS agesawrapper_amdinitlate(void); AGESA_STATUS agesawrapper_amdinitpost(void); AGESA_STATUS agesawrapper_amdinitmid(void); -AGESA_STATUS agesawrapper_amdreadeventlog(UINT8 HeapStatus); +AGESA_STATUS agesawrapper_readeventlog(UINT8 HeapStatus); void *agesawrapper_getlateinitptr(int pick); AGESA_STATUS agesawrapper_amdlaterunaptask(UINT32 Func, UINTN Data, void *ConfigPtr); diff --git a/src/soc/amd/common/block/pi/agesawrapper.c b/src/soc/amd/common/block/pi/agesawrapper.c index cc572075af..5c85430d87 100644 --- a/src/soc/amd/common/block/pi/agesawrapper.c +++ b/src/soc/amd/common/block/pi/agesawrapper.c @@ -68,7 +68,8 @@ AGESA_STATUS agesawrapper_amdinitreset(void) status = AmdInitReset(&AmdResetParams); timestamp_add_now(TS_AGESA_INIT_RESET_DONE); - if (status != AGESA_SUCCESS) agesawrapper_amdreadeventlog(AmdParamStruct.StdHeader.HeapStatus); + if (status != AGESA_SUCCESS) + agesawrapper_readeventlog(AmdParamStruct.StdHeader.HeapStatus); AmdReleaseStruct (&AmdParamStruct); return status; } @@ -98,7 +99,8 @@ AGESA_STATUS agesawrapper_amdinitearly(void) status = AmdInitEarly ((AMD_EARLY_PARAMS *)AmdParamStruct.NewStructPtr); timestamp_add_now(TS_AGESA_INIT_EARLY_DONE); - if (status != AGESA_SUCCESS) agesawrapper_amdreadeventlog(AmdParamStruct.StdHeader.HeapStatus); + if (status != AGESA_SUCCESS) + agesawrapper_readeventlog(AmdParamStruct.StdHeader.HeapStatus); AmdReleaseStruct (&AmdParamStruct); return status; @@ -169,7 +171,8 @@ AGESA_STATUS agesawrapper_amdinitpost(void) (unsigned long)(PostParams->MemConfig.UmaBase) << 16 ); - if (status != AGESA_SUCCESS) agesawrapper_amdreadeventlog(PostParams->StdHeader.HeapStatus); + if (status != AGESA_SUCCESS) + agesawrapper_readeventlog(PostParams->StdHeader.HeapStatus); AmdReleaseStruct (&AmdParamStruct); return status; @@ -203,7 +206,8 @@ AGESA_STATUS agesawrapper_amdinitenv(void) status = AmdInitEnv (EnvParam); timestamp_add_now(TS_AGESA_INIT_ENV_DONE); - if (status != AGESA_SUCCESS) agesawrapper_amdreadeventlog(EnvParam->StdHeader.HeapStatus); + if (status != AGESA_SUCCESS) + agesawrapper_readeventlog(EnvParam->StdHeader.HeapStatus); /* Initialize Subordinate Bus Number and Secondary Bus Number * In platform BIOS this address is allocated by PCI enumeration code Modify D1F0x18 @@ -274,7 +278,8 @@ AGESA_STATUS agesawrapper_amdinitmid(void) status = AmdInitMid ((AMD_MID_PARAMS *)AmdParamStruct.NewStructPtr); timestamp_add_now(TS_AGESA_INIT_MID_DONE); - if (status != AGESA_SUCCESS) agesawrapper_amdreadeventlog(AmdParamStruct.StdHeader.HeapStatus); + if (status != AGESA_SUCCESS) + agesawrapper_readeventlog(AmdParamStruct.StdHeader.HeapStatus); AmdReleaseStruct (&AmdParamStruct); return status; @@ -306,7 +311,7 @@ AGESA_STATUS agesawrapper_amdinitlate(void) timestamp_add_now(TS_AGESA_INIT_LATE_DONE); if (Status != AGESA_SUCCESS) { - agesawrapper_amdreadeventlog(AmdLateParams->StdHeader.HeapStatus); + agesawrapper_readeventlog(AmdLateParams->StdHeader.HeapStatus); ASSERT(Status == AGESA_SUCCESS); } @@ -351,31 +356,36 @@ AGESA_STATUS agesawrapper_amdlaterunaptask ( Status = AmdLateRunApTask (&ApExeParams); if (Status != AGESA_SUCCESS) { - /* agesawrapper_amdreadeventlog(); */ + /* agesawrapper_readeventlog(); */ ASSERT(Status == AGESA_SUCCESS); } return Status; } -AGESA_STATUS agesawrapper_amdreadeventlog (UINT8 HeapStatus) +AGESA_STATUS agesawrapper_readeventlog(UINT8 HeapStatus) { AGESA_STATUS Status; - EVENT_PARAMS AmdEventParams; + EVENT_PARAMS AmdEventParams = { + .StdHeader.CalloutPtr = &GetBiosCallout, + .StdHeader.HeapStatus = HeapStatus, + }; - memset(&AmdEventParams, 0, sizeof(AmdEventParams)); + Status = AmdReadEventLog(&AmdEventParams); + if (AmdEventParams.EventClass) + printk(BIOS_DEBUG, "AGESA Event Log:\n"); - AmdEventParams.StdHeader.AltImageBasePtr = 0; - AmdEventParams.StdHeader.CalloutPtr = &GetBiosCallout; - AmdEventParams.StdHeader.Func = 0; - AmdEventParams.StdHeader.ImageBasePtr = 0; - AmdEventParams.StdHeader.HeapStatus = HeapStatus; - Status = AmdReadEventLog (&AmdEventParams); while (AmdEventParams.EventClass != 0) { - printk(BIOS_DEBUG,"\nEventLog: EventClass = %x, EventInfo = %x.\n", (unsigned int)AmdEventParams.EventClass,(unsigned int)AmdEventParams.EventInfo); - printk(BIOS_DEBUG," Param1 = %x, Param2 = %x.\n",(unsigned int)AmdEventParams.DataParam1, (unsigned int)AmdEventParams.DataParam2); - printk(BIOS_DEBUG," Param3 = %x, Param4 = %x.\n",(unsigned int)AmdEventParams.DataParam3, (unsigned int)AmdEventParams.DataParam4); - Status = AmdReadEventLog (&AmdEventParams); + printk(BIOS_DEBUG, " Class = %x, Info = %x," + " Param1 = 0x%x, Param2 = 0x%x" + " Param3 = 0x%x, Param4 = 0x%x\n", + (u32)AmdEventParams.EventClass, + (u32)AmdEventParams.EventInfo, + (u32)AmdEventParams.DataParam1, + (u32)AmdEventParams.DataParam2, + (u32)AmdEventParams.DataParam3, + (u32)AmdEventParams.DataParam4); + Status = AmdReadEventLog(&AmdEventParams); } return Status; |