summaryrefslogtreecommitdiff
path: root/board/cortina
diff options
context:
space:
mode:
authorAndre Przywara <andre.przywara@arm.com>2022-02-11 11:29:39 +0000
committerTom Rini <trini@konsulko.com>2022-03-02 13:59:29 -0500
commit5ff4857d3569710c0f1ce1848f1e7486e3a4cfbe (patch)
treeda9d57e285034143ed1e9cd4dfc30577792275ad /board/cortina
parentf660fe0bd3a8cfa7fc6271bbf27b1530e7348b85 (diff)
armv8: Fix and simplify branch_if_master/branch_if_slave
The branch_if_master macro jumps to a label if the CPU is the "master" core, which we define as having all affinity levels set to 0. To check for this condition, we need to mask off some bits from the MPIDR register, then compare the remaining register value against zero. The implementation of this was slighly broken (it preserved the upper RES0 bits), overly complicated and hard to understand, especially since it lacked comments. The same was true for the very similar branch_if_slave macro. Use a much shorter assembly sequence for those checks, use the same masking for both macros (just negate the final branch), and put some comments on them, to make it clear what the code does. This allows to drop the second temporary register for branch_if_master, so we adjust all call sites as well. Also use the opportunity to remove a misleading comment: the macro works fine on SoCs with multiple clusters. Judging by the commit message, the original problem with the Juno SoC stems from the fact that the master CPU *can* be configured to be from cluster 1, so the assumption that the master CPU has all affinity values set to 0 does not hold there. But this is already mentioned above in a comment, so remove the extra comment. Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Diffstat (limited to 'board/cortina')
-rw-r--r--board/cortina/presidio-asic/lowlevel_init.S2
1 files changed, 1 insertions, 1 deletions
diff --git a/board/cortina/presidio-asic/lowlevel_init.S b/board/cortina/presidio-asic/lowlevel_init.S
index 4450a5df79..cbf8134346 100644
--- a/board/cortina/presidio-asic/lowlevel_init.S
+++ b/board/cortina/presidio-asic/lowlevel_init.S
@@ -50,7 +50,7 @@ skip_smp_setup:
#endif
#ifdef CONFIG_ARMV8_MULTIENTRY
- branch_if_master x0, x1, 2f
+ branch_if_master x0, 2f
/*
* Slave should wait for master clearing spin table.