diff options
author | Andre Przywara | 2023-04-05 21:30:11 +0100 |
---|---|---|
committer | Andre Przywara | 2023-04-12 00:17:22 +0100 |
commit | 0a137ac5015933bf38ea2700abe70602ef63bbdd (patch) | |
tree | 68a322b4e928a60f3d6ca03e6abad53965ebb400 /arch/arm/mach-sunxi | |
parent | 342abc1472248b38698a52a6e4c66e30c9bfaad7 (diff) |
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>
Diffstat (limited to 'arch/arm/mach-sunxi')
-rw-r--r-- | arch/arm/mach-sunxi/Kconfig | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/arch/arm/mach-sunxi/Kconfig b/arch/arm/mach-sunxi/Kconfig index 71a413108f7..6dcbb096f74 100644 --- a/arch/arm/mach-sunxi/Kconfig +++ b/arch/arm/mach-sunxi/Kconfig @@ -141,6 +141,20 @@ config SUNXI_RVBAR_ADDRESS entry point when switching to AArch64. This store is on different addresses, depending on the SoC. +config SUNXI_RVBAR_ALTERNATIVE + hex + depends on ARM64 + default 0x08100040 if MACH_SUN50I_H616 + default SUNXI_RVBAR_ADDRESS + ---help--- + The H616 die exists in at least two variants, with one having the + RVBAR registers at a different address. If the SoC variant ID + (stored in SRAM_VER_REG[7:0]) is not 0, we need to use the + other address. + Set this alternative address to the same as the normal address + for all other SoCs, so the content of the SRAM_VER_REG becomes + irrelevant there, and we can use the same code. + config SUNXI_A64_TIMER_ERRATUM bool |