]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
arm: mach-k3: am62a: Fixup TF-A/OP-TEE reserved-memory node in FDT
authorAndrew Davis <afd@ti.com>
Wed, 14 Feb 2024 16:30:08 +0000 (10:30 -0600)
committerTom Rini <trini@konsulko.com>
Wed, 6 Mar 2024 14:09:00 +0000 (09:09 -0500)
The address we load TFA and OP-TEE to is configurable by
CONFIG_K3_{ATF,OPTEE}_LOAD_ADDR, but the DT nodes reserving this memory
are static. Fix that by updating this node when the loaded address
does not match the address in DT.

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

index 42161376469e2ee5455111cf25a550f1eea87217..fdb442773e3fcc2ca2442b3e0ca4e3525beb2f3e 100644 (file)
@@ -12,6 +12,7 @@ obj-$(CONFIG_SOC_K3_AM654) += am654_fdt.o
 obj-$(CONFIG_SOC_K3_J721E) += j721e_fdt.o
 obj-$(CONFIG_SOC_K3_J721S2) += j721s2_fdt.o
 obj-$(CONFIG_SOC_K3_AM625) += am625_fdt.o
+obj-$(CONFIG_SOC_K3_AM62A7) += am62a7_fdt.o
 endif
 ifeq ($(CONFIG_SPL_BUILD),y)
 obj-$(CONFIG_SOC_K3_AM654) += am654_init.o
diff --git a/arch/arm/mach-k3/am62a7_fdt.c b/arch/arm/mach-k3/am62a7_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 c5f1ef87126263987bc84e3d95ed5cfb792d1f00..bbd5497f2aee8f540acb4c8b4cd439230188c3fa 100644 (file)
@@ -13,6 +13,7 @@ config TARGET_AM62A7_A53_EVM
        bool "TI K3 based AM62A7 EVM running on A53"
        select ARM64
        select BINMAN
+       select OF_SYSTEM_SETUP
        imply BOARD
        imply SPL_BOARD
        imply TI_I2C_BOARD_DETECT