From 32aee8415dac5ef71d53cacc28e25a8d312cc47b Mon Sep 17 00:00:00 2001 From: Roberto Vargas Date: Mon, 13 Nov 2017 13:41:58 +0000 Subject: scmi: Optimize bakery locks when HW_ASSISTED_COHERENCY is enabled When HW_ASSISTED_COHERENCY is enabled we can use spinlocks instead of using the more complex and slower bakery algorithm. Change-Id: I9d791a70050d599241169b9160a67e57d5506564 Signed-off-by: Roberto Vargas --- include/plat/arm/common/plat_arm.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'include') diff --git a/include/plat/arm/common/plat_arm.h b/include/plat/arm/common/plat_arm.h index d543894d7..848f4eea8 100644 --- a/include/plat/arm/common/plat_arm.h +++ b/include/plat/arm/common/plat_arm.h @@ -11,6 +11,7 @@ #include #include #include +#include #include #include @@ -80,6 +81,14 @@ void arm_setup_romlib(void); */ #define ARM_INSTANTIATE_LOCK static DEFINE_BAKERY_LOCK(arm_lock) #define ARM_LOCK_GET_INSTANCE (&arm_lock) + +#if !HW_ASSISTED_COHERENCY +#define ARM_SCMI_INSTANTIATE_LOCK DEFINE_BAKERY_LOCK(arm_scmi_lock) +#else +#define ARM_SCMI_INSTANTIATE_LOCK spinlock_t arm_scmi_lock +#endif +#define ARM_SCMI_LOCK_GET_INSTANCE (&arm_scmi_lock) + /* * These are wrapper macros to the Coherent Memory Bakery Lock API. */ -- cgit v1.2.3