[coreboot-gerrit] Patch set updated for coreboot: soc/apollolake: Reserve FSP memory in CBMEM
Alexandru Gagniuc (mr.nuke.me@gmail.com)
gerrit at coreboot.org
Mon Jan 25 18:02:18 CET 2016
Alexandru Gagniuc (mr.nuke.me at gmail.com) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/13351
-gerrit
commit 9ebe67ef7f09b569d941ffebfd5a2374ad8d1057
Author: Andrey Petrov <andrey.petrov at intel.com>
Date: Thu Nov 5 14:43:14 2015 -0800
soc/apollolake: Reserve FSP memory in CBMEM
FSP needs to reserve some space in DRAM which may not be touched
by coreboot. We initialize cbmem in such a way that this memory
is added as first element.
Change-Id: I9a9b7c9e9132acd2f341d72f7e34e78299815acd
Signed-off-by: Andrey Petrov <andrey.petrov at intel.com>
---
src/soc/intel/apollolake/romstage/romstage.c | 15 ++++++++++++++-
1 file changed, 14 insertions(+), 1 deletion(-)
diff --git a/src/soc/intel/apollolake/romstage/romstage.c b/src/soc/intel/apollolake/romstage/romstage.c
index e35b472..0168cd3 100644
--- a/src/soc/intel/apollolake/romstage/romstage.c
+++ b/src/soc/intel/apollolake/romstage/romstage.c
@@ -18,6 +18,8 @@
#include <cpu/x86/msr.h>
#include <device/pci_def.h>
#include <fsp/api.h>
+#include <fsp/util.h>
+#include <device/resource.h>
#include <soc/iomap.h>
#include <soc/romstage.h>
#include <soc/uart.h>
@@ -75,6 +77,8 @@ static void *alloc_stack_in_ram(void)
asmlinkage void* romstage_entry(void)
{
void *hob_list_ptr;
+ struct resource fsp_mem;
+
/* Be careful. Bootblock might already have initialized the console */
if (!IS_ENABLED(CONFIG_BOOTBLOCK_CONSOLE)) {
lpss_console_uart_init();
@@ -87,7 +91,16 @@ asmlinkage void* romstage_entry(void)
fsp_memory_init(&hob_list_ptr);
- cbmem_initialize_empty();
+ fsp_find_reserved_memory(&fsp_mem, hob_list_ptr);
+
+ /* initialize cbmem by adding FSP reserved memory first thing */
+ cbmem_initialize_empty_id_size(CBMEM_ID_FSP_RESERVED_MEMORY,
+ fsp_mem.size);
+
+ /* make sure FSP memory is reserved in cbmem */
+ if (fsp_mem.base != (uintptr_t)cbmem_find(CBMEM_ID_FSP_RESERVED_MEMORY))
+ die("Failed to accommodate FSP reserved memory request");
+
return alloc_stack_in_ram();
}
More information about the coreboot-gerrit
mailing list