summaryrefslogtreecommitdiff
path: root/src/soc/amd
diff options
context:
space:
mode:
Diffstat (limited to 'src/soc/amd')
-rw-r--r--src/soc/amd/picasso/ramtop.c7
-rw-r--r--src/soc/amd/stoneyridge/ramtop.c7
2 files changed, 12 insertions, 2 deletions
diff --git a/src/soc/amd/picasso/ramtop.c b/src/soc/amd/picasso/ramtop.c
index 6b28ec7dd6..672fdd8194 100644
--- a/src/soc/amd/picasso/ramtop.c
+++ b/src/soc/amd/picasso/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;
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;