Patchwork [12/16] Port persimmon r6590 to e350m1: Work around memory allocation problem

login
register
about
Submitter mbuschman@lucidmachines.com
Date 2011-06-04 06:10:40
Message ID <1307167844-13392-12-git-send-email-mbuschman@lucidmachines.com>
Download mbox | patch
Permalink /patch/3029/
State Accepted
Commit r6632
Headers show

Comments

mbuschman@lucidmachines.com - 2011-06-04 06:10:40
From: Scott Duplichan <scott@notabs.org>

Fix memory allocation problem in amdInitLate. Disabled until further debug.

Signed-off-by: Marshall Buschman <mbuschman@lucidmachines.com>
---
 src/mainboard/asrock/e350m1/agesawrapper.c |   35 +++++++++++++--------------
 1 files changed, 17 insertions(+), 18 deletions(-)

Patch

diff --git a/src/mainboard/asrock/e350m1/agesawrapper.c b/src/mainboard/asrock/e350m1/agesawrapper.c
index 4e3819a..9f587b9 100644
--- a/src/mainboard/asrock/e350m1/agesawrapper.c
+++ b/src/mainboard/asrock/e350m1/agesawrapper.c
@@ -444,33 +444,32 @@  agesawrapper_amdinitlate (
   )
 {
   AGESA_STATUS Status;
-  AMD_LATE_PARAMS AmdLateParams;
+  AMD_INTERFACE_PARAMS AmdParamStruct = {0};
+  AMD_LATE_PARAMS *AmdLateParams;
 
-  LibAmdMemFill (&AmdLateParams,
-                 0,
-                 sizeof (AMD_LATE_PARAMS),
-                 &(AmdLateParams.StdHeader));
+  return 0; // this causes bad ACPI SSDT, need to debug
 
-  AmdLateParams.StdHeader.AltImageBasePtr = 0;
-  AmdLateParams.StdHeader.CalloutPtr = (CALLOUT_ENTRY) &GetBiosCallout;
-  AmdLateParams.StdHeader.Func = 0;
-  AmdLateParams.StdHeader.ImageBasePtr = 0;
-
-  Status = AmdInitLate (&AmdLateParams);
+  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);
   if (Status != AGESA_SUCCESS) {
     agesawrapper_amdreadeventlog();
     ASSERT(Status == AGESA_SUCCESS);
   }
 
-  DmiTable       = AmdLateParams.DmiTable;
-  AcpiPstate     = AmdLateParams.AcpiPState;
-  AcpiSrat       = AmdLateParams.AcpiSrat;
-  AcpiSlit       = AmdLateParams.AcpiSlit;
+  DmiTable    = AmdLateParams->DmiTable;
+  AcpiPstate  = AmdLateParams->AcpiPState;
+  AcpiSrat    = AmdLateParams->AcpiSrat;
+  AcpiSlit    = AmdLateParams->AcpiSlit;
 
-  AcpiWheaMce    = AmdLateParams.AcpiWheaMce;
-  AcpiWheaCmc    = AmdLateParams.AcpiWheaCmc;
-  AcpiAlib       = AmdLateParams.AcpiAlib;
+  AcpiWheaMce = AmdLateParams->AcpiWheaMce;
+  AcpiWheaCmc = AmdLateParams->AcpiWheaCmc;
+  AcpiAlib    = AmdLateParams->AcpiAlib;
 
+  AmdReleaseStruct (&AmdParamStruct);
   return (UINT32)Status;
 }