summaryrefslogtreecommitdiff
path: root/src/drivers/intel/fsp2_0/cbmem.c
blob: 5388b8912a943fe51008e693ced533c3968da25d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
/* SPDX-License-Identifier: GPL-2.0-only */

#include <cbmem.h>
#include <fsp/util.h>

void *cbmem_top_chipset(void)
{
	struct range_entry tolum;
	uint8_t *tolum_base;

	fsp_find_bootloader_tolum(&tolum);
	tolum_base = (uint8_t *)(uintptr_t)range_entry_base(&tolum);

	/*
	 * The TOLUM range may have other memory regions (such as APEI
	 * BERT region on top of CBMEM (IMD root and IMD small) region.
	 */
	return tolum_base + cbmem_overhead_size();
}