Marshall Dawson has uploaded this change for review. ( https://review.coreboot.org/22885
Change subject: soc/amd/common: Make AGESA wrapper build in any stage ......................................................................
soc/amd/common: Make AGESA wrapper build in any stage
Convert the global variables to CAR_GLOBALs and modify their access methods. Remove all checks for __PRE_RAM__.
BUG=b:70671590 TEST=Build and boot Kahlee
Change-Id: I7a35141f212f340c157d57fde8daf93c0c383af8 Signed-off-by: Marshall Dawson marshalldawson3rd@gmail.com --- M src/soc/amd/common/block/pi/agesawrapper.c 1 file changed, 31 insertions(+), 39 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/85/22885/1
diff --git a/src/soc/amd/common/block/pi/agesawrapper.c b/src/soc/amd/common/block/pi/agesawrapper.c index b9931d2..c6ff89e 100644 --- a/src/soc/amd/common/block/pi/agesawrapper.c +++ b/src/soc/amd/common/block/pi/agesawrapper.c @@ -26,19 +26,16 @@ void __attribute__((weak)) SetMemParams(AMD_POST_PARAMS *PostParams) {} void __attribute__((weak)) OemPostParams(AMD_POST_PARAMS *PostParams) {}
-#ifndef __PRE_RAM__ /* ACPI table pointers returned by AmdInitLate */ -static void *DmiTable; -static void *AcpiPstate; -static void *AcpiSrat; -static void *AcpiSlit; - -static void *AcpiWheaMce; -static void *AcpiWheaCmc; -static void *AcpiAlib; -static void *AcpiIvrs; -static void *AcpiCrat; -#endif /* #ifndef __PRE_RAM__ */ +static void *DmiTable CAR_GLOBAL; +static void *AcpiPstate CAR_GLOBAL; +static void *AcpiSrat CAR_GLOBAL; +static void *AcpiSlit CAR_GLOBAL; +static void *AcpiWheaMce CAR_GLOBAL; +static void *AcpiWheaCmc CAR_GLOBAL; +static void *AcpiAlib CAR_GLOBAL; +static void *AcpiIvrs CAR_GLOBAL; +static void *AcpiCrat CAR_GLOBAL;
static AGESA_STATUS agesawrapper_readeventlog(UINT8 HeapStatus) { @@ -244,33 +241,31 @@ return status; }
-#ifndef __PRE_RAM__ VOID* agesawrapper_getlateinitptr (int pick) { switch (pick) { case PICK_DMI: - return DmiTable; + return car_get_var(DmiTable); case PICK_PSTATE: - return AcpiPstate; + return car_get_var(AcpiPstate); case PICK_SRAT: - return AcpiSrat; + return car_get_var(AcpiSrat); case PICK_SLIT: - return AcpiSlit; + return car_get_var(AcpiSlit); case PICK_WHEA_MCE: - return AcpiWheaMce; + return car_get_var(AcpiWheaMce); case PICK_WHEA_CMC: - return AcpiWheaCmc; + return car_get_var(AcpiWheaCmc); case PICK_ALIB: - return AcpiAlib; + return car_get_var(AcpiAlib); case PICK_IVRS: - return AcpiIvrs; + return car_get_var(AcpiIvrs); case PICK_CRAT: - return AcpiCrat; + return car_get_var(AcpiCrat); default: return NULL; } } -#endif /* #ifndef __PRE_RAM__ */
AGESA_STATUS agesawrapper_amdinitmid(void) { @@ -313,7 +308,6 @@ return status; }
-#ifndef __PRE_RAM__ AGESA_STATUS agesawrapper_amdinitlate(void) { AGESA_STATUS Status; @@ -343,26 +337,24 @@ ASSERT(Status == AGESA_SUCCESS); }
- DmiTable = AmdLateParams->DmiTable; - AcpiPstate = AmdLateParams->AcpiPState; + car_set_var(DmiTable, AmdLateParams->DmiTable); + car_set_var(AcpiPstate, AmdLateParams->AcpiPState); + car_set_var(AcpiWheaMce, AmdLateParams->AcpiWheaMce); + car_set_var(AcpiWheaCmc, AmdLateParams->AcpiWheaCmc); + car_set_var(AcpiAlib, AmdLateParams->AcpiAlib); + car_set_var(AcpiIvrs, AmdLateParams->AcpiIvrs); + car_set_var(AcpiCrat, AmdLateParams->AcpiCrat);
- AcpiWheaMce = AmdLateParams->AcpiWheaMce; - AcpiWheaCmc = AmdLateParams->AcpiWheaCmc; - AcpiAlib = AmdLateParams->AcpiAlib; - AcpiIvrs = AmdLateParams->AcpiIvrs; - AcpiCrat = AmdLateParams->AcpiCrat; - - printk(BIOS_DEBUG, "DmiTable:%x, AcpiPstatein: %x, AcpiSrat:%x," - "AcpiSlit:%x, Mce:%x, Cmc:%x," - "Alib:%x, AcpiIvrs:%x in %s\n", - (unsigned int)DmiTable, (unsigned int)AcpiPstate, (unsigned int)AcpiSrat, - (unsigned int)AcpiSlit, (unsigned int)AcpiWheaMce, (unsigned int)AcpiWheaCmc, - (unsigned int)AcpiAlib, (unsigned int)AcpiIvrs, __func__); + printk(BIOS_SPEW, "\tDmiTable %p, AcpiPstatein %p, AcpiSrat %p\n\t" + "AcpiSlit %p, Mce %p, Cmc %p, Alib %p, AcpiIvrs %p\n", + car_get_var(DmiTable), car_get_var(AcpiPstate), + car_get_var(AcpiSrat), car_get_var(AcpiSlit), + car_get_var(AcpiWheaMce), car_get_var(AcpiWheaCmc), + car_get_var(AcpiAlib), car_get_var(AcpiIvrs));
/* AmdReleaseStruct (&AmdParamStruct); */ return Status; } -#endif /* #ifndef __PRE_RAM__ */
AGESA_STATUS agesawrapper_amdlaterunaptask ( UINT32 Func,