diff options
author | Kyösti Mälkki <kyosti.malkki@gmail.com> | 2021-11-10 03:10:58 +0200 |
---|---|---|
committer | Raul Rangel <rrangel@chromium.org> | 2021-11-13 22:26:53 +0000 |
commit | 04c3228a5d66d7c83ae88ea3f3fdf273060aa614 (patch) | |
tree | 14f7caabd9b41fab44abb8013079a3ab65409922 /src/include/rules.h | |
parent | f6e421ffc9ede7ebeb56c0941f07f2f7b8b496a0 (diff) |
Add ENV_STAGE_SUPPORTS_SMP to clean up spinlock stubs
CONFIG(SMP) was an invalid condition to use in cases where one
stage requires spinlocks and another one does not. The
stage not requiring spinlock still required <smp/spinlock.h>
to be implemented with no-op stubs.
This reverts commit 037ee4b556
soc/amd/picasso: Add dummy spinlock for psp_verstage
Change-Id: Iba52febdeee78294f916775ee9ce8a82d6203570
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/59094
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Raul Rangel <rrangel@chromium.org>
Reviewed-by: Julius Werner <jwerner@chromium.org>
Diffstat (limited to 'src/include/rules.h')
-rw-r--r-- | src/include/rules.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/include/rules.h b/src/include/rules.h index ec3d22d7d1..d08929cae2 100644 --- a/src/include/rules.h +++ b/src/include/rules.h @@ -292,6 +292,17 @@ #define ENV_INITIAL_STAGE ENV_BOOTBLOCK #endif +#if ENV_X86 +#define STAGE_HAS_SPINLOCKS !ENV_ROMSTAGE_OR_BEFORE +#elif ENV_RISCV +#define STAGE_HAS_SPINLOCKS 1 +#else +#define STAGE_HAS_SPINLOCKS 0 +#endif + +/* When set <arch/smp/spinlock.h> is included for the spinlock implementation. */ +#define ENV_STAGE_SUPPORTS_SMP (CONFIG(SMP) && STAGE_HAS_SPINLOCKS) + /** * For pre-DRAM stages and post-CAR always build with simple device model, ie. * PCI, PNP and CPU functions operate without use of devicetree. The reason |