From: Andrew Davis <afd@ti.com>
To: Neha Malcom Francis <n-francis@ti.com>,
Vignesh Raghavendra <vigneshr@ti.com>, Nishanth Menon <nm@ti.com>,
Simon Glass <sjg@chromium.org>, Tom Rini <trini@konsulko.com>
Cc: <u-boot@lists.denx.de>, Andrew Davis <afd@ti.com>
Subject: [PATCH 5/6] arm: mach-k3: am62a: Fixup TF-A/OP-TEE reserved-memory node in FDT
Date: Wed, 14 Feb 2024 10:30:08 -0600 [thread overview]
Message-ID: <20240214163009.983034-6-afd@ti.com> (raw)
In-Reply-To: <20240214163009.983034-1-afd@ti.com>
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>
---
arch/arm/mach-k3/Makefile | 1 +
arch/arm/mach-k3/am62a7_fdt.c | 16 ++++++++++++++++
arch/arm/mach-k3/am62ax/Kconfig | 1 +
3 files changed, 18 insertions(+)
create mode 100644 arch/arm/mach-k3/am62a7_fdt.c
diff --git a/arch/arm/mach-k3/Makefile b/arch/arm/mach-k3/Makefile
index 42161376469..fdb442773e3 100644
--- a/arch/arm/mach-k3/Makefile
+++ b/arch/arm/mach-k3/Makefile
@@ -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
index 00000000000..d67f012a5dc
--- /dev/null
+++ b/arch/arm/mach-k3/am62a7_fdt.c
@@ -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;
+}
diff --git a/arch/arm/mach-k3/am62ax/Kconfig b/arch/arm/mach-k3/am62ax/Kconfig
index c5f1ef87126..bbd5497f2ae 100644
--- a/arch/arm/mach-k3/am62ax/Kconfig
+++ b/arch/arm/mach-k3/am62ax/Kconfig
@@ -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
--
2.39.2
next prev parent reply other threads:[~2024-02-14 16:32 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-14 16:30 [PATCH 0/6] Move DRAM address of ATF Andrew Davis
2024-02-14 16:30 ` [PATCH 1/6] arm: mach-k3: Add default ATF location for AM62/AM62a Andrew Davis
2024-02-16 4:55 ` Neha Malcom Francis
2024-03-06 13:27 ` Bryan Brattlof
2024-06-19 11:49 ` Dhruva Gole
2024-06-19 18:20 ` Nishanth Menon
2024-06-19 20:02 ` Andrew Davis
2024-06-20 5:30 ` Wadim Egorov
2024-06-21 13:49 ` Bryan Brattlof
2024-02-14 16:30 ` [PATCH 2/6] arm: mach-k3: Add config option for setting OP-TEE address Andrew Davis
2024-02-16 4:59 ` Neha Malcom Francis
2024-02-28 6:21 ` Manorit Chawdhry
2024-03-06 13:49 ` Andrew Davis
2024-03-06 13:28 ` Bryan Brattlof
2024-02-14 16:30 ` [PATCH 3/6] arm: mach-k3: am62: Enable OF_SYSTEM_SETUP for all boards Andrew Davis
2024-02-14 16:30 ` [PATCH 4/6] arm: mach-k3: am62: Fixup TF-A/OP-TEE reserved-memory node in FDT Andrew Davis
2024-02-16 5:26 ` Neha Malcom Francis
2024-02-28 6:24 ` Manorit Chawdhry
2024-03-06 13:52 ` Andrew Davis
2024-03-06 13:35 ` Bryan Brattlof
2024-03-06 14:03 ` Andrew Davis
2024-03-06 15:38 ` Bryan Brattlof
2024-02-14 16:30 ` Andrew Davis [this message]
2024-03-06 13:35 ` [PATCH 5/6] arm: mach-k3: am62a: " Bryan Brattlof
2024-02-14 16:30 ` [PATCH 6/6] arm: mach-k3: Move DRAM address of ATF for AM62/AM62a Andrew Davis
2024-02-15 8:06 ` Francesco Dolcini
2024-02-15 20:44 ` Andrew Davis
2024-03-06 13:37 ` Bryan Brattlof
2024-03-06 16:53 ` [PATCH 0/6] Move DRAM address of ATF Tom Rini
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240214163009.983034-6-afd@ti.com \
--to=afd@ti.com \
--cc=n-francis@ti.com \
--cc=nm@ti.com \
--cc=sjg@chromium.org \
--cc=trini@konsulko.com \
--cc=u-boot@lists.denx.de \
--cc=vigneshr@ti.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox