sunxi: arm64: boot0.h: runtime check for RVBAR address
authorAndre Przywara <andre.przywara@arm.com>
Wed, 5 Apr 2023 20:30:11 +0000 (21:30 +0100)
committerAndre Przywara <andre.przywara@arm.com>
Tue, 11 Apr 2023 23:17:22 +0000 (00:17 +0100)
commit0a137ac5015933bf38ea2700abe70602ef63bbdd
tree68a322b4e928a60f3d6ca03e6abad53965ebb400
parent342abc1472248b38698a52a6e4c66e30c9bfaad7
sunxi: arm64: boot0.h: runtime check for RVBAR address

Some SoCs of the H616 family use a die variant, that puts some CPU power
and reset control registers at a different address. There are examples
of two instances of the same board, using different die revisions of the
otherwise same H313 SoC. We need to write to a register in that block
*very* early in the SPL boot, to switch the core to AArch64.

Since the devices are otherwise indistinguishable, let the SPL code read
that die variant and use the respective RVBAR address based on that.
That is a bit tricky, since we need to do that in hand-coded AArch32
machine language, shared by all 64-bit SoCs. To avoid build dependencies
in this mess, we always provide two addresses to choose from, and just
give identical values for all other SoCs. This allows the same code to
run on all 64-bit SoCs, and controls this switch behaviour purely from
Kconfig.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Reviewed-by: Jernej Skrabec <jernej.skrabec@gmail.com>
arch/arm/include/asm/arch-sunxi/boot0.h
arch/arm/mach-sunxi/Kconfig