1
0
mirror of https://xff.cz/git/u-boot/ synced 2025-09-24 12:02:11 +02:00
Files
u-boot-megous/arch/arm/include/asm
Andre Przywara 2b641211c5 armv8: Fix TCR 64-bit writes
The AArch64 TCR_ELx register is a 64-bit register, and many newer
architecture features use bits in the upper half. So far U-Boot was
igorant of those bits, trying to leave them alone.
However, in an effort to set bit 31 to 1, it failed doing so, because
the compiler sign-extended "1 << 31", so that all bits[63:31] got set.

Older ARMv8.0 cores don't define anything dangerous up there, but newer
architecture revisions do, and setting all those bits will end badly:
=================
$ qemu-system-aarch64 -cpu max ....
U-Boot 2022.07-rc1 (May 09 2022 - 15:21:00 +0100)

DRAM:  1.5 GiB
=================  (hangs here)

Defining TCR_ELx_RSVD to "1U << 31" avoids the sign-extension, so all
upper bits stay at a safe 0 value. This means no more surprises when
U-Boot runs on a more capable CPU core.

Reported-by: Balaji Anandapadmanaban <Balaji.Anandapadmanaban@arm.com>
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Tested-by: Peter Collingbourne <pcc@google.com>
Reviewed-by: Peter Collingbourne <pcc@google.com>
2022-06-03 11:15:24 -04:00
..
2022-02-10 16:44:23 -05:00
2022-06-03 11:15:24 -04:00
2021-09-24 14:30:46 -04:00
2021-04-22 14:09:45 -04:00
2022-02-23 05:25:17 +01:00
2020-01-24 11:19:52 -05:00
2022-03-02 13:59:29 -05:00
2022-01-19 18:11:34 +01:00
2022-04-01 15:03:13 -04:00
2022-03-02 13:59:29 -05:00
2022-04-01 16:56:53 -04:00
2021-09-30 08:08:56 -04:00