diff options
author | Subrata Banik <subrata.banik@intel.com> | 2017-08-30 16:53:20 +0530 |
---|---|---|
committer | Subrata Banik <subrata.banik@intel.com> | 2017-09-01 02:55:27 +0000 |
commit | ce90c78d7f27e41275deb36b5dea2787ffced8bf (patch) | |
tree | e9f82120a278fd9cc1f9d95633953fc4c71818e2 /src/soc/intel/apollolake/memmap.c | |
parent | ce9653fe78de4b832fb515b1befeb83f11a1552d (diff) |
soc/intel/apollolake: Use SMM library to get tseg region information
This patch uses smm common library function to get tseg base
address and size. Hence removing definitions of smm_region()
from soc directory.
BRANCH=none
BUG=b:63974384
TEST=Build and boot reef successfully.
Change-Id: I091ca90cf576c0da35cf3fe010f8c22a18ef82d9
Signed-off-by: Subrata Banik <subrata.banik@intel.com>
Reviewed-on: https://review.coreboot.org/21291
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Diffstat (limited to 'src/soc/intel/apollolake/memmap.c')
-rw-r--r-- | src/soc/intel/apollolake/memmap.c | 26 |
1 files changed, 5 insertions, 21 deletions
diff --git a/src/soc/intel/apollolake/memmap.c b/src/soc/intel/apollolake/memmap.c index c54423c944..f9a484a7c4 100644 --- a/src/soc/intel/apollolake/memmap.c +++ b/src/soc/intel/apollolake/memmap.c @@ -28,40 +28,24 @@ #include <cbmem.h> #include <device/pci.h> #include <fsp/memmap.h> +#include <intelblocks/smm.h> #include <soc/systemagent.h> #include <soc/pci_devs.h> -static uintptr_t smm_region_start(void) -{ - return ALIGN_DOWN(pci_read_config32(SA_DEV_ROOT, TSEG), 1*MiB); -} - -static size_t smm_region_size(void) -{ - uintptr_t smm_end = - ALIGN_DOWN(pci_read_config32(SA_DEV_ROOT, BGSM), 1*MiB); - return smm_end - smm_region_start(); -} - void *cbmem_top(void) { - return (void *)smm_region_start(); -} - -void smm_region(void **start, size_t *size) -{ - *start = (void *)smm_region_start(); - *size = smm_region_size(); + return (void *)sa_get_tseg_base(); } int smm_subregion(int sub, void **start, size_t *size) { uintptr_t sub_base; size_t sub_size; + void *smm_base; const size_t cache_size = CONFIG_SMM_RESERVED_SIZE; - sub_base = smm_region_start(); - sub_size = smm_region_size(); + smm_region_info(&smm_base, &sub_size); + sub_base = (uintptr_t)smm_base; assert(sub_size > CONFIG_SMM_RESERVED_SIZE); |