From bc90e15d3f8e841ccf229fca5d7df99436ff4bdb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ky=C3=B6sti=20M=C3=A4lkki?= Date: Wed, 4 Sep 2013 13:26:11 +0300 Subject: CBMEM: Backup top_of_ram instead of cbmem_toc MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit AMD northbridges have a complex way to resolve top_of_ram. Once it is resolved, it is stored in NVRAM to be used on resume. TODO: Redesign these get_top_of_ram() functions from scratch. Change-Id: I3cceb7e9b8b07620dacf138e99f98dc818c65341 Signed-off-by: Kyösti Mälkki Reviewed-on: http://review.coreboot.org/3557 Tested-by: build bot (Jenkins) Reviewed-by: Aaron Durbin --- src/cpu/amd/agesa/s3_resume.c | 3 ++- src/cpu/amd/car/post_cache_as_ram.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'src/cpu/amd') diff --git a/src/cpu/amd/agesa/s3_resume.c b/src/cpu/amd/agesa/s3_resume.c index 6ba9212ab4..fcc1604ad1 100644 --- a/src/cpu/amd/agesa/s3_resume.c +++ b/src/cpu/amd/agesa/s3_resume.c @@ -120,7 +120,8 @@ inline void *backup_resume(void) * printk(BIOS_DEBUG, "CBMEM TOC 0-size:%x\n ",(u32_t)(high_ram_base + HIGH_MEMORY_SIZE + 4096)); */ - cbmem_reinit((u64) high_ram_base); + if (!cbmem_reinit((u64)high_ram_base)) + return NULL; resume_backup_memory = cbmem_find(CBMEM_ID_RESUME); if (((u32) resume_backup_memory == 0) diff --git a/src/cpu/amd/car/post_cache_as_ram.c b/src/cpu/amd/car/post_cache_as_ram.c index 18c278e41a..d20c393a82 100644 --- a/src/cpu/amd/car/post_cache_as_ram.c +++ b/src/cpu/amd/car/post_cache_as_ram.c @@ -45,7 +45,8 @@ static inline void *backup_resume(void) { print_debug_pcar("CBMEM TOC is at: ", (uint32_t)high_ram_base); print_debug_pcar("CBMEM TOC 0-size: ",(uint32_t)(high_ram_base + HIGH_MEMORY_SIZE + 4096)); - cbmem_reinit((u64)high_ram_base); + if (!cbmem_reinit((u64)high_ram_base)) + return NULL; resume_backup_memory = cbmem_find(CBMEM_ID_RESUME); -- cgit v1.2.3