Vladimir Serbinenko (phcoder(a)gmail.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/4675
-gerrit
commit a4db82528910345dc190b023203517a3c24da114
Author: Vladimir Serbinenko <phcoder(a)gmail.com>
Date: Sun Jan 12 14:28:56 2014 +0100
sandybridge: Use calls rather than asm to call to MRC.
Using asm as it's done currently is unsafe because caller-saved registers
are not declared as clobbered.
Using real call is nicer.
regparm((1)) ensures that argument is passed in %eax as expected.
Change-Id: I7449182582eaa53d4e473bc834b472edd8ee0d30
Signed-off-by: Vladimir Serbinenko <phcoder(a)gmail.com>
---
src/northbridge/intel/sandybridge/raminit.c | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/src/northbridge/intel/sandybridge/raminit.c b/src/northbridge/intel/sandybridge/raminit.c
index 333a6b5..07172fc 100644
--- a/src/northbridge/intel/sandybridge/raminit.c
+++ b/src/northbridge/intel/sandybridge/raminit.c
@@ -219,7 +219,7 @@ static void post_system_agent_init(struct pei_data *pei_data)
void sdram_initialize(struct pei_data *pei_data)
{
struct sys_info sysinfo;
- unsigned long entry;
+ int (*entry) (struct pei_data *pei_data) __attribute__ ((regparm(1)));
report_platform_info();
@@ -252,13 +252,11 @@ void sdram_initialize(struct pei_data *pei_data)
/* Locate and call UEFI System Agent binary. */
/* TODO make MRC blob (0xab?) defined in cbfs_core.h. */
- entry = (unsigned long)cbfs_get_file_content(
- CBFS_DEFAULT_MEDIA, "mrc.bin", 0xab);
+ entry = cbfs_get_file_content(
+ CBFS_DEFAULT_MEDIA, "mrc.bin", 0xab, NULL);
if (entry) {
int rv;
- asm volatile (
- "call *%%ecx\n\t"
- :"=a" (rv) : "c" (entry), "a" (pei_data));
+ rv = entry (pei_data);
if (rv) {
switch (rv) {
case -1:
Kyösti Mälkki (kyosti.malkki(a)gmail.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/4673
-gerrit
commit 17c0cd1583f64b84f401baea4e2290e0dc7e5774
Author: Kyösti Mälkki <kyosti.malkki(a)gmail.com>
Date: Sun Jan 12 14:38:33 2014 +0200
AMD K8/fam10: Fix CBMEM on S3 resume
Change to use cbmem_recovery() to wipe CBMEM region and reset
ACPI wakeup if CBMEM TOC was not found.
Change-Id: Ic362253eaa00bd442d4cc0514632f9096e20bfa6
Signed-off-by: Kyösti Mälkki <kyosti.malkki(a)gmail.com>
---
src/cpu/amd/car/post_cache_as_ram.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/cpu/amd/car/post_cache_as_ram.c b/src/cpu/amd/car/post_cache_as_ram.c
index 81175da..f74f915 100644
--- a/src/cpu/amd/car/post_cache_as_ram.c
+++ b/src/cpu/amd/car/post_cache_as_ram.c
@@ -38,7 +38,7 @@ static inline void *backup_resume(void) {
if (!suspend)
return NULL;
- if (!cbmem_reinit())
+ if (cbmem_recovery(1))
return NULL;
resume_backup_memory = cbmem_find(CBMEM_ID_RESUME);
Kyösti Mälkki (kyosti.malkki(a)gmail.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/4672
-gerrit
commit f8eee39292078febb98863c60078cf2b0617d338
Author: Kyösti Mälkki <kyosti.malkki(a)gmail.com>
Date: Sun Jan 12 14:38:24 2014 +0200
AMD AGESA: Fix CBMEM on S3 resume
Change to use cbmem_recovery() to wipe CBMEM region and reset
ACPI wakeup if CBMEM TOC was not found.
Change-Id: I6648570d76b5c137f50addcc5bce9c126d179c65
Signed-off-by: Kyösti Mälkki <kyosti.malkki(a)gmail.com>
---
src/cpu/amd/agesa/s3_resume.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/cpu/amd/agesa/s3_resume.c b/src/cpu/amd/agesa/s3_resume.c
index ef19b53..558fc75 100644
--- a/src/cpu/amd/agesa/s3_resume.c
+++ b/src/cpu/amd/agesa/s3_resume.c
@@ -111,7 +111,7 @@ inline void *backup_resume(void)
{
void *resume_backup_memory;
- if (!cbmem_reinit())
+ if (cbmem_recovery(1))
return NULL;
resume_backup_memory = cbmem_find(CBMEM_ID_RESUME);