public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Sumit Garg <sumit.garg@kernel.org>
To: Varadarajan Narayanan <varadarajan.narayanan@oss.qualcomm.com>
Cc: u-boot-qcom@groups.io, u-boot@lists.denx.de, trini@konsulko.com,
	casey.connolly@linaro.org, neil.armstrong@linaro.org,
	jens.wiklander@linaro.org, ilias.apalodimas@linaro.org,
	jorge.ramirez@oss.qualcomm.com, tonyh@qti.qualcomm.com,
	Sumit Garg <sumit.garg@oss.qualcomm.com>
Subject: Re: [PATCH v2 2/3] mach-snapdragon: of_fixup: Add OP-TEE DT fixup support
Date: Fri, 23 Jan 2026 11:57:54 +0530	[thread overview]
Message-ID: <aXMU6vtieZmDRmpQ@sumit-xelite> (raw)
In-Reply-To: <aXL+V2+1qMlae/wa@hu-varada-blr.qualcomm.com>

On Fri, Jan 23, 2026 at 10:21:35AM +0530, Varadarajan Narayanan wrote:
> On Thu, Jan 22, 2026 at 02:28:05PM +0530, Sumit Garg wrote:
> > From: Sumit Garg <sumit.garg@oss.qualcomm.com>
> >
> > Add support for OP-TEE live tree DT fixup support which enables U-Boot
> > OP-TEE driver to be probed. As well as the EFI DT fixup protocol allows
> > the live tree fixup to be carried over to the OS for the OP-TEE driver
> > in the OS to probe as well.
> >
> > Note that this fixup only gets applied if OP-TEE support is detected via
> > checking for OP-TEE message UID.
> >
> > Signed-off-by: Sumit Garg <sumit.garg@oss.qualcomm.com>
> > ---
> >  arch/arm/mach-snapdragon/of_fixup.c | 35 +++++++++++++++++++++++++++++
> >  1 file changed, 35 insertions(+)
> >
> > diff --git a/arch/arm/mach-snapdragon/of_fixup.c b/arch/arm/mach-snapdragon/of_fixup.c
> > index 5b6076ea8e5..3d19449f133 100644
> > --- a/arch/arm/mach-snapdragon/of_fixup.c
> > +++ b/arch/arm/mach-snapdragon/of_fixup.c
> > @@ -25,6 +25,7 @@
> >  #include <fdt_support.h>
> >  #include <linux/errno.h>
> >  #include <stdlib.h>
> > +#include <tee/optee.h>
> >  #include <time.h>
> >
> >  /* U-Boot only supports USB high-speed mode on Qualcomm platforms with DWC3
> > @@ -164,6 +165,37 @@ static void fixup_power_domains(struct device_node *root)
> >  	}
> >  }
> >
> > +static void add_optee_node(struct device_node *root)
> > +{
> > +	struct device_node *fw = NULL, *optee = NULL;
> > +	int ret;
> > +
> > +	fw = of_find_node_by_path("/firmware");
> > +	if (!fw) {
> > +		log_err("Failed to find /firmware node\n");
> > +		return;
> > +	}
> > +
> > +	ret = of_add_subnode(fw, "optee", strlen("optee") + 1, &optee);
> > +	if (ret) {
> > +		log_err("Failed to add 'maximum-speed' property: %d\n", ret);
> 
> Failed to add 'optee' subnode??

Ack

> 
> > +		return;
> > +	}
> > +
> > +	ret = of_write_prop(optee, "compatible", strlen("linaro,optee-tz") + 1,
> > +			    "linaro,optee-tz");
> > +	if (ret) {
> > +		log_err("Failed to optee 'compatible' property: %d\n", ret);
> 
> s/to optee/to add/
> 

Ack

> > +		return;
> > +	}
> > +
> > +	ret = of_write_prop(optee, "method", strlen("smc") + 1, "smc");
> > +	if (ret) {
> > +		log_err("Failed to optee 'method' property: %d\n", ret);
> 
> s/to optee/to add/
> 

Ack

> > +		return;
> > +	}
> > +}
> 
> Not sure if add_optee_node() should be wrapped within #ifdef CONFIG_OPTEE,
> due to size concerns.

Since on Qcom platforms we intend to support generic board code where we
don't have particular size contrains as of now, so it should be fine to
leave it as it is.

-Sumit

> 
> -Varada
> 
> > +
> >  #define time_call(func, ...) \
> >  	do { \
> >  		u64 start = timer_get_us(); \
> > @@ -178,6 +210,9 @@ static int qcom_of_fixup_nodes(void * __maybe_unused ctx, struct event *event)
> >  	time_call(fixup_usb_nodes, root);
> >  	time_call(fixup_power_domains, root);
> >
> > +	if (is_optee_smc_api())
> > +		time_call(add_optee_node, root);
> > +
> >  	return 0;
> >  }
> >
> > --
> > 2.51.0
> >

  reply	other threads:[~2026-01-23  6:28 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-22  8:58 [PATCH v2 0/3] mach-snapdragon: Enable OP-TEE support Sumit Garg
2026-01-22  8:58 ` [PATCH v2 1/3] tee: optee: Export OP-TEE message UID check API Sumit Garg
2026-01-22  8:58 ` [PATCH v2 2/3] mach-snapdragon: of_fixup: Add OP-TEE DT fixup support Sumit Garg
2026-01-23  4:51   ` Varadarajan Narayanan
2026-01-23  6:27     ` Sumit Garg [this message]
2026-01-23 10:11   ` neil.armstrong
2026-01-23 12:01     ` Sumit Garg
2026-01-22  8:58 ` [PATCH v2 3/3] board/qualcomm: Introduce TF-A and OP-TEE config fragment Sumit Garg

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=aXMU6vtieZmDRmpQ@sumit-xelite \
    --to=sumit.garg@kernel.org \
    --cc=casey.connolly@linaro.org \
    --cc=ilias.apalodimas@linaro.org \
    --cc=jens.wiklander@linaro.org \
    --cc=jorge.ramirez@oss.qualcomm.com \
    --cc=neil.armstrong@linaro.org \
    --cc=sumit.garg@oss.qualcomm.com \
    --cc=tonyh@qti.qualcomm.com \
    --cc=trini@konsulko.com \
    --cc=u-boot-qcom@groups.io \
    --cc=u-boot@lists.denx.de \
    --cc=varadarajan.narayanan@oss.qualcomm.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