From: Stefan Bosch Date: Fri, 26 Jan 2024 12:50:56 +0000 (+0000) Subject: arm: s5p4418: fix relocation of vectors X-Git-Url: http://git.dujemihanovic.xyz/login.html?a=commitdiff_plain;h=934dec0af0f74c0ff1f53885e6e97b114f66e77b;p=u-boot.git arm: s5p4418: fix relocation of vectors The header (NSIH) used for the s5p4418-SoC is not loaded into RAM by the 2nd-bootloader, see boot0.h. Therefore, use an adapted version of relocate_vectors which relocates the vectors after the header (at _start) instead of the 'dummy'-vectors at the start of the header (at __image_copy_start). Signed-off-by: Stefan Bosch Reviewed-by: Minkyu Kang --- diff --git a/arch/arm/cpu/armv7/s5p4418/Makefile b/arch/arm/cpu/armv7/s5p4418/Makefile index 321b257b6d..58042581c4 100644 --- a/arch/arm/cpu/armv7/s5p4418/Makefile +++ b/arch/arm/cpu/armv7/s5p4418/Makefile @@ -2,5 +2,8 @@ # # (C) Copyright 2016 Nexell # Hyunseok, Jung +# +# Copyright (C) 2023 Stefan Bosch obj-y += cpu.o +obj-y += relocate.o diff --git a/arch/arm/cpu/armv7/s5p4418/relocate.S b/arch/arm/cpu/armv7/s5p4418/relocate.S new file mode 100644 index 0000000000..d6e76adceb --- /dev/null +++ b/arch/arm/cpu/armv7/s5p4418/relocate.S @@ -0,0 +1,24 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* + * relocate - S5P4418 specific relocation for ARM U-Boot + * + * Copyright (c) 2013 Albert ARIBAUD + * Copyright (C) 2023 Stefan Bosch + */ + +#include +#include +#include + +ENTRY(relocate_vectors) + + /* + * The s5p4418 SoC has the security extensions, so use VBAR to relocate + * the exception vectors. + */ + ldr r0, [r9, #GD_RELOCADDR] /* r0 = gd->relocaddr */ + add r0, #0x400 /* vectors are after NSIH + 0x200 */ + mcr p15, 0, r0, c12, c0, 0 /* Set VBAR */ + ret lr + +ENDPROC(relocate_vectors)