From: Andrew F. Davis <afd@ti.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 3/6] arm: mach-omap2: fdt-common: Add OP-TEE node when firmware node is defined
Date: Fri, 16 Jun 2017 14:26:58 -0500 [thread overview]
Message-ID: <20170616192701.7709-4-afd@ti.com> (raw)
In-Reply-To: <20170616192701.7709-1-afd@ti.com>
If a firmware node is already present in the FDT we will fail to create
one and so fail to add our OP-TEE node, make this fixup first check for
a firmware node and then only try to add one if it is not found.
Signed-off-by: Andrew F. Davis <afd@ti.com>
---
arch/arm/mach-omap2/fdt-common.c | 20 ++++++++++++++------
1 file changed, 14 insertions(+), 6 deletions(-)
diff --git a/arch/arm/mach-omap2/fdt-common.c b/arch/arm/mach-omap2/fdt-common.c
index 297d4d4df5..9297e9db48 100644
--- a/arch/arm/mach-omap2/fdt-common.c
+++ b/arch/arm/mach-omap2/fdt-common.c
@@ -134,14 +134,22 @@ int ft_hs_add_tee(void *fdt, bd_t *bd)
if (!tee_loaded)
return 0;
- path = "/";
+ path = "/firmware";
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;
+ path = "/";
+ offs = fdt_path_offset(fdt, path);
+ if (offs < 0) {
+ printf("Could not find root node.\n");
+ return 1;
+ }
+
+ subpath = "firmware";
+ offs = fdt_add_subnode(fdt, offs, subpath);
+ if (offs < 0) {
+ printf("Could not create %s node.\n", subpath);
+ return 1;
+ }
}
subpath = "optee";
--
2.13.0
next prev parent reply other threads:[~2017-06-16 19:26 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-16 19:26 [U-Boot] [PATCH 0/6] AM43xx OP-TEE support Andrew F. Davis
2017-06-16 19:26 ` [U-Boot] [PATCH 1/6] arm: mach-omap2: Move omap5/sec-fxns.c into sec-common.c Andrew F. Davis
2017-06-17 7:31 ` Lokesh Vutla
2017-06-19 12:17 ` Tom Rini
2017-06-16 19:26 ` [U-Boot] [PATCH 2/6] arm: mach-omap2: Factor out common FDT fixup suport Andrew F. Davis
2017-06-17 7:31 ` Lokesh Vutla
2017-06-19 12:17 ` Tom Rini
2017-06-16 19:26 ` Andrew F. Davis [this message]
2017-06-17 7:32 ` [U-Boot] [PATCH 3/6] arm: mach-omap2: fdt-common: Add OP-TEE node when firmware node is defined Lokesh Vutla
2017-06-16 19:26 ` [U-Boot] [PATCH 4/6] arm: mach-omap2: am33xx: Add FDT fixup suport for AM33xx/AM43xx boards Andrew F. Davis
2017-06-17 7:32 ` Lokesh Vutla
2017-06-19 12:17 ` Tom Rini
2017-06-16 19:27 ` [U-Boot] [PATCH 5/6] board: ti: am43xx: Add TEE loading and firewall setup Andrew F. Davis
2017-06-17 7:35 ` Lokesh Vutla
2017-07-10 19:45 ` Andrew F. Davis
2017-06-16 19:27 ` [U-Boot] [PATCH 6/6] board: ti: am43xx: Add FDT fixup for HS devices Andrew F. Davis
2017-06-17 7:33 ` Lokesh Vutla
2017-06-19 12:17 ` 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=20170616192701.7709-4-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