[coreboot-gerrit] New patch to review for coreboot: 3b99899 AGESA fam15tn: Use common GetHeapBase()

Kyösti Mälkki (kyosti.malkki@gmail.com) gerrit at coreboot.org
Sun May 4 07:56:07 CEST 2014


Kyösti Mälkki (kyosti.malkki at gmail.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/5653

-gerrit

commit 3b99899a1ca66ef8fe6692d2e40a9731117fbe90
Author: Kyösti Mälkki <kyosti.malkki at gmail.com>
Date:   Fri May 2 09:40:04 2014 +0300

    AGESA fam15tn: Use common GetHeapBase()
    
    Implementation of this function is common for all boards in family,
    and also across different families.
    
    Change-Id: I562a132fa6d3ade2700d9a375d7aa21fcf8ea890
    Signed-off-by: Kyösti Mälkki <kyosti.malkki at gmail.com>
---
 src/mainboard/amd/parmer/agesawrapper.c               | 19 -------------------
 src/mainboard/amd/parmer/agesawrapper.h               |  2 --
 src/mainboard/amd/thatcher/agesawrapper.c             | 19 -------------------
 src/mainboard/amd/thatcher/agesawrapper.h             |  2 --
 src/mainboard/asus/f2a85-m/agesawrapper.c             | 19 -------------------
 src/mainboard/asus/f2a85-m/agesawrapper.h             |  2 --
 src/mainboard/hp/pavilion_m6_1035dx/agesawrapper.c    | 19 -------------------
 src/mainboard/hp/pavilion_m6_1035dx/agesawrapper.h    |  2 --
 .../amd/agesa/family15tn/fam15tn_callouts.c           | 16 ++++++++++++++++
 .../amd/agesa/family15tn/fam15tn_callouts.h           |  2 ++
 10 files changed, 18 insertions(+), 84 deletions(-)

diff --git a/src/mainboard/amd/parmer/agesawrapper.c b/src/mainboard/amd/parmer/agesawrapper.c
index 827ce6d..908e4b0 100644
--- a/src/mainboard/amd/parmer/agesawrapper.c
+++ b/src/mainboard/amd/parmer/agesawrapper.c
@@ -41,8 +41,6 @@
 #include "FchPlatform.h"
 #include "Fch.h"
 #include <cpu/amd/agesa/s3_resume.h>
-#include <cbmem.h>
-#include <arch/acpi.h>
 #include <arch/io.h>
 #include <device/device.h>
 #include "hudson.h"
@@ -248,23 +246,6 @@ agesawrapper_amdinitearly (
 	return (UINT32)status;
 }
 
-UINT32 GetHeapBase(
-	AMD_CONFIG_PARAMS *StdHeader
-	)
-{
-	UINT32 heap;
-
-#if CONFIG_HAVE_ACPI_RESUME
-	/* Both romstage and ramstage has this S3 detect. */
-	if (acpi_get_sleep_type() == 3)
-		heap = (UINT32)cbmem_find(CBMEM_ID_RESUME_SCRATCH) + (CONFIG_HIGH_SCRATCH_MEMORY_SIZE - BIOS_HEAP_SIZE); /* base + high_stack_size */
-	else
-#endif
-		heap = BIOS_HEAP_START_ADDRESS; /* Low mem */
-
-	return heap;
-}
-
 UINT32
 agesawrapper_amdinitpost (
 	VOID
diff --git a/src/mainboard/amd/parmer/agesawrapper.h b/src/mainboard/amd/parmer/agesawrapper.h
index 5007510..579350f 100644
--- a/src/mainboard/amd/parmer/agesawrapper.h
+++ b/src/mainboard/amd/parmer/agesawrapper.h
@@ -92,6 +92,4 @@ UINT32 agesawrapper_amds3laterestore (VOID);
 UINT32 agesawrapper_fchs3earlyrestore (VOID);
 UINT32 agesawrapper_fchs3laterestore (VOID);
 
-UINT32 GetHeapBase(AMD_CONFIG_PARAMS *StdHeader);
-
 #endif
diff --git a/src/mainboard/amd/thatcher/agesawrapper.c b/src/mainboard/amd/thatcher/agesawrapper.c
index c50f3a0..c8f25d6 100644
--- a/src/mainboard/amd/thatcher/agesawrapper.c
+++ b/src/mainboard/amd/thatcher/agesawrapper.c
@@ -41,8 +41,6 @@
 #include "FchPlatform.h"
 #include "Fch.h"
 #include <cpu/amd/agesa/s3_resume.h>
-#include <cbmem.h>
-#include <arch/acpi.h>
 #include <arch/io.h>
 #include <device/device.h>
 #include "hudson.h"
@@ -246,23 +244,6 @@ agesawrapper_amdinitearly (
 	return (UINT32)status;
 }
 
-UINT32 GetHeapBase(
-	AMD_CONFIG_PARAMS *StdHeader
-	)
-{
-	UINT32 heap;
-
-#if CONFIG_HAVE_ACPI_RESUME
-	/* Both romstage and ramstage has this S3 detect. */
-	if (acpi_get_sleep_type() == 3)
-		heap = (UINT32)cbmem_find(CBMEM_ID_RESUME_SCRATCH) + (CONFIG_HIGH_SCRATCH_MEMORY_SIZE - BIOS_HEAP_SIZE); /* base + high_stack_size */
-	else
-#endif
-		heap = BIOS_HEAP_START_ADDRESS; /* Low mem */
-
-	return heap;
-}
-
 UINT32
 agesawrapper_amdinitpost (
 	VOID
diff --git a/src/mainboard/amd/thatcher/agesawrapper.h b/src/mainboard/amd/thatcher/agesawrapper.h
index 5007510..579350f 100644
--- a/src/mainboard/amd/thatcher/agesawrapper.h
+++ b/src/mainboard/amd/thatcher/agesawrapper.h
@@ -92,6 +92,4 @@ UINT32 agesawrapper_amds3laterestore (VOID);
 UINT32 agesawrapper_fchs3earlyrestore (VOID);
 UINT32 agesawrapper_fchs3laterestore (VOID);
 
-UINT32 GetHeapBase(AMD_CONFIG_PARAMS *StdHeader);
-
 #endif
diff --git a/src/mainboard/asus/f2a85-m/agesawrapper.c b/src/mainboard/asus/f2a85-m/agesawrapper.c
index 3b7b263..02d2796 100644
--- a/src/mainboard/asus/f2a85-m/agesawrapper.c
+++ b/src/mainboard/asus/f2a85-m/agesawrapper.c
@@ -26,9 +26,7 @@
 #include "BiosCallOuts.h"
 #include "PlatformGnbPcieComplex.h"
 
-#include <arch/acpi.h>
 #include <arch/io.h>
-#include <cbmem.h>
 #include <cpu/amd/agesa/s3_resume.h>
 #include <cpu/x86/mtrr.h>
 #include <device/device.h>
@@ -239,23 +237,6 @@ agesawrapper_amdinitearly (
 	return (UINT32)status;
 }
 
-UINT32 GetHeapBase(
-	AMD_CONFIG_PARAMS *StdHeader
-	)
-{
-	UINT32 heap;
-
-#if CONFIG_HAVE_ACPI_RESUME
-	/* Both romstage and ramstage has this S3 detect. */
-	if (acpi_get_sleep_type() == 3)
-		heap = (UINT32)cbmem_find(CBMEM_ID_RESUME_SCRATCH) + (CONFIG_HIGH_SCRATCH_MEMORY_SIZE - BIOS_HEAP_SIZE); /* base + high_stack_size */
-	else
-#endif
-		heap = BIOS_HEAP_START_ADDRESS; /* Low mem */
-
-	return heap;
-}
-
 UINT32
 agesawrapper_amdinitpost (
 	VOID
diff --git a/src/mainboard/asus/f2a85-m/agesawrapper.h b/src/mainboard/asus/f2a85-m/agesawrapper.h
index 29eedaf..71f0ff6 100644
--- a/src/mainboard/asus/f2a85-m/agesawrapper.h
+++ b/src/mainboard/asus/f2a85-m/agesawrapper.h
@@ -91,6 +91,4 @@ UINT32 agesawrapper_amds3laterestore (VOID);
 UINT32 agesawrapper_fchs3earlyrestore (VOID);
 UINT32 agesawrapper_fchs3laterestore (VOID);
 
-UINT32 GetHeapBase(AMD_CONFIG_PARAMS *StdHeader);
-
 #endif
diff --git a/src/mainboard/hp/pavilion_m6_1035dx/agesawrapper.c b/src/mainboard/hp/pavilion_m6_1035dx/agesawrapper.c
index 2720f16..b9519c6 100644
--- a/src/mainboard/hp/pavilion_m6_1035dx/agesawrapper.c
+++ b/src/mainboard/hp/pavilion_m6_1035dx/agesawrapper.c
@@ -28,9 +28,7 @@
 
 #define __SIMPLE_DEVICE__
 
-#include <arch/acpi.h>
 #include <arch/io.h>
-#include <cbmem.h>
 #include <cpu/x86/msr.h>
 #include <cpu/x86/mtrr.h>
 #include <device/device.h>
@@ -230,23 +228,6 @@ agesawrapper_amdinitearly (
 	return (UINT32)status;
 }
 
-UINT32 GetHeapBase(
-	AMD_CONFIG_PARAMS *StdHeader
-	)
-{
-	UINT32 heap;
-
-#if CONFIG_HAVE_ACPI_RESUME
-	/* Both romstage and ramstage has this S3 detect. */
-	if (acpi_get_sleep_type() == 3)
-		heap = (UINT32)cbmem_find(CBMEM_ID_RESUME_SCRATCH) + (CONFIG_HIGH_SCRATCH_MEMORY_SIZE - BIOS_HEAP_SIZE); /* base + high_stack_size */
-	else
-#endif
-		heap = BIOS_HEAP_START_ADDRESS; /* Low mem */
-
-	return heap;
-}
-
 UINT32
 agesawrapper_amdinitpost (
 	VOID
diff --git a/src/mainboard/hp/pavilion_m6_1035dx/agesawrapper.h b/src/mainboard/hp/pavilion_m6_1035dx/agesawrapper.h
index aa3cc2e..e5f028a 100644
--- a/src/mainboard/hp/pavilion_m6_1035dx/agesawrapper.h
+++ b/src/mainboard/hp/pavilion_m6_1035dx/agesawrapper.h
@@ -91,6 +91,4 @@ UINT32 agesawrapper_amds3laterestore (VOID);
 UINT32 agesawrapper_fchs3earlyrestore (VOID);
 UINT32 agesawrapper_fchs3laterestore (VOID);
 
-UINT32 GetHeapBase(AMD_CONFIG_PARAMS *StdHeader);
-
 #endif
diff --git a/src/northbridge/amd/agesa/family15tn/fam15tn_callouts.c b/src/northbridge/amd/agesa/family15tn/fam15tn_callouts.c
index cf84b39..2bc3b37 100644
--- a/src/northbridge/amd/agesa/family15tn/fam15tn_callouts.c
+++ b/src/northbridge/amd/agesa/family15tn/fam15tn_callouts.c
@@ -27,6 +27,7 @@
 #include "dimmSpd.h"
 #include "fam15tn_callouts.h"
 #include <cbmem.h>
+#include <arch/acpi.h>
 
 #define AGESA_RUNTIME_SIZE 4096
 
@@ -50,6 +51,21 @@ static AGESA_STATUS alloc_cbmem(AGESA_BUFFER_PARAMS *AllocParams) {
 	return AGESA_SUCCESS;
 }
 
+UINT32 GetHeapBase(AMD_CONFIG_PARAMS *StdHeader)
+{
+	UINT32 heap = BIOS_HEAP_START_ADDRESS;
+
+#if CONFIG_HAVE_ACPI_RESUME
+	/* Both romstage and ramstage has this S3 detect. */
+	if (acpi_get_sleep_type() == 3)
+		heap = (UINT32) cbmem_find(CBMEM_ID_RESUME_SCRATCH) +
+		 (CONFIG_HIGH_SCRATCH_MEMORY_SIZE - BIOS_HEAP_SIZE);
+		  /* himem_heap_base + high_stack_size */
+#endif
+
+	return heap;
+}
+
 AGESA_STATUS fam15tn_AllocateBuffer (UINT32 Func, UINT32 Data, VOID *ConfigPtr)
 {
 	UINT32              AvailableHeapSize;
diff --git a/src/northbridge/amd/agesa/family15tn/fam15tn_callouts.h b/src/northbridge/amd/agesa/family15tn/fam15tn_callouts.h
index ff0cc44..2392570 100644
--- a/src/northbridge/amd/agesa/family15tn/fam15tn_callouts.h
+++ b/src/northbridge/amd/agesa/family15tn/fam15tn_callouts.h
@@ -39,6 +39,8 @@ typedef struct _BIOS_BUFFER_NODE {
   UINT32 NextNodeOffset;
 } BIOS_BUFFER_NODE;
 
+UINT32 GetHeapBase(AMD_CONFIG_PARAMS *StdHeader);
+
 AGESA_STATUS fam15tn_AllocateBuffer (UINT32 Func, UINT32 Data, VOID *ConfigPtr);
 AGESA_STATUS fam15tn_DeallocateBuffer (UINT32 Func, UINT32 Data, VOID *ConfigPtr);
 AGESA_STATUS fam15tn_LocateBuffer (UINT32 Func, UINT32 Data, VOID *ConfigPtr);



More information about the coreboot-gerrit mailing list