U-Boot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Yu-Chien Peter Lin <peter.lin@sifive.com>
To: ycliang@andestech.com, trini@konsulko.com, xypron.glpk@gmx.de,
	seashell11234455@gmail.com, dan.carpenter@linaro.org,
	mchitale@ventanamicro.com, ben.dooks@codethink.co.uk,
	u-boot@lists.denx.de
Cc: Yu-Chien Peter Lin <peter.lin@sifive.com>
Subject: [RFC PATCH 2/2] riscv: dts: binman.dtsi: Include OP-TEE OS image
Date: Sat, 11 Jan 2025 09:55:27 +0800	[thread overview]
Message-ID: <20250111015527.35528-3-peter.lin@sifive.com> (raw)
In-Reply-To: <20250111015527.35528-1-peter.lin@sifive.com>

The following diagram illustrates the boot flow for OP-TEE OS
initialization on RISC-V.

    (1)-----------+
     | U-Boot SPL |
     +------------+
         |
         v
    (2)-------------------------------------------------------------+
     | OpenSBI (fw_dynamic.bin)                                     |
     |                (4)------------------------+                  |
     |                 | optee dispatcher driver |                  |
     +-----------------+-------^---------|-------+------------------+
M-mode   |                     |         |
---------+--[trusted domain]---+----.----+--[untrusted domain]-------
S-mode   |  (coldboot domain)  |    |    |
         v                     |    |    v
    (3)---------------------------+ |(5)----------------------------+
     | OP-TEE OS (tee.bin)        | | | U-Boot (u-boot-nodtb.bin)   |
     +----------------------------+ | +-----------------------------+
                                    |    |
                                    |    v
                                    |(6)----------------------------+
                                    | | Linux                       |
                                    | +-----------------------------+

This patch enables the inclusion of the OP-TEE binary within the
U-Boot ITB, allowing it to be loaded to a platform defined address
by U-Boot SPL.

Signed-off-by: Yu-Chien Peter Lin <peter.lin@sifive.com>
---
 arch/riscv/dts/binman.dtsi | 26 ++++++++++++++++++++++++--
 1 file changed, 24 insertions(+), 2 deletions(-)

diff --git a/arch/riscv/dts/binman.dtsi b/arch/riscv/dts/binman.dtsi
index 9271de0ddfc..0405faca574 100644
--- a/arch/riscv/dts/binman.dtsi
+++ b/arch/riscv/dts/binman.dtsi
@@ -53,6 +53,19 @@
 					};
 				};
 #endif
+#ifdef CONFIG_OPTEE
+				tee {
+					description = "OP-TEE";
+					type = "tee";
+					arch = "riscv";
+					compression = "none";
+					os = "tee";
+					load = /bits/ 64 <CONFIG_SPL_OPTEE_LOAD_ADDR>;
+					tee_blob: tee-os {
+						filename = "tee.bin";
+					};
+				};
+#endif
 
 				opensbi {
 					description = "OpenSBI fw_dynamic Firmware";
@@ -88,11 +101,20 @@
 #endif
 					description = "NAME";
 					firmware = "opensbi";
-#ifndef CONFIG_SPL_LOAD_FIT_OPENSBI_OS_BOOT
-					loadables = "uboot";
+#ifdef CONFIG_OPTEE
+#ifdef CONFIG_SPL_LOAD_FIT_OPENSBI_OS_BOOT
+					loadables = "linux", "tee";
 #else
+					loadables = "uboot", "tee";
+#endif
+#else /* !CONFIG_OPTEEE */
+#ifdef CONFIG_SPL_LOAD_FIT_OPENSBI_OS_BOOT
 					loadables = "linux";
+#else
+					loadables = "uboot";
 #endif
+#endif /* CONFIG_OPTEE */
+
 #ifndef CONFIG_OF_BOARD
 					fdt = "fdt-SEQ";
 #endif
-- 
2.39.3


  parent reply	other threads:[~2025-01-11  4:43 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-11  1:55 [RFC PATCH 0/2] Integrate OP-TEE into the RISC-V boot flow Yu-Chien Peter Lin
2025-01-11  1:55 ` [RFC PATCH 1/2] riscv: Add CONFIG_SPL_OPTEE_LOAD_ADDR Yu-Chien Peter Lin
2025-02-03  3:58   ` Leo Liang
2025-01-11  1:55 ` Yu-Chien Peter Lin [this message]
2025-02-03  3:59   ` [RFC PATCH 2/2] riscv: dts: binman.dtsi: Include OP-TEE OS image Leo Liang

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=20250111015527.35528-3-peter.lin@sifive.com \
    --to=peter.lin@sifive.com \
    --cc=ben.dooks@codethink.co.uk \
    --cc=dan.carpenter@linaro.org \
    --cc=mchitale@ventanamicro.com \
    --cc=seashell11234455@gmail.com \
    --cc=trini@konsulko.com \
    --cc=u-boot@lists.denx.de \
    --cc=xypron.glpk@gmx.de \
    --cc=ycliang@andestech.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