1 /* SPDX-License-Identifier: GPL-2.0-only */
3 #include <amdblocks/smm.h>
5 #include <cpu/x86/msr.h>
6 #include <cpu/x86/smm.h>
7 #include <cpu/amd/mtrr.h>
9 #include <soc/northbridge.h>
10 #include <soc/iomap.h>
11 #include <amdblocks/biosram.h>
13 uintptr_t cbmem_top_chipset(void)
15 if (!get_top_of_mem_below_4gb())
18 /* 8MB alignment to keep MTRR usage low */
19 return ALIGN_DOWN(restore_top_of_low_cacheable() - CONFIG_SMM_TSEG_SIZE
, 8 * MiB
);
22 static uintptr_t smm_region_start(void)
27 static size_t smm_region_size(void)
29 return CONFIG_SMM_TSEG_SIZE
;
32 void smm_region(uintptr_t *start
, size_t *size
)
36 *start
= smm_region_start();
37 *size
= smm_region_size();