u-boot/arch/arm/cpu
Andre Przywara 5ff4857d35 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>
2022-03-02 13:59:29 -05:00
..
arm11 common: Drop net.h from common header 2020-05-18 17:33:31 -04:00
arm720t Convert CONFIG_SKIP_LOWLEVEL_INIT et al to Kconfig 2021-08-31 17:47:49 -04:00
arm920t Finish conversion of CONFIG_SYS_CLK_FREQ to Kconfig 2021-12-27 16:20:18 -05:00
arm926ejs spl: Provide more space to be used for storing SPL on imx28 OCRAM 2022-02-05 13:38:39 +01:00
arm946es Convert CONFIG_SKIP_LOWLEVEL_INIT et al to Kconfig 2021-08-31 17:47:49 -04:00
arm1136 arm: Remove flea3 board 2021-10-01 12:08:19 -04:00
arm1176 SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
armv7 mach-sunxi: Move timer code to mach folder 2022-02-04 00:09:57 +00:00
armv7m common: spl: move armv7m-specific code to spl_perform_fixups() 2022-01-18 08:31:02 -05:00
armv8 armv8: Fix and simplify branch_if_master/branch_if_slave 2022-03-02 13:59:29 -05:00
pxa Convert CONFIG_SKIP_LOWLEVEL_INIT et al to Kconfig 2021-08-31 17:47:49 -04:00
sa1100 Convert CONFIG_SKIP_LOWLEVEL_INIT et al to Kconfig 2021-08-31 17:47:49 -04:00
Makefile SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
u-boot-spl.lds spl: fix linker size check off-by-one errors 2019-05-05 08:48:50 -04:00
u-boot.lds ARM: Specify aligned address for secure section instead of using attributes 2018-09-07 09:11:42 -04:00