diff options
Diffstat (limited to 'src/soc/amd/common/block')
-rw-r--r-- | src/soc/amd/common/block/cpu/noncar/memmap.c | 21 | ||||
-rw-r--r-- | src/soc/amd/common/block/include/amdblocks/memmap.h | 2 |
2 files changed, 3 insertions, 20 deletions
diff --git a/src/soc/amd/common/block/cpu/noncar/memmap.c b/src/soc/amd/common/block/cpu/noncar/memmap.c index ef87318183..b0e4bcb2c6 100644 --- a/src/soc/amd/common/block/cpu/noncar/memmap.c +++ b/src/soc/amd/common/block/cpu/noncar/memmap.c @@ -5,8 +5,6 @@ #include <console/console.h> #include <cbmem.h> #include <cpu/x86/smm.h> -#include <fsp/util.h> -#include <FspGuids.h> #include <memrange.h> #include <types.h> @@ -36,25 +34,8 @@ const struct memmap_early_dram *memmap_get_early_dram_usage(void) void smm_region(uintptr_t *start, size_t *size) { static int once; - static uintptr_t smm_start; - static size_t smm_size; - *start = smm_start; - *size = smm_size; - if (*size && *start) - return; - - struct range_entry tseg; - - if (fsp_find_range_hob(&tseg, AMD_FSP_TSEG_HOB_GUID.b) != CB_SUCCESS) { - printk(BIOS_ERR, "unable to find TSEG HOB\n"); - return; - } - - smm_start = (uintptr_t)range_entry_base(&tseg); - smm_size = range_entry_size(&tseg); - *start = smm_start; - *size = smm_size; + fsp_get_smm_region(start, size); if (!once) { clear_tvalid(); diff --git a/src/soc/amd/common/block/include/amdblocks/memmap.h b/src/soc/amd/common/block/include/amdblocks/memmap.h index 0894cf7ce4..cc89d86d50 100644 --- a/src/soc/amd/common/block/include/amdblocks/memmap.h +++ b/src/soc/amd/common/block/include/amdblocks/memmap.h @@ -17,4 +17,6 @@ struct memmap_early_dram { void memmap_stash_early_dram_usage(void); const struct memmap_early_dram *memmap_get_early_dram_usage(void); +void fsp_get_smm_region(uintptr_t *start, size_t *size); + #endif /* AMD_BLOCK_MEMMAP_H */ |