summaryrefslogtreecommitdiff
path: root/src/soc/intel
diff options
context:
space:
mode:
authorBenjamin Doron <benjamin.doron00@gmail.com>2020-10-14 05:29:09 +0000
committerPatrick Georgi <pgeorgi@google.com>2021-02-10 07:24:32 +0000
commit448ecc0e0660f111b3932368a950f18dae01f578 (patch)
treeec7cbddc6613f1bee77663d44eda7eb17d912bfb /src/soc/intel
parent3c6ad8d1843d63c37c8f413263fd140fa78f866a (diff)
soc/intel/{cnl,skl}: Add alignment check for TSEG base and size
Port commit 14d5991 (soc/intel/icelake: Add alignment check for TSEG base and size) to remaining SoCs. Change-Id: I90be6dfd3eb71ce66d6dfdcd711df061d880266f Signed-off-by: Benjamin Doron <benjamin.doron00@gmail.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/45002 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Michael Niewöhner <foss@mniewoehner.de> Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Diffstat (limited to 'src/soc/intel')
-rw-r--r--src/soc/intel/cannonlake/smmrelocate.c6
-rw-r--r--src/soc/intel/skylake/smmrelocate.c6
2 files changed, 12 insertions, 0 deletions
diff --git a/src/soc/intel/cannonlake/smmrelocate.c b/src/soc/intel/cannonlake/smmrelocate.c
index 05bd1f7730..7d189eadf2 100644
--- a/src/soc/intel/cannonlake/smmrelocate.c
+++ b/src/soc/intel/cannonlake/smmrelocate.c
@@ -152,6 +152,12 @@ static void fill_in_relocation_params(struct smm_relocation_params *params)
const u32 rmask = ~(4 * KiB - 1);
smm_region(&tseg_base, &tseg_size);
+
+ if (!IS_ALIGNED(tseg_base, tseg_size)) {
+ printk(BIOS_WARNING, "TSEG base not aligned with TSEG size! Not setting SMRR\n");
+ return;
+ }
+
smm_subregion(SMM_SUBREGION_CHIPSET, &params->ied_base, &params->ied_size);
/* SMRR has 32-bits of valid address aligned to 4KiB. */
diff --git a/src/soc/intel/skylake/smmrelocate.c b/src/soc/intel/skylake/smmrelocate.c
index 05bd1f7730..7d189eadf2 100644
--- a/src/soc/intel/skylake/smmrelocate.c
+++ b/src/soc/intel/skylake/smmrelocate.c
@@ -152,6 +152,12 @@ static void fill_in_relocation_params(struct smm_relocation_params *params)
const u32 rmask = ~(4 * KiB - 1);
smm_region(&tseg_base, &tseg_size);
+
+ if (!IS_ALIGNED(tseg_base, tseg_size)) {
+ printk(BIOS_WARNING, "TSEG base not aligned with TSEG size! Not setting SMRR\n");
+ return;
+ }
+
smm_subregion(SMM_SUBREGION_CHIPSET, &params->ied_base, &params->ied_size);
/* SMRR has 32-bits of valid address aligned to 4KiB. */