[coreboot-gerrit] Patch set updated for coreboot: 8ce99cd amd/pi: Move AGESA cbfs access into the wrapper

Marc Jones (marc.jones@se-eng.com) gerrit at coreboot.org
Tue May 5 17:31:59 CEST 2015


Marc Jones (marc.jones at se-eng.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/10058

-gerrit

commit 8ce99cdb77b5b6f7235c9cfb056feb7254b2be4c
Author: Marc Jones <marc.jones at se-eng.com>
Date:   Fri May 1 14:57:50 2015 -0600

    amd/pi: Move AGESA cbfs access into the wrapper
    
    The AGESA.c file in 3rdparty has cbfs access functions
    for locating the AGESA binaries. coreboot access functions
    need to be within coreboot where they can be updated with
    cbfs changes. Move the offending function to coreboot.
    
    Change-Id: Ibf6136d04dfbdb0198e90cc3ce719dc286c5610e
    Signed-off-by: Marc Jones <marc.jones at se-eng.com>
---
 3rdparty                                    |  2 +-
 src/northbridge/amd/pi/agesawrapper.c       | 25 +++++++++++++++++++++++++
 src/northbridge/amd/pi/agesawrapper.h       |  6 ++++++
 src/vendorcode/amd/pi/00630F01/Makefile.inc |  1 +
 src/vendorcode/amd/pi/00730F01/Makefile.inc |  1 +
 5 files changed, 34 insertions(+), 1 deletion(-)

diff --git a/3rdparty b/3rdparty
index 892a697..98bafbe 160000
--- a/3rdparty
+++ b/3rdparty
@@ -1 +1 @@
-Subproject commit 892a6976ba8c7d14e1aaa518d4d02923d51b22c3
+Subproject commit 98bafbe3730e42e00d111037c2e378e0da085bd8
diff --git a/src/northbridge/amd/pi/agesawrapper.c b/src/northbridge/amd/pi/agesawrapper.c
index efdfdbd..79e3895 100644
--- a/src/northbridge/amd/pi/agesawrapper.c
+++ b/src/northbridge/amd/pi/agesawrapper.c
@@ -18,6 +18,7 @@
  */
 
 #include <AGESA.h>
+#include <cbfs.h>
 #include <cpu/amd/pi/s3_resume.h>
 #include <cpu/x86/mtrr.h>
 #include <cpuRegisters.h>
@@ -589,3 +590,27 @@ AGESA_STATUS agesawrapper_amdreadeventlog (UINT8 HeapStatus)
 
 	return Status;
 }
+
+const void *agesawrapper_locate_module (const CHAR8 name[8])
+{
+	struct cbfs_media media;
+	struct cbfs_file* file;
+	const void* agesa;
+	const AMD_IMAGE_HEADER* image;
+	const AMD_MODULE_HEADER* module;
+	size_t file_size;
+
+	if (init_default_cbfs_media(&media))
+		return NULL;
+	file = cbfs_get_file(&media, (const char*)CONFIG_CBFS_AGESA_NAME);
+	if (!file)
+		return NULL;
+	agesa = cbfs_get_file_content(&media, (const char*)CONFIG_CBFS_AGESA_NAME,
+		ntohl(file->type), &file_size);
+	if (!agesa)
+		return NULL;
+	image =  LibAmdLocateImage(agesa, agesa + ntohl(file->len) - 1, 4096, name);
+	module = (AMD_MODULE_HEADER*)image->ModuleInfoOffset;
+
+	return module;
+}
diff --git a/src/northbridge/amd/pi/agesawrapper.h b/src/northbridge/amd/pi/agesawrapper.h
index adcc755..b77e04c 100644
--- a/src/northbridge/amd/pi/agesawrapper.h
+++ b/src/northbridge/amd/pi/agesawrapper.h
@@ -24,6 +24,11 @@
 #include "Porting.h"
 #include "AGESA.h"
 
+/* TODO: Add a kconfig option to name the AGESA ROM file in CBFS */
+#ifndef CONFIG_CBFS_AGESA_NAME
+#define CONFIG_CBFS_AGESA_NAME "AGESA"
+#endif
+
 enum {
 	PICK_DMI,       /* DMI Interface */
 	PICK_PSTATE,    /* Acpi Pstate SSDT Table */
@@ -55,5 +60,6 @@ AGESA_STATUS agesawrapper_fchs3laterestore(void);
 VOID OemCustomizeInitEarly (IN	OUT AMD_EARLY_PARAMS *InitEarly);
 VOID amd_initcpuio(void);
 VOID amd_initmmio(void);
+const void *agesawrapper_locate_module (const CHAR8 name[8]);
 
 #endif /* _AGESAWRAPPER_H_ */
diff --git a/src/vendorcode/amd/pi/00630F01/Makefile.inc b/src/vendorcode/amd/pi/00630F01/Makefile.inc
index 7908378..6141763 100644
--- a/src/vendorcode/amd/pi/00630F01/Makefile.inc
+++ b/src/vendorcode/amd/pi/00630F01/Makefile.inc
@@ -48,6 +48,7 @@ AGESA_INC += -I$(AGESA_ROOT)/Proc/Fch
 AGESA_INC += -I$(AGESA_ROOT)/Proc/Fch/Common
 AGESA_INC += -I$(AGESA_ROOT)/Proc/IDS
 
+AGESA_INC += -I$(src)/northbridge/amd/pi
 AGESA_INC += -I$(src)/southbridge/amd/pi/hudson
 
 AGESA_INC += -I$(src)/arch/x86/include
diff --git a/src/vendorcode/amd/pi/00730F01/Makefile.inc b/src/vendorcode/amd/pi/00730F01/Makefile.inc
index a302e33..d6ba93c 100644
--- a/src/vendorcode/amd/pi/00730F01/Makefile.inc
+++ b/src/vendorcode/amd/pi/00730F01/Makefile.inc
@@ -47,6 +47,7 @@ AGESA_INC += -I$(AGESA_ROOT)/Proc/CPU/Feature
 AGESA_INC += -I$(AGESA_ROOT)/Proc/Fch
 AGESA_INC += -I$(AGESA_ROOT)/Proc/Fch/Common
 
+AGESA_INC += -I$(src)/northbridge/amd/pi
 AGESA_INC += -I$(src)/southbridge/amd/pi/hudson
 
 AGESA_INC += -I$(src)/arch/x86/include



More information about the coreboot-gerrit mailing list