[PATCH] imx8m: soc: cope with existing optee node

Fabio Estevam festevam at gmail.com
Wed Mar 12 15:12:35 CET 2025


Hi Vincent,

On Mon, Mar 10, 2025 at 9:36 AM Vincent Stehlé <vincent.stehle at 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.

However, shouldn't we add the optee node only when CONFIG_OPTEE is selected?

--- 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


More information about the U-Boot mailing list