]> Git Repo - J-u-boot.git/commit
armv8: cpu: Implement allow_unaligned()
authorSam Protsenko <[email protected]>
Thu, 7 Nov 2024 02:58:31 +0000 (20:58 -0600)
committerTom Rini <[email protected]>
Sun, 17 Nov 2024 19:13:22 +0000 (13:13 -0600)
commit1070f01ac10abb40b168933de248df76f3e27220
tree0d32a67a72ec25b9fe6031bbb068205724f9ff80
parentbe48369f32a5831b032b62603fd9634de9302056
armv8: cpu: Implement allow_unaligned()

Usually ARMv8 platforms allow unaligned access for Normal memory. But
some chips might not allow it by default, having SCTLR.A bit set to 1
before U-Boot execution. One such example is Exynos850 SoC. As
allow_unaligned() is not implemented for ARMv8 at the moment, its __weak
implementation is used, which does nothing. That might lead to unaligned
access abort, for example when running EFI selftest. Fix that by
implementing allow_unaligned() for ARMv8.

The issue was found when running EFI selftest on E850-96 board
(Exynos850 based):

    => bootefi selftest $fdtcontroladdr

    ...
    Executing 'HII database protocols'
    "Synchronous Abort" handler, esr 0x96000021, far 0xbaac0991
    ...
    resetting ...

Unaligned abort happens in u16_strnlen(), which is called from
efi_hii_sibt_string_ucs2_block_next():

    u16_strlen(blk->string_text)

where 'blk' type is struct efi_hii_sibt_string_ucs2_block. Because this
struct is packed, doing "->string_text" makes 'blk' address incremented
by 1 byte, which makes it unaligned. Although allow_unaligned() was
called in efi_init_early() before EFI selftest execution, it wasn't
implemented for ARMv8 CPUs, so data abort happened.

Signed-off-by: Sam Protsenko <[email protected]>
arch/arm/cpu/armv8/cpu.c
This page took 0.03424 seconds and 4 git commands to generate.