[PATCH v3 2/3] mach-snapdragon: of_fixup: Add OP-TEE DT fixup support

Casey Connolly casey.connolly at linaro.org
Mon Feb 9 19:49:50 CET 2026


Hi Sumit,

Thanks for respinning this.

On 27/01/2026 07:23, Sumit Garg wrote:
> From: Sumit Garg <sumit.garg at 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.

The EFI DT fixup protocol hook seems to be missing here?
> 
> 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 at 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..644afc22d88 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 'optee' subnode: %d\n", ret);
> +		return;
> +	}
> +
> +	ret = of_write_prop(optee, "compatible", strlen("linaro,optee-tz") + 1,
> +			    "linaro,optee-tz");
> +	if (ret) {
> +		log_err("Failed to add optee 'compatible' property: %d\n", ret);
> +		return;
> +	}
> +
> +	ret = of_write_prop(optee, "method", strlen("smc") + 1, "smc");
> +	if (ret) {
> +		log_err("Failed to add optee 'method' property: %d\n", ret);
> +		return;
> +	}
> +}
> +
>  #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_ENABLED(CONFIG_OPTEE) && is_optee_smc_api())
> +		time_call(add_optee_node, root);
> +
>  	return 0;
>  }
>  

-- 
// Casey (she/her)



More information about the U-Boot mailing list