summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKyösti Mälkki <kyosti.malkki@gmail.com>2019-08-06 22:14:34 +0300
committerKyösti Mälkki <kyosti.malkki@gmail.com>2019-08-09 13:12:45 +0000
commit544369ebf3223eda11279614b93b9e05f7f27170 (patch)
tree3e08175b544d1138bc3a0c73120492eaf1a46220
parent6bbabef388ba9a1c59ebc865c6d43e94000c1f14 (diff)
amd/stoneyridge,picasso: Open TSEG earlier
Don't make assumptions about which subregion will be accessed first. Change-Id: I558fa4acc5068014b3748be6fc1bc34999054c0a Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/34775 Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net> Reviewed-by: Furquan Shaikh <furquan@google.com> Reviewed-by: Marshall Dawson <marshalldawson3rd@gmail.com> Reviewed-by: Richard Spiegel <richard.spiegel@silverbackltd.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
-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;