Andrey Petrov (andrey.petrov@intel.com) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/13351
-gerrit
commit b28f0af713de40de825f278b53644348c7eca973 Author: Andrey Petrov andrey.petrov@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 (just under TSEG) which may not be touched by coreboot. We initialize cbmem in such a way this memory is added as first element.
Change-Id: I9a9b7c9e9132acd2f341d72f7e34e78299815acd Signed-off-by: Andrey Petrov andrey.petrov@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 88d872e..b7ffd3a 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> @@ -74,6 +76,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(); @@ -86,7 +90,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(); }