diff options
author | Arthur Heymans <arthur@aheymans.xyz> | 2024-08-22 23:16:57 +0200 |
---|---|---|
committer | Felix Held <felix-coreboot@felixheld.de> | 2024-08-29 13:58:21 +0000 |
commit | aa75ee1a71719160608611f1ea81a399ef0d875d (patch) | |
tree | 8e92b24bda9220320bf2ddd5f24ab35e1a59b00b /src/soc/intel/xeon_sp/memmap.c | |
parent | 86dadcd52aaf0db59d4f770a6ff8527ed681e86e (diff) |
cbmem.h: Change return type of cbmem_get_region
The underlying IMD function already returns an integer which indicates
success or failure.
This removes the need to have initialized variables that need to be
checked for NULL later. In some cases this actually adds the appropriate
check for returned values.
Dying is appropriate if cbmem is not found as it is essential to the
bootflow.
Change-Id: Ib3e09a75380faf9f533601368993261f042422ef
Signed-off-by: Arthur Heymans <arthur@aheymans.xyz>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/84039
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Nico Huber <nico.h@gmx.de>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Diffstat (limited to 'src/soc/intel/xeon_sp/memmap.c')
-rw-r--r-- | src/soc/intel/xeon_sp/memmap.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/soc/intel/xeon_sp/memmap.c b/src/soc/intel/xeon_sp/memmap.c index bf4c13e4d3..b70c1cc75a 100644 --- a/src/soc/intel/xeon_sp/memmap.c +++ b/src/soc/intel/xeon_sp/memmap.c @@ -35,7 +35,8 @@ void fill_postcar_frame(struct postcar_frame *pcf) size_t cbmem_size; /* Try account for the CBMEM region currently used and for future use */ - cbmem_get_region((void **)&cbmem_base, &cbmem_size); + if (cbmem_get_region((void **)&cbmem_base, &cbmem_size)) + die("Could not find cbmem region"); printk(BIOS_DEBUG, "top_of_ram = 0x%lx\n", top_of_ram); printk(BIOS_DEBUG, "cbmem base_ptr: 0x%lx, size: 0x%zx\n", cbmem_base, cbmem_size); /* Assume 4MiB will be enough for future cbmem objects (FSP-S, ramstage, ...) */ |