From f142ba55bb7e799127199300251f23a17df8725b Mon Sep 17 00:00:00 2001 From: Felix Held Date: Thu, 22 Apr 2021 18:26:43 +0200 Subject: 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 Change-Id: I3cfe09f8bb89a2154d37a37398df982828c824f9 Reviewed-on: https://review.coreboot.org/c/coreboot/+/52611 Reviewed-by: Angel Pons Reviewed-by: Raul Rangel Reviewed-by: Marshall Dawson Tested-by: build bot (Jenkins) --- src/soc/amd/picasso/cpu.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/soc/amd/picasso/cpu.c') 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 #include #include +#include #include #include #include @@ -18,6 +19,9 @@ #include #include +_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. */ -- cgit v1.2.3