u-boot/arch/arm/cpu/armv8/fsl-layerscape
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
..
doc WS cleanup: remove SPACE(s) followed by TAB 2021-09-30 09:08:16 -04:00
cpu.c Finish conversion of CONFIG_SYS_CLK_FREQ to Kconfig 2021-12-27 16:20:18 -05:00
cpu.h armv8: layerscape: add PSCI support for cpu release 2021-06-17 11:46:11 +05:30
fdt.c fdt_support: Add fdt_for_each_node_by_compatible() helper macro 2022-01-20 11:35:29 +01:00
fsl_lsch2_serdes.c arch/arm/cpu/armv8/fsl-layerscape/fsl_lsch2_serdes.c: Fix spelling of "resetting". 2022-01-13 07:57:49 -05:00
fsl_lsch2_speed.c Finish conversion of CONFIG_SYS_CLK_FREQ to Kconfig 2021-12-27 16:20:18 -05:00
fsl_lsch3_serdes.c armv8: lx2162a: Add Soc changes to support LX2162A 2020-12-10 13:56:39 +05:30
fsl_lsch3_speed.c Finish conversion of CONFIG_SYS_CLK_FREQ to Kconfig 2021-12-27 16:20:18 -05:00
icid.c fdt_support: Add fdt_for_each_node_by_compatible() helper macro 2022-01-20 11:35:29 +01:00
Kconfig Convert CONFIG_TIMESTAMP to Kconfig 2022-01-21 14:01:34 -05:00
lowlevel.S armv8: Fix and simplify branch_if_master/branch_if_slave 2022-03-02 13:59:29 -05:00
ls1012a_serdes.c SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
ls1028_ids.c armv8: ls1028a: use the official compatible string for the GPU 2021-11-09 17:18:23 +05:30
ls1028a_serdes.c armv8: ls1028a_serdes: Add few missing serdes protocols 2020-01-24 14:28:26 +05:30
ls1043_ids.c armv8: fsl-layerscape: fix SEC QI ICID setup 2019-03-03 22:01:09 +05:30
ls1043a_psci.S SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
ls1043a_serdes.c SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
ls1046_ids.c armv8: fsl-layerscape: fix SEC QI ICID setup 2019-03-03 22:01:09 +05:30
ls1046a_serdes.c armv8: ls1046afrwy: Add support for LS1046AFRWY platform 2019-06-19 12:54:57 +05:30
ls1088_ids.c armv8: fsl-layerscape: guard caam specific defines 2019-11-08 11:13:38 +05:30
ls1088a_serdes.c net: replace the "xfi" phy-mode with "10gbase-r" 2021-09-28 18:50:56 +03:00
ls2080a_serdes.c SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
ls2088_ids.c armv8: ls2088a: add icid setup for platform devices 2019-11-08 11:13:38 +05:30
lx2160_ids.c armv8: lx2160a: add icid setup for platform devices 2019-11-08 11:13:38 +05:30
lx2160a_serdes.c armv8: lx2162a: Add Soc changes to support LX2162A 2020-12-10 13:56:39 +05:30
Makefile armv8: lx2162a: Add Soc changes to support LX2162A 2020-12-10 13:56:39 +05:30
mp.c Finish conversion of CONFIG_SYS_CLK_FREQ to Kconfig 2021-12-27 16:20:18 -05:00
ppa.c common: Drop asm/global_data.h from common header 2021-02-02 15:33:42 -05:00
soc.c armv8: fsl-layerscape: rework the dwc3 snooping enable code 2021-11-09 17:18:23 +05:30
spintable.S armv8: Disable pointer authentication traps for EL1 2021-09-02 10:17:45 -04:00
spl.c Finish CONFIG_VID et al conversion to Kconfig 2021-12-27 08:41:38 -05:00