From 1593cae46e03eda613d50a0e1702729fbef9f79e Mon Sep 17 00:00:00 2001 From: Varun Wadekar Date: Tue, 27 Feb 2018 18:30:31 -0800 Subject: [PATCH] denver: use plat_my_core_pos() to get core position The current functions to disable and enable Dynamic Code Optimizer (DCO) assume that all denver cores are in the same cluster. They ignore AFF1 field of the mpidr_el1 register, which leads to incorect logical core id calculation. This patch calls the platform handler, plat_my_core_pos(), to get the logical core id to disable/enable DCO for the core. Original change by: Krishna Sitaraman Change-Id: I45fbd1f1eb032cc1db677a4fdecc554548b4a830 Signed-off-by: Varun Wadekar --- lib/cpus/aarch64/denver.S | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/lib/cpus/aarch64/denver.S b/lib/cpus/aarch64/denver.S index a981d02c..caf74d7b 100644 --- a/lib/cpus/aarch64/denver.S +++ b/lib/cpus/aarch64/denver.S @@ -156,11 +156,12 @@ endfunc denver_disable_ext_debug * ---------------------------------------------------- */ func denver_enable_dco - mrs x0, mpidr_el1 - and x0, x0, #0xF + mov x3, x30 + bl plat_my_core_pos mov x1, #1 lsl x1, x1, x0 msr s3_0_c15_c0_2, x1 + mov x30, x3 ret endfunc denver_enable_dco @@ -170,9 +171,10 @@ endfunc denver_enable_dco */ func denver_disable_dco + mov x3, x30 + /* turn off background work */ - mrs x0, mpidr_el1 - and x0, x0, #0xF + bl plat_my_core_pos mov x1, #1 lsl x1, x1, x0 lsl x2, x1, #16 @@ -186,6 +188,7 @@ func denver_disable_dco and x2, x2, x1 cbnz x2, 1b + mov x30, x3 ret endfunc denver_disable_dco -- 2.30.2