summaryrefslogtreecommitdiff
path: root/arch/arm/lib
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/lib')
-rw-r--r--arch/arm/lib/Makefile2
-rw-r--r--arch/arm/lib/cache.c5
-rw-r--r--arch/arm/lib/gic-v3-its.c3
-rw-r--r--arch/arm/lib/image.c9
-rw-r--r--arch/arm/lib/setjmp.S12
-rw-r--r--arch/arm/lib/setjmp_aarch64.S10
6 files changed, 30 insertions, 11 deletions
diff --git a/arch/arm/lib/Makefile b/arch/arm/lib/Makefile
index 74cd5051552..ade42d0ca43 100644
--- a/arch/arm/lib/Makefile
+++ b/arch/arm/lib/Makefile
@@ -97,7 +97,7 @@ endif
# some files can only build in ARM or THUMB2, not THUMB1
-ifdef CONFIG_$(XPL_)SYS_THUMB_BUILD
+ifdef CONFIG_$(PHASE_)SYS_THUMB_BUILD
asflags-$(CONFIG_HAS_THUMB2) += -DCONFIG_THUMB2_KERNEL
ifndef CONFIG_HAS_THUMB2
diff --git a/arch/arm/lib/cache.c b/arch/arm/lib/cache.c
index dd19bd3e4fb..ed6f15cb570 100644
--- a/arch/arm/lib/cache.c
+++ b/arch/arm/lib/cache.c
@@ -10,6 +10,7 @@
#include <malloc.h>
#include <asm/cache.h>
#include <asm/global_data.h>
+#include <asm/system.h>
#include <linux/errno.h>
DECLARE_GLOBAL_DATA_PTR;
@@ -126,8 +127,8 @@ void invalidate_l2_cache(void)
{
unsigned int val = 0;
- asm volatile("mcr p15, 1, %0, c15, c11, 0 @ invl l2 cache"
- : : "r" (val) : "cc");
+ asm_arm_or_thumb2("mcr p15, 1, %0, c15, c11, 0 @ invl l2 cache"
+ : : "r" (val) : "cc");
isb();
}
#endif
diff --git a/arch/arm/lib/gic-v3-its.c b/arch/arm/lib/gic-v3-its.c
index 51cc2397768..34f05e94672 100644
--- a/arch/arm/lib/gic-v3-its.c
+++ b/arch/arm/lib/gic-v3-its.c
@@ -232,6 +232,9 @@ U_BOOT_DRIVER(arm_gic_v3) = {
.id = UCLASS_IRQ,
.of_match = gic_v3_ids,
.ops = &arm_gic_v3_ops,
+#if CONFIG_IS_ENABLED(OF_REAL)
+ .bind = dm_scan_fdt_dev,
+#endif
ACPI_OPS_PTR(&gic_v3_acpi_ops)
};
diff --git a/arch/arm/lib/image.c b/arch/arm/lib/image.c
index d78d704cb58..1f672eee2c8 100644
--- a/arch/arm/lib/image.c
+++ b/arch/arm/lib/image.c
@@ -28,13 +28,6 @@ struct Image_header {
uint32_t res5;
};
-bool booti_is_valid(const void *img)
-{
- const struct Image_header *ih = img;
-
- return ih->magic == le32_to_cpu(LINUX_ARM64_IMAGE_MAGIC);
-}
-
int booti_setup(ulong image, ulong *relocated_addr, ulong *size,
bool force_reloc)
{
@@ -46,7 +39,7 @@ int booti_setup(ulong image, ulong *relocated_addr, ulong *size,
ih = (struct Image_header *)map_sysmem(image, 0);
- if (!booti_is_valid(ih)) {
+ if (ih->magic != le32_to_cpu(LINUX_ARM64_IMAGE_MAGIC)) {
puts("Bad Linux ARM64 Image magic!\n");
return 1;
}
diff --git a/arch/arm/lib/setjmp.S b/arch/arm/lib/setjmp.S
index 2f041aeef01..81bef578719 100644
--- a/arch/arm/lib/setjmp.S
+++ b/arch/arm/lib/setjmp.S
@@ -34,3 +34,15 @@ ENTRY(longjmp)
ret lr
ENDPROC(longjmp)
.popsection
+
+.pushsection .text.initjmp, "ax"
+ENTRY(initjmp)
+ stm a1, {v1-v8}
+ /* a2: entry point address, a3: stack base, a4: stack size */
+ add a3, a3, a4
+ str a3, [a1, #32] /* where setjmp would save sp */
+ str a2, [a1, #36] /* where setjmp would save lr */
+ mov a1, #0
+ ret lr
+ENDPROC(initjmp)
+.popsection
diff --git a/arch/arm/lib/setjmp_aarch64.S b/arch/arm/lib/setjmp_aarch64.S
index 1b8d000eb48..01193ccc426 100644
--- a/arch/arm/lib/setjmp_aarch64.S
+++ b/arch/arm/lib/setjmp_aarch64.S
@@ -39,3 +39,13 @@ ENTRY(longjmp)
ret
ENDPROC(longjmp)
.popsection
+
+.pushsection .text.initjmp, "ax"
+ENTRY(initjmp)
+ /* x1: entry point address, x2: stack base, x3: stack size */
+ add x2, x2, x3
+ stp x1, x2, [x0,#88]
+ mov x0, #0
+ ret
+ENDPROC(initjmp)
+.popsection