From 7387e04a35f8702918d3b1e6cff558ad3f4a3fa0 Mon Sep 17 00:00:00 2001 From: Subrata Banik Date: Thu, 21 Sep 2017 19:22:22 +0530 Subject: soc/intel/skylake: Use EBDA area to store cbmem_top address This patch uses BIOS EBDA area to store relevent details like cbmem top during romstage after MRC init is done. Also provide provision to use the same EBDA data across various stages without reexecuting memory map algorithm. BRANCH=none BUG=b:63974384 TEST=Ensures HW based memmap algorithm is executing once in romstage and store required data into EBDA for other stage to avoid redundant calculation and get cbmem_top start from EBDA area. Change-Id: Ib1a674efa5ab3a4fc076fc93236edd911d28b398 Signed-off-by: Subrata Banik Reviewed-on: https://review.coreboot.org/21424 Tested-by: build bot (Jenkins) Reviewed-by: Aaron Durbin --- src/soc/intel/skylake/memmap.c | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) (limited to 'src/soc/intel/skylake/memmap.c') diff --git a/src/soc/intel/skylake/memmap.c b/src/soc/intel/skylake/memmap.c index 0ade6916f5..0d31ea8c06 100644 --- a/src/soc/intel/skylake/memmap.c +++ b/src/soc/intel/skylake/memmap.c @@ -14,12 +14,14 @@ * GNU General Public License for more details. */ +#include #include #include #include #include #include #include +#include #include #include #include @@ -274,6 +276,18 @@ static uintptr_t calculate_dram_base(void) return dram_base; } +/* Fill up memory layout information */ +void fill_soc_memmap_ebda(struct ebda_config *cfg) +{ + cfg->tolum_base = calculate_dram_base(); +} + +void cbmem_top_init(void) +{ + /* Fill up EBDA area */ + fill_ebda_area(); +} + /* * +-------------------------+ Top of RAM (aligned) * | System Management Mode | @@ -303,6 +317,9 @@ static uintptr_t calculate_dram_base(void) */ void *cbmem_top(void) { + struct ebda_config ebda_cfg; + struct ebda_config *cfg = &ebda_cfg; + /* * Check if Tseg has been initialized, we will use this as a flag * to check if the MRC is done, and only then continue to read the @@ -312,5 +329,7 @@ void *cbmem_top(void) if (sa_get_tseg_base() == 0) return NULL; - return (void *)calculate_dram_base(); + read_ebda_data(cfg, sizeof(*cfg)); + + return (void *)(uintptr_t)cfg->tolum_base; } -- cgit v1.2.3