public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Andrew F. Davis <afd@ti.com>
To: u-boot@lists.denx.de
Subject: [U-Boot]  [PATCH v3 5/7] arm: omap5: Add OPTEE node to fdt
Date: Tue, 29 Nov 2016 16:33:24 -0600	[thread overview]
Message-ID: <20161129223326.3115-6-afd@ti.com> (raw)
In-Reply-To: <20161129223326.3115-1-afd@ti.com>

Add an OPTEE node to the FDT when TEE installation has completed
successfully. This informs the kernel of the presence of OPTEE.

Signed-off-by: Andrew F. Davis <afd@ti.com>
---
 arch/arm/mach-omap2/omap5/fdt.c | 35 ++++++++++++++++++++++++++++++++++-
 1 file changed, 34 insertions(+), 1 deletion(-)

diff --git a/arch/arm/mach-omap2/omap5/fdt.c b/arch/arm/mach-omap2/omap5/fdt.c
index da8d59b..afa0037 100644
--- a/arch/arm/mach-omap2/omap5/fdt.c
+++ b/arch/arm/mach-omap2/omap5/fdt.c
@@ -212,6 +212,38 @@ static int ft_hs_fixup_dram(void *fdt, bd_t *bd)
 static int ft_hs_fixup_dram(void *fdt, bd_t *bd) { return 0; }
 #endif
 
+static int ft_hs_add_tee(void *fdt, bd_t *bd)
+{
+	const char *path, *subpath;
+	int offs;
+
+	extern int tee_loaded;
+	if (!tee_loaded)
+		return 0;
+
+	path = "/";
+	offs = fdt_path_offset(fdt, path);
+
+	subpath = "firmware";
+	offs = fdt_add_subnode(fdt, offs, subpath);
+	if (offs < 0) {
+		printf("Could not create %s node.\n", subpath);
+		return 1;
+	}
+
+	subpath = "optee";
+	offs = fdt_add_subnode(fdt, offs, subpath);
+	if (offs < 0) {
+		printf("Could not create %s node.\n", subpath);
+		return 1;
+	}
+
+	fdt_setprop_string(fdt, offs, "compatible", "linaro,optee-tz");
+	fdt_setprop_string(fdt, offs, "method", "smc");
+
+	return 0;
+}
+
 static void ft_hs_fixups(void *fdt, bd_t *bd)
 {
 	/* Check we are running on an HS/EMU device type */
@@ -219,7 +251,8 @@ static void ft_hs_fixups(void *fdt, bd_t *bd)
 		if ((ft_hs_fixup_crossbar(fdt, bd) == 0) &&
 		    (ft_hs_disable_rng(fdt, bd) == 0) &&
 		    (ft_hs_fixup_sram(fdt, bd) == 0) &&
-		    (ft_hs_fixup_dram(fdt, bd) == 0))
+		    (ft_hs_fixup_dram(fdt, bd) == 0) &&
+		    (ft_hs_add_tee(fdt, bd) == 0))
 			return;
 	} else {
 		printf("ERROR: Incorrect device type (GP) detected!");
-- 
2.10.2

  parent reply	other threads:[~2016-11-29 22:33 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-29 22:33 [U-Boot] [PATCH v3 0/7] Add FIT loadable custom processing Andrew F. Davis
2016-11-29 22:33 ` [U-Boot] [PATCH v3 1/7] image: Add FIT image loadable section " Andrew F. Davis
2016-12-04  1:05   ` [U-Boot] [U-Boot, v3, " Tom Rini
2016-11-29 22:33 ` [U-Boot] [PATCH v3 2/7] image: Add Trusted Execution Environment image type Andrew F. Davis
2016-12-04  1:05   ` [U-Boot] [U-Boot, v3, " Tom Rini
2016-11-29 22:33 ` [U-Boot] [PATCH v3 3/7] arm: omap5: Add function to make an SMC call on cpu1 Andrew F. Davis
2016-12-04  1:06   ` [U-Boot] [U-Boot, v3, " Tom Rini
2016-11-29 22:33 ` [U-Boot] [PATCH v3 4/7] arm: omap5: Add TEE loading support Andrew F. Davis
2016-11-30  3:05   ` Tom Rini
2016-12-04  1:06   ` [U-Boot] [U-Boot,v3,4/7] " Tom Rini
2016-11-29 22:33 ` Andrew F. Davis [this message]
2016-11-30 14:13   ` [U-Boot] [PATCH v3 5/7] arm: omap5: Add OPTEE node to fdt Tom Rini
2016-12-04  1:07   ` [U-Boot] [U-Boot,v3,5/7] " Tom Rini
2016-11-29 22:33 ` [U-Boot] [PATCH v3 6/7] board: ti: dra7xx: add FIT image TEE processing Andrew F. Davis
2016-12-04  1:08   ` [U-Boot] [U-Boot, v3, " Tom Rini
2016-11-29 22:33 ` [U-Boot] [PATCH v3 7/7] board: ti: am57xx: " Andrew F. Davis
2016-12-04  1:08   ` [U-Boot] [U-Boot, v3, " 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=20161129223326.3115-6-afd@ti.com \
    --to=afd@ti.com \
    --cc=u-boot@lists.denx.de \
    /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