Assuming the patch in the ML is the one under discussion (gerrit is 100% broken here), that patch didn't produce a usable SSDT for me.
I used the patch below to make agesawrapper_amdinitlate work. The resulting SSDT has a different cpu scope so change CPU0/1 to C000/1 in dsdt.aml. I also changed acpi_tables to do the substitution of TOM1 in dsdt rather than ssdt.
The HeapStatus line fixes a problem which shows up in an Alib routine called from GnbInitAtLate.
Signed-off-by: Per Hansen <perh52(a)runbox.com>
diff --git a/src/mainboard/asrock/e350m1/agesawrapper.c b/src/mainboard/asrock/e350m1/agesawrapper.c
index 9178a18..3beea4b 100644
--- a/src/mainboard/asrock/e350m1/agesawrapper.c
+++ b/src/mainboard/asrock/e350m1/agesawrapper.c
@@ -36,6 +36,8 @@
#include "amdlib.h"
#include "PlatformGnbPcieComplex.h"
#include "Filecode.h"
+#include "heapManager.h"
+#include "CreateStruct.h"
#define FILECODE UNASSIGNED_FILE_FILECODE
@@ -436,42 +438,51 @@ agesawrapper_amdinitlate (
VOID
)
{
+ printk(BIOS_DEBUG,"agesawrapper_amdinitlate: START\n");
AGESA_STATUS Status;
- AMD_INTERFACE_PARAMS AmdParamStruct = {0};
- AMD_LATE_PARAMS *AmdLateParams;
+
+ AMD_LATE_PARAMS AmdLateParams;
+
+ LibAmdMemFill (&AmdLateParams,
+ 0,
+ sizeof (AMD_LATE_PARAMS),
+ &(AmdLateParams.StdHeader));
- return 0; // this causes bad ACPI SSDT, need to debug
+ AMD_CONFIG_PARAMS StdHeader;
+ StdHeader.AltImageBasePtr = 0;
+ StdHeader.CalloutPtr = (CALLOUT_ENTRY) &GetBiosCallout;
+ StdHeader.Func = 0;
+ StdHeader.ImageBasePtr = 0;
+ StdHeader.HeapStatus = HEAP_SYSTEM_MEM;
+ Status = AmdInitLateInitializer (&StdHeader, &AmdLateParams);
+ ASSERT(Status == AGESA_SUCCESS);
- AmdParamStruct.AgesaFunctionName = AMD_INIT_LATE;
- AmdParamStruct.AllocationMethod = PostMemDram;
- AmdParamStruct.StdHeader.CalloutPtr = (CALLOUT_ENTRY) &GetBiosCallout;
- AmdCreateStruct (&AmdParamStruct);
- AmdLateParams = (AMD_LATE_PARAMS *)AmdParamStruct.NewStructPtr;
- Status = AmdInitLate (AmdLateParams);
+ Status = AmdInitLate (&AmdLateParams);
if (Status != AGESA_SUCCESS) {
agesawrapper_amdreadeventlog();
ASSERT(Status == AGESA_SUCCESS);
}
- DmiTable = AmdLateParams->DmiTable;
- AcpiPstate = AmdLateParams->AcpiPState;
- AcpiSrat = AmdLateParams->AcpiSrat;
- AcpiSlit = AmdLateParams->AcpiSlit;
-
- AcpiWheaMce = AmdLateParams->AcpiWheaMce;
- AcpiWheaCmc = AmdLateParams->AcpiWheaCmc;
- AcpiAlib = AmdLateParams->AcpiAlib;
+ DmiTable = AmdLateParams.DmiTable;
+ AcpiPstate = AmdLateParams.AcpiPState;
+ AcpiSrat = AmdLateParams.AcpiSrat;
+ AcpiSlit = AmdLateParams.AcpiSlit;
- AmdReleaseStruct (&AmdParamStruct);
+ AcpiWheaMce = AmdLateParams.AcpiWheaMce;
+ AcpiWheaCmc = AmdLateParams.AcpiWheaCmc;
+ AcpiAlib = AmdLateParams.AcpiAlib;
+
+ printk(BIOS_DEBUG,"agesawrapper_amdinitlate: END\n");
return (UINT32)Status;
}