soc/intel/cannonlake: Use EBDA structure to store soc reserve memory size

Avoid calling calculate_dram_base() function to get chipset reserved
memory size during pci resource allocation. Rather use EBDA to store
chipset reserved memory size while calling cbmem_top_int().

This patch avoids one extra calculate_dram_base() call.

BRANCH=none
BUG=b:63974384
TEST=Ensures DRAM based resource allocation has taken care of Intel
SoC reserved ranges.

Change-Id: I2771ea55253ca7d16cd2e2951889ab092b47a9b1
Signed-off-by: Subrata Banik <subrata.banik@intel.com>
Reviewed-on: https://review.coreboot.org/22099
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
Subrata Banik 2017-10-19 16:40:14 +05:30 committed by Aaron Durbin
parent f506cf0b8d
commit ed1694157c
2 changed files with 5 additions and 3 deletions

View File

@ -19,6 +19,7 @@
struct ebda_config {
uint32_t signature; /* 0x00 - EBDA signature */
uint32_t tolum_base; /* 0x04 - coreboot memory start */
uint32_t reserved_mem_size; /* 0x08 - chipset reserved memory size */
};
#endif

View File

@ -263,12 +263,12 @@ static uintptr_t calculate_dram_base(size_t *reserved_mem_size)
*/
size_t soc_reserved_mmio_size(void)
{
size_t chipset_mem_size;
struct ebda_config cfg;
calculate_dram_base(&chipset_mem_size);
retrieve_ebda_object(&cfg);
/* Get Intel Reserved Memory Range Size */
return chipset_mem_size;
return cfg.reserved_mem_size;
}
/* Fill up memory layout information */
@ -277,6 +277,7 @@ void fill_soc_memmap_ebda(struct ebda_config *cfg)
size_t chipset_mem_size;
cfg->tolum_base = calculate_dram_base(&chipset_mem_size);
cfg->reserved_mem_size = chipset_mem_size;
}
void cbmem_top_init(void)