]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
arm: mach-k3: am62p: Fixup TF-A/OP-TEE reserved-memory node in FDT
authorBryan Brattlof <bb@ti.com>
Thu, 23 May 2024 16:43:20 +0000 (11:43 -0500)
committerTom Rini <trini@konsulko.com>
Wed, 29 May 2024 17:21:14 +0000 (11:21 -0600)
The address we load TFA and OPTEE is configurable by the
CONFIG_K3_{ATF,OPTEE)_LOAD_ADDR, but the DT node reservations remain
static which can cause some confusion about where exactly these firmware
are exactly. Fix this by updating the reserved-memory{} nodes when the
loaded address does not match the address in DT.

Reported-by: Andrew Davis <afd@ti.com>
Signed-off-by: Bryan Brattlof <bb@ti.com>
arch/arm/mach-k3/Makefile
arch/arm/mach-k3/am62p5_fdt.c [new file with mode: 0644]
arch/arm/mach-k3/am62px/Kconfig

index 1bd523329a4f8e68e8b018c75e65d2f88a1b091b..4e9d0925f13f5f15a0d9845f3dbd1920e4006adf 100644 (file)
@@ -13,6 +13,7 @@ obj-$(CONFIG_SOC_K3_J721S2) += j721s2_fdt.o
 obj-$(CONFIG_SOC_K3_AM625) += am625_fdt.o
 obj-$(CONFIG_SOC_K3_AM62A7) += am62a7_fdt.o
 obj-$(CONFIG_SOC_K3_J784S4) += j784s4_fdt.o
+obj-$(CONFIG_SOC_K3_AM62P5) += am62p5_fdt.o
 endif
 ifeq ($(CONFIG_SPL_BUILD),y)
 obj-$(CONFIG_SOC_K3_AM654) += am654_init.o
diff --git a/arch/arm/mach-k3/am62p5_fdt.c b/arch/arm/mach-k3/am62p5_fdt.c
new file mode 100644 (file)
index 0000000..d67f012
--- /dev/null
@@ -0,0 +1,16 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+/*
+ * Copyright (C) 2024 Texas Instruments Incorporated - https://www.ti.com/
+ */
+
+#include <asm/hardware.h>
+#include "common_fdt.h"
+#include <fdt_support.h>
+
+int ft_system_setup(void *blob, struct bd_info *bd)
+{
+       fdt_fixup_reserved(blob, "tfa", CONFIG_K3_ATF_LOAD_ADDR, 0x80000);
+       fdt_fixup_reserved(blob, "optee", CONFIG_K3_OPTEE_LOAD_ADDR, 0x1800000);
+
+       return 0;
+}
index 38a9e6811b119b38c141163cac6dd43f1fef199f..76ae86b66222fc0f0e4add1a94ba972a8deb3bdf 100644 (file)
@@ -13,6 +13,7 @@ config TARGET_AM62P5_A53_EVM
        bool "TI K3 based AM62P5 EVM running on A53"
        select ARM64
        select BINMAN
+       select OF_SYSTEM_SETUP
 
 config TARGET_AM62P5_R5_EVM
        bool "TI K3 based AM62P5 EVM running on R5"