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 --- bl31/bl31.ld.S | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'bl31') diff --git a/bl31/bl31.ld.S b/bl31/bl31.ld.S index 66cb3f30..81e7ba3a 100644 --- a/bl31/bl31.ld.S +++ b/bl31/bl31.ld.S @@ -188,8 +188,15 @@ SECTIONS __PERCPU_BAKERY_LOCK_SIZE__ = ABSOLUTE(. - __BAKERY_LOCK_START__); . = . + (__PERCPU_BAKERY_LOCK_SIZE__ * (PLATFORM_CORE_COUNT - 1)); __BAKERY_LOCK_END__ = .; + + /* + * If BL31 doesn't use any bakery lock then __PERCPU_BAKERY_LOCK_SIZE__ + * will be zero. For this reason, the only two valid values for + * __PERCPU_BAKERY_LOCK_SIZE__ are 0 or the platform defined value + * PLAT_PERCPU_BAKERY_LOCK_SIZE. + */ #ifdef PLAT_PERCPU_BAKERY_LOCK_SIZE - ASSERT(__PERCPU_BAKERY_LOCK_SIZE__ == PLAT_PERCPU_BAKERY_LOCK_SIZE, + ASSERT((__PERCPU_BAKERY_LOCK_SIZE__ == 0) || (__PERCPU_BAKERY_LOCK_SIZE__ == PLAT_PERCPU_BAKERY_LOCK_SIZE), "PLAT_PERCPU_BAKERY_LOCK_SIZE does not match bakery lock requirements"); #endif #endif -- cgit v1.2.3