mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Ahmad Fatoum <a.fatoum@barebox.org>
To: barebox@lists.infradead.org
Cc: Ahmad Fatoum <a.fatoum@barebox.org>
Subject: [PATCH 1/2] tee: optee: merge tee/optee.h and ARM asm/optee.h
Date: Wed,  6 Aug 2025 14:52:28 +0200	[thread overview]
Message-ID: <20250806125229.2804284-1-a.fatoum@barebox.org> (raw)

OP-TEE is also available for RISC-V, so let's replace the asm/optee.h
header with a generic tee/optee.h header.

Signed-off-by: Ahmad Fatoum <a.fatoum@barebox.org>
---
 arch/arm/boards/tqma6ulx/board.c  |  1 -
 arch/arm/include/asm/optee.h      | 18 ------------------
 arch/arm/mach-imx/imx9.c          |  1 -
 arch/arm/mach-rockchip/rockchip.c |  2 +-
 drivers/soc/imx/soc-imx8m.c       |  1 -
 drivers/tee/optee/of_fixup.c      |  1 -
 include/tee/optee.h               | 17 +++++++++++++++++
 7 files changed, 18 insertions(+), 23 deletions(-)
 delete mode 100644 arch/arm/include/asm/optee.h

diff --git a/arch/arm/boards/tqma6ulx/board.c b/arch/arm/boards/tqma6ulx/board.c
index 0c1af3c18f8d..c4222920d450 100644
--- a/arch/arm/boards/tqma6ulx/board.c
+++ b/arch/arm/boards/tqma6ulx/board.c
@@ -12,7 +12,6 @@
 #include <of.h>
 #include <string.h>
 #include <linux/clk.h>
-#include <asm/optee.h>
 #include <asm-generic/memory_layout.h>
 
 #include "tqma6ulx.h"
diff --git a/arch/arm/include/asm/optee.h b/arch/arm/include/asm/optee.h
deleted file mode 100644
index f8eb7b4a8b0f..000000000000
--- a/arch/arm/include/asm/optee.h
+++ /dev/null
@@ -1,18 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0-only */
-
-#ifndef __ARM_OPTEE_H__
-#define __ARM_OPTEE_H__
-
-#include <linux/types.h>
-
-struct device_node;
-
-struct of_optee_fixup_data {
-	const char *method;
-	size_t shm_size;
-};
-
-int of_optee_fixup(struct device_node *root, void *fixup_data);
-
-#endif /* __ARM_OPTEE_H__ */
-
diff --git a/arch/arm/mach-imx/imx9.c b/arch/arm/mach-imx/imx9.c
index 220951fd1920..dd4fbf099e60 100644
--- a/arch/arm/mach-imx/imx9.c
+++ b/arch/arm/mach-imx/imx9.c
@@ -9,7 +9,6 @@
 #include <mach/imx/imx9-regs.h>
 #include <tee/optee.h>
 #include <asm-generic/memory_layout.h>
-#include <asm/optee.h>
 #include <mach/imx/scratch.h>
 
 #define SPEED_GRADING_MASK GENMASK(11, 6)
diff --git a/arch/arm/mach-rockchip/rockchip.c b/arch/arm/mach-rockchip/rockchip.c
index 3d2ef791d20f..532d794fead1 100644
--- a/arch/arm/mach-rockchip/rockchip.c
+++ b/arch/arm/mach-rockchip/rockchip.c
@@ -1,7 +1,7 @@
 // SPDX-License-Identifier: GPL-2.0-only
 #include <common.h>
 #include <init.h>
-#include <asm/optee.h>
+#include <tee/optee.h>
 #include <asm-generic/memory_layout.h>
 #include <mach/rockchip/rockchip.h>
 #include <mach/rockchip/bootrom.h>
diff --git a/drivers/soc/imx/soc-imx8m.c b/drivers/soc/imx/soc-imx8m.c
index 1b47c914de8e..3b83284fcbfd 100644
--- a/drivers/soc/imx/soc-imx8m.c
+++ b/drivers/soc/imx/soc-imx8m.c
@@ -10,7 +10,6 @@
 #include <of_address.h>
 #include <pm_domain.h>
 
-#include <asm/optee.h>
 #include <asm-generic/memory_layout.h>
 
 #include <linux/io.h>
diff --git a/drivers/tee/optee/of_fixup.c b/drivers/tee/optee/of_fixup.c
index f3ccff31e68a..5a3eb094f22d 100644
--- a/drivers/tee/optee/of_fixup.c
+++ b/drivers/tee/optee/of_fixup.c
@@ -3,7 +3,6 @@
 #include <of.h>
 #include <linux/ioport.h>
 #include <asm/barebox-arm.h>
-#include <asm/optee.h>
 #include <tee/optee.h>
 
 int of_optee_fixup(struct device_node *root, void *_data)
diff --git a/include/tee/optee.h b/include/tee/optee.h
index 943dbb8fdab6..10e829c04f88 100644
--- a/include/tee/optee.h
+++ b/include/tee/optee.h
@@ -61,4 +61,21 @@ int imx6ul_start_optee_early(void *fdt, void *tee, void *data_location,
 
 #endif /* __PBL__ */
 
+struct device_node;
+
+struct of_optee_fixup_data {
+	const char *method;
+	size_t shm_size;
+};
+
+#ifdef CONFIG_OF_FIXUP_OPTEE
+int of_optee_fixup(struct device_node *root, void *fixup_data);
+#else
+static inline int of_optee_fixup(struct device_node *root, void *fixup_data)
+{
+	return -ENOSYS;
+}
+#endif
+
+
 #endif /* _OPTEE_H */
-- 
2.39.5




             reply	other threads:[~2025-08-06 12:53 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-06 12:52 Ahmad Fatoum [this message]
2025-08-06 12:52 ` [PATCH 2/2] tee: optee: skip optee node fixup if method is NULL Ahmad Fatoum
2025-08-07  6:11 ` [PATCH 1/2] tee: optee: merge tee/optee.h and ARM asm/optee.h Sascha Hauer

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=20250806125229.2804284-1-a.fatoum@barebox.org \
    --to=a.fatoum@barebox.org \
    --cc=barebox@lists.infradead.org \
    /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