<p>Marshall Dawson has uploaded this change for <strong>review</strong>.</p><p><a href="https://review.coreboot.org/22720">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">soc/amd/common: Define regions in AGESA cbmem<br><br>In 6c747068 "amd/stoneyridge: Put AGESA heap into cbmem" the AGESA<br>heap was moved completely into cbmem.  This was a departure from the<br>"late cbmem init" method of adding it late in post, then storing the<br>S3 volatile data to the region.<br><br>To prepare for S3 support, split the region into subregions for<br>heap, AGESA's S3 volatile storage, and an MTRR save area.<br><br>Change-Id: I06c137f56516f3a04091d1191cd657a0aa07320b<br>Signed-off-by: Marshall Dawson <marshalldawson3rd@gmail.com><br>---<br>M src/soc/amd/common/BiosCallOuts.h<br>M src/soc/amd/common/heapmanager.c<br>M src/soc/amd/common/s3_resume.h<br>3 files changed, 15 insertions(+), 2 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://review.coreboot.org:29418/coreboot refs/changes/20/22720/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">diff --git a/src/soc/amd/common/BiosCallOuts.h b/src/soc/amd/common/BiosCallOuts.h<br>index 5237d52..53fc46f 100644<br>--- a/src/soc/amd/common/BiosCallOuts.h<br>+++ b/src/soc/amd/common/BiosCallOuts.h<br>@@ -17,12 +17,20 @@<br> #ifndef __CALLOUTS_AMD_AGESA_H__<br> #define __CALLOUTS_AMD_AGESA_H__<br> <br>+#include "s3_resume.h"<br> #include "agesawrapper.h"<br> <br>-#define BIOS_HEAP_START_ADDRESS             0x010000000<br> #define BIOS_HEAP_SIZE                    0x30000<br> #define BSP_STACK_BASE_ADDR           0x30000<br> <br>+struct cbmem_usage {<br>+    uint8_t heap_base[BIOS_HEAP_SIZE];<br>+#if IS_ENABLED(CONFIG_HAVE_ACPI_RESUME)<br>+ uint8_t s3_vol_data[S3_VOLATILE_SIZE];<br>+       struct all_mtrrs s3_mtrrs;<br>+#endif<br>+};<br>+<br> typedef struct _BIOS_HEAP_MANAGER {<br>     UINT32 StartOfAllocatedNodes;<br>         UINT32 StartOfFreedNodes;<br>diff --git a/src/soc/amd/common/heapmanager.c b/src/soc/amd/common/heapmanager.c<br>index b991514..22d95f0 100644<br>--- a/src/soc/amd/common/heapmanager.c<br>+++ b/src/soc/amd/common/heapmanager.c<br>@@ -21,7 +21,10 @@<br> <br> static void *GetHeapBase(void)<br> {<br>-       return cbmem_add(CBMEM_ID_RESUME_SCRATCH, BIOS_HEAP_SIZE);<br>+   struct cbmem_usage *heap;<br>+    heap = (struct cbmem_usage *)cbmem_add(CBMEM_ID_RESUME_SCRATCH,<br>+                                              sizeof(struct cbmem_usage));<br>+ return (void *)heap->heap_base;<br> }<br> <br> static void EmptyHeap(int unused)<br>diff --git a/src/soc/amd/common/s3_resume.h b/src/soc/amd/common/s3_resume.h<br>index 3e80d72..8dc60da 100644<br>--- a/src/soc/amd/common/s3_resume.h<br>+++ b/src/soc/amd/common/s3_resume.h<br>@@ -18,6 +18,8 @@<br> <br> #include <cpu/x86/msr.h><br> <br>+#define S3_VOLATILE_SIZE 0x1000<br>+<br> struct vmtrr_pair {<br>   msr_t base;<br>   msr_t mask;<br></pre><p>To view, visit <a href="https://review.coreboot.org/22720">change 22720</a>. To unsubscribe, visit <a href="https://review.coreboot.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://review.coreboot.org/22720"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: coreboot </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>
<div style="display:none"> Gerrit-Change-Id: I06c137f56516f3a04091d1191cd657a0aa07320b </div>
<div style="display:none"> Gerrit-Change-Number: 22720 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Marshall Dawson <marshalldawson3rd@gmail.com> </div>