[coreboot-gerrit] New patch to review for coreboot: 20e6b3a Save memory space for FSP above CBMEM

Marc Jones (marc.jones@se-eng.com) gerrit at coreboot.org
Fri Nov 1 23:10:25 CET 2013


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/4020

-gerrit

commit 20e6b3a867f401e18d891ad9893e36dbe85babe3
Author: Marc Jones <marc.jones at se-eng.com>
Date:   Tue Oct 29 22:23:11 2013 -0600

    Save memory space for FSP above CBMEM
    
    The FSP uses the top of memory for itself. Move CBMEM down
    below the FSP memory. This memory can be used by the OS or
    payload after coreboot is finished.
    
    Change-Id: I9d3c33397c118095d96fd42531f28e722ec0f491
    Signed-off-by: Marc Jones <marc.jones at se-eng.com>
---
 src/arch/x86/boot/cbmem.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/src/arch/x86/boot/cbmem.c b/src/arch/x86/boot/cbmem.c
index bdc695c..fbb513f 100644
--- a/src/arch/x86/boot/cbmem.c
+++ b/src/arch/x86/boot/cbmem.c
@@ -24,7 +24,12 @@ void get_cbmem_table(uint64_t *base, uint64_t *size)
 	uint64_t top_of_ram = get_top_of_ram();
 
 	if (top_of_ram >= HIGH_MEMORY_SIZE) {
+#if CONFIG_HAVE_FSP_BIN
+		/* The FSP uses space for HOB and other stuff. Don't overwrite it */
+		*base = top_of_ram - HIGH_MEMORY_SIZE - 0x200000;	/* 2MB for FSP HOB */
+#else
 		*base = top_of_ram - HIGH_MEMORY_SIZE;
+#endif
 		*size = HIGH_MEMORY_SIZE;
 	} else {
 		*base = 0;
@@ -45,7 +50,12 @@ void __attribute__((weak)) backup_top_of_ram(uint64_t ramtop)
 void set_top_of_ram(uint64_t ramtop)
 {
 	backup_top_of_ram(ramtop);
+#if CONFIG_HAVE_FSP_BIN
+	/* The FSP uses space for HOB and other stuff. Don't overwrite it */
+	cbmem_late_set_table(ramtop - HIGH_MEMORY_SIZE - 0x200000, HIGH_MEMORY_SIZE); 	/* 2MB for FSP HOB */
+#else
 	cbmem_late_set_table(ramtop - HIGH_MEMORY_SIZE, HIGH_MEMORY_SIZE);
+#endif
 }
 
 unsigned long __attribute__((weak)) get_top_of_ram(void)



More information about the coreboot-gerrit mailing list