aboutsummaryrefslogtreecommitdiff
path: root/src/soc/amd/stoneyridge/ramtop.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/soc/amd/stoneyridge/ramtop.c')
-rw-r--r--src/soc/amd/stoneyridge/ramtop.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/soc/amd/stoneyridge/ramtop.c b/src/soc/amd/stoneyridge/ramtop.c
index 26d84cef12..e2b0f7d6bc 100644
--- a/src/soc/amd/stoneyridge/ramtop.c
+++ b/src/soc/amd/stoneyridge/ramtop.c
@@ -111,6 +111,7 @@ static void clear_tvalid(void)
int smm_subregion(int sub, uintptr_t *start, size_t *size)
{
+ static int once;
uintptr_t sub_base;
size_t sub_size;
const size_t cache_size = CONFIG_SMM_RESERVED_SIZE;
@@ -118,6 +119,11 @@ int smm_subregion(int sub, uintptr_t *start, size_t *size)
smm_region(&sub_base, &sub_size);
assert(sub_size > CONFIG_SMM_RESERVED_SIZE);
+ if (!once) {
+ clear_tvalid();
+ once = 1;
+ }
+
switch (sub) {
case SMM_SUBREGION_HANDLER:
/* Handler starts at the base of TSEG. */
@@ -127,7 +133,6 @@ int smm_subregion(int sub, uintptr_t *start, size_t *size)
/* External cache is in the middle of TSEG. */
sub_base += sub_size - cache_size;
sub_size = cache_size;
- clear_tvalid();
break;
default:
*start = 0;