From: "Vincent Stehlé" <vincent.stehle@arm.com>
To: Fabio Estevam <festevam@gmail.com>
Cc: u-boot@lists.denx.de, "NXP i.MX U-Boot Team" <uboot-imx@nxp.com>,
Peng Fan <peng.fan@nxp.com>, Tom Rini <trini@konsulko.com>,
Tim Harvey <tharvey@gateworks.com>
Subject: Re: [PATCH] imx8m: soc: cope with existing optee node
Date: Thu, 13 Mar 2025 16:17:57 +0100 [thread overview]
Message-ID: <Z9L3JY2NZa-qg0IN@debian> (raw)
In-Reply-To: <CAOMZO5BV1BBP-f++-NzjzEDXCG1-2WVjma8-e5zpi3yLKGeYCA@mail.gmail.com>
On Wed, Mar 12, 2025 at 11:12:35AM -0300, Fabio Estevam wrote:
> Hi Vincent,
>
> On Mon, Mar 10, 2025 at 9:36 AM Vincent Stehlé <vincent.stehle@arm.com> wrote:
>
> > --- a/arch/arm/mach-imx/imx8m/soc.c
> > +++ b/arch/arm/mach-imx/imx8m/soc.c
> > @@ -1270,8 +1270,9 @@ static int ft_add_optee_node(void *fdt, struct bd_info *bd)
> > }
> > }
> >
> > + /* Locate the optee node if it exists or create it. */
> > subpath = "optee";
> > - offs = fdt_add_subnode(fdt, offs, subpath);
> > + offs = fdt_find_or_add_subnode(fdt, offs, subpath);
> > if (offs < 0) {
> > printf("Could not create %s node.\n", subpath);
> > return offs;
>
> This looks correct.
Hi Fabio,
Thank you for the review.
>
> However, shouldn't we add the optee node only when CONFIG_OPTEE is selected?
Peng has answered this question already, but I would like to add some more
details:
Currently the ft_add_optee_node() function does add the /reserved-memory and
/firmware/optee nodes to the Devicetree passed to Linux when OP-TEE is detected
at runtime (the information is in the rom_pointer[] array).
If we skip this when CONFIG_OPTEE is not set, Linux will not even have the
reserved memory information anymore and the Linux optee driver will not probe.
Best regards,
Vincent.
>
> --- a/arch/arm/mach-imx/imx8m/soc.c
> +++ b/arch/arm/mach-imx/imx8m/soc.c
> @@ -1235,6 +1235,9 @@ static int ft_add_optee_node(void *fdt, struct
> bd_info *bd)
> int offs;
> int ret;
>
> + if (!IS_ENABLED(CONFIG_OPTEE))
> + return 0;
> +
> /*
> * No TEE space allocated indicating no TEE running, so no
> * need to add optee node in dts
next prev parent reply other threads:[~2025-03-13 15:39 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-10 12:36 [PATCH] imx8m: soc: cope with existing optee node Vincent Stehlé
2025-03-12 4:33 ` Peng Fan
2025-03-12 14:12 ` Fabio Estevam
2025-03-12 15:10 ` Peng Fan
2025-03-12 16:11 ` Fabio Estevam
2025-03-12 23:49 ` Peng Fan
2025-03-13 15:17 ` Vincent Stehlé [this message]
2025-05-13 12:24 ` Rasmus Villemoes
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=Z9L3JY2NZa-qg0IN@debian \
--to=vincent.stehle@arm.com \
--cc=festevam@gmail.com \
--cc=peng.fan@nxp.com \
--cc=tharvey@gateworks.com \
--cc=trini@konsulko.com \
--cc=u-boot@lists.denx.de \
--cc=uboot-imx@nxp.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.