mb/google/brya/var/uldrenite: Generate RAM ID and SPD file
[coreboot2.git] / src / soc / amd / stoneyridge / memmap.c
blob67c2a2d64726926d9eb6c70b32919804cd6c6fd1
1 /* SPDX-License-Identifier: GPL-2.0-only */
3 #include <amdblocks/smm.h>
4 #include <stdint.h>
5 #include <cpu/x86/msr.h>
6 #include <cpu/x86/smm.h>
7 #include <cpu/amd/mtrr.h>
8 #include <cbmem.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())
16 return 0;
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)
24 return cbmem_top();
27 static size_t smm_region_size(void)
29 return CONFIG_SMM_TSEG_SIZE;
32 void smm_region(uintptr_t *start, size_t *size)
34 static int once;
36 *start = smm_region_start();
37 *size = smm_region_size();
39 if (!once) {
40 clear_tvalid();
41 once = 1;