[coreboot-gerrit] New patch to review for coreboot: 41750ef AGESA PI: Access the binary PI with new cbfs way.

Zheng Bao (zheng.bao@amd.com) gerrit at coreboot.org
Tue May 5 11:27:56 CEST 2015


Zheng Bao (zheng.bao at amd.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/10099

-gerrit

commit 41750efc2d24813a58e5a2f20394a5d2202c9166
Author: zbao <fishbaozi at gmail.com>
Date:   Wed May 6 01:49:48 2015 +0800

    AGESA PI: Access the binary PI with new cbfs way.
    
    Change-Id: Id47db5be57e33412fa3a0d229db4260de70726bb
    Signed-off-by: Zheng Bao <zheng.bao at amd.com>
    Signed-off-by: Zheng Bao <fishbaozi at gmail.com>
---
 src/northbridge/amd/pi/agesawrapper.c | 15 ++++-----------
 1 file changed, 4 insertions(+), 11 deletions(-)

diff --git a/src/northbridge/amd/pi/agesawrapper.c b/src/northbridge/amd/pi/agesawrapper.c
index 79e3895..e1e9708 100644
--- a/src/northbridge/amd/pi/agesawrapper.c
+++ b/src/northbridge/amd/pi/agesawrapper.c
@@ -593,23 +593,16 @@ AGESA_STATUS agesawrapper_amdreadeventlog (UINT8 HeapStatus)
 
 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;
+	size_t file_size = -1;
 
-	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);
+	agesa = cbfs_boot_map_with_leak(CONFIG_CBFS_AGESA_NAME, CBFS_TYPE_RAW, &file_size);
 	if (!agesa)
 		return NULL;
-	image =  LibAmdLocateImage(agesa, agesa + ntohl(file->len) - 1, 4096, name);
+
+	image =  LibAmdLocateImage(agesa, agesa + file_size - 1, 4096, name);
 	module = (AMD_MODULE_HEADER*)image->ModuleInfoOffset;
 
 	return module;



More information about the coreboot-gerrit mailing list