diff options
author | Marshall Dawson <marshalldawson3rd@gmail.com> | 2019-10-16 21:53:21 -0600 |
---|---|---|
committer | Martin Roth <martinroth@google.com> | 2019-10-21 21:41:01 +0000 |
commit | e3aa424a4f53b8ac4c658a3cf33b7b52971599b3 (patch) | |
tree | b464e740f9ccd934f4346f2425733dbbfae1d763 /src/drivers | |
parent | 3edc9e24c3ec68419df0a3a5683067ec7d4ac444 (diff) |
drivers/intel/fsp2_0: Add ENV_CACHE_AS_RAM check for consumed ranges
Rename the freeranges array to better match what they represent, i.e.
ranges that are used by the current running program and CAR region that
is not unallocated.
Skip adding the CAR region if cache-as-RAM is not active.
Change-Id: I78ee5536d890f30450a5ad2a753c948b02634d6d
Signed-off-by: Marshall Dawson <marshalldawson3rd@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/36110
Reviewed-by: Martin Roth <martinroth@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src/drivers')
-rw-r--r-- | src/drivers/intel/fsp2_0/memory_init.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/drivers/intel/fsp2_0/memory_init.c b/src/drivers/intel/fsp2_0/memory_init.c index a075f01879..e7ddb15aa2 100644 --- a/src/drivers/intel/fsp2_0/memory_init.c +++ b/src/drivers/intel/fsp2_0/memory_init.c @@ -390,7 +390,7 @@ void fsp_memory_init(bool s3wake) struct region_device file_data; const char *name = CONFIG_FSP_M_CBFS; struct memranges memmap; - struct range_entry freeranges[2]; + struct range_entry prog_ranges[2]; elog_boot_notify(s3wake); @@ -402,9 +402,10 @@ void fsp_memory_init(bool s3wake) cbfs_file_data(&file_data, &file_desc); /* Build up memory map of romstage address space including CAR. */ - memranges_init_empty(&memmap, &freeranges[0], ARRAY_SIZE(freeranges)); - memranges_insert(&memmap, (uintptr_t)_car_region_start, - _car_unallocated_start - _car_region_start, 0); + memranges_init_empty(&memmap, &prog_ranges[0], ARRAY_SIZE(prog_ranges)); + if (ENV_CACHE_AS_RAM) + memranges_insert(&memmap, (uintptr_t)_car_region_start, + _car_unallocated_start - _car_region_start, 0); memranges_insert(&memmap, (uintptr_t)_program, REGION_SIZE(program), 0); if (!CONFIG(FSP_M_XIP)) |