summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFelix Held <felix-coreboot@felixheld.de>2021-04-22 18:26:43 +0200
committerFelix Held <felix-coreboot@felixheld.de>2021-04-23 17:48:58 +0000
commitf142ba55bb7e799127199300251f23a17df8725b (patch)
treeba6ad2e8df36ab6f88a9407dd3b8dcf44e90317a
parent79f705fa34f2b5cecf19d183a42eaf4d57f87941 (diff)
soc/amd/picasso/cpu: make sure that MAX_CPUS isn't overridden
Trying to limit the number of available cores by setting the MAX_CPUS Kconfig option to a lower value than the SoC's default might result in cores being enabled in the FSP-S, but not fully initialized in coreboot which will cause some malfunction. Add a static assert to make sure that this option isn't changed from the default. To limit the maximum number of cores, use the downcore_mode and disable_smt devicetree settings instead. TEST=Build fails if MAX_CPUS isn't the expected default. Signed-off-by: Felix Held <felix-coreboot@felixheld.de> Change-Id: I3cfe09f8bb89a2154d37a37398df982828c824f9 Reviewed-on: https://review.coreboot.org/c/coreboot/+/52611 Reviewed-by: Angel Pons <th3fanbus@gmail.com> Reviewed-by: Raul Rangel <rrangel@chromium.org> Reviewed-by: Marshall Dawson <marshalldawson3rd@gmail.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
-rw-r--r--src/soc/amd/picasso/cpu.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/soc/amd/picasso/cpu.c b/src/soc/amd/picasso/cpu.c
index 36bbf0aa60..b2bb82dfbd 100644
--- a/src/soc/amd/picasso/cpu.c
+++ b/src/soc/amd/picasso/cpu.c
@@ -3,6 +3,7 @@
#include <amdblocks/cpu.h>
#include <amdblocks/reset.h>
#include <amdblocks/smm.h>
+#include <assert.h>
#include <cpu/cpu.h>
#include <cpu/x86/mp.h>
#include <cpu/x86/mtrr.h>
@@ -18,6 +19,9 @@
#include <console/console.h>
#include <cpu/amd/microcode.h>
+_Static_assert(CONFIG_MAX_CPUS == 8, "Do not override MAX_CPUS. To reduce the number of "
+ "available cores, use the downcore_mode and disable_smt devicetree settings instead.");
+
/*
* MP and SMM loading initialization.
*/