Patchwork Load VSA from CBFS on amd/gx2

login
register
about
Submitter Patrick Georgi
Date 2009-12-21 12:24:49
Message ID <4B2F6911.5000107@coresystems.de>
Download mbox | patch
Permalink /patch/677/
State Accepted
Commit r4986
Headers show

Comments

Patrick Georgi - 2009-12-21 12:24:49
Hi,

attached patch makes coreboot load VSA from CBFS on amd/gx2. It's very
similar to the recent change to amd/lx (3 weeks ago), in fact, it's a
copy&paste from there.
Build tested, but I don't have the hardware around to test operation,
but the lx variant was tested.

Most notably, the gx2 code was definitely broken before with some
commented out coreboot-v3 code to load the image to the right place, so
no loading took place at all.

Signed-off-by: Patrick Georgi <patrick.georgi@coresystems.de>

Regards,
Patrick Georgi
Peter Stuge - 2009-12-21 12:28:24
Patrick Georgi wrote:
> attached patch makes coreboot load VSA from CBFS on amd/gx2.
> 
> Signed-off-by: Patrick Georgi <patrick.georgi@coresystems.de>

Acked-by: Peter Stuge <peter@stuge.se>

Patch

Index: src/cpu/amd/model_gx2/vsmsetup.c
===================================================================
--- src/cpu/amd/model_gx2/vsmsetup.c	(revision 4985)
+++ src/cpu/amd/model_gx2/vsmsetup.c	(working copy)
@@ -33,6 +33,7 @@ 
 #include <cpu/x86/lapic.h>
 #include <cpu/x86/cache.h>
 #include <arch/io.h>
+#include <cbfs.h>
 
 u32 VSA_vrRead(u16 classIndex);
 void do_vsmbios(void);
@@ -190,18 +191,11 @@ 
 	/* Clear VSM BIOS data area. */
 	for (i = 0x400; i < 0x500; i++)
 		*(volatile unsigned char *)i = 0;
-	/* set up cbfs and find the vsa file -- later */
-/*
-	init_archive(&archive);
+	if ((unsigned int)cbfs_load_stage("vsa") != VSA2_ENTRY_POINT) {
+		printk_err("do_vsmbios: Failed to load VSA.\n");
+	}
+	buf = VSA2_BUFFER;
 
-	if (find_file(&archive, "blob/vsa", &file))
-		die("FATAL: NO VSA found!\n");
-
-	if (process_file(&file, (void *)VSA2_BUFFER))
-		die("FATAL: Processing /blob/vsa failed\n");
- */
-
-	buf = (unsigned char *)VSA2_BUFFER;
 	printk_debug("buf[0x20] signature is %x:%x:%x:%x\n",
 	       buf[0x20], buf[0x21], buf[0x22], buf[0x23]);
 	/* Check for POST code at start of vsainit.bin. If you don't see it,