1 /* SPDX-License-Identifier: GPL-2.0-only */
4 #include <cpu/x86/smm.h>
7 static size_t smm_region_size(void)
10 smm_size
= iosf_bunit_read(BUNIT_SMRRH
) & 0xFFFF;
11 smm_size
-= iosf_bunit_read(BUNIT_SMRRL
) & 0xFFFF;
12 smm_size
= (smm_size
+ 1) << 20;
16 void smm_region(uintptr_t *start
, size_t *size
)
18 *start
= (iosf_bunit_read(BUNIT_SMRRL
) & 0xFFFF) << 20;
19 *size
= smm_region_size();
22 uintptr_t cbmem_top_chipset(void)
28 * +-------------------------+ Top of RAM (aligned)
29 * | System Management Mode |
30 * | code and data | Length: CONFIG_SMM_TSEG_SIZE
32 * +-------------------------+ SMM base (aligned)
34 * | Chipset Reserved Memory | Length: Multiple of CONFIG_SMM_TSEG_SIZE
36 * +-------------------------+ top_of_ram (aligned)
40 * +-------------------------+
42 * | FSP Reserved Memory |
44 * +-------------------------+
46 * | Various CBMEM Entries |
48 * +-------------------------+ top_of_stack (8 byte aligned)
50 * | stack (CBMEM Entry) |
52 * +-------------------------+
55 smm_region(&smm_base
, &smm_size
);