[PATCH 10/14] ARM: optee-early: add mx6_start_optee_early helper

Ahmad Fatoum a.fatoum at pengutronix.de
Fri Jun 27 08:38:19 PDT 2025


On 6/27/25 16:07, Sascha Hauer wrote:
> From: Marco Felsch <m.felsch at pengutronix.de>
>  To start OP-TEE during the lowlevel initialization of your board in the ``PBL``,
> -enable the ``CONFIG_PBL_OPTEE`` configuration variable. your board should then
> +enable the ``CONFIG_PBL_OPTEE`` configuration variable. Your board should then
>  call the function ``start_optee_early(void* tee, void* fdt)`` with a valid tee
> -and FDT. Ensure that your OP-TEE is compiled with ``CFG_NS_ENTRY_ADDR`` unset,
> -otherwise OP-TEE will not correctly return to barebox after startup.
> -Since OP-TEE in the default configuration also modifies the device tree, don't
> -pass the barebox internal device tree, instead copy it into a different memory
> -location and pass it to OP-TEE afterwards.
> -The modified device tree can then be passed to the main barebox start function.
> +and FDT. If you're running on an i.MX6 platform your board code should call
> +``imx6q_start_optee_early()`` or ``imx6ul_start_optee_early()`` instead since it
> +validates that the TZASC not bypassed and configured as expected by OP-TEE.

validates that the TZASC is not bypassed and is configured as expected
by OP-TEE.

> +Ensure that your OP-TEE is compiled with ``CFG_NS_ENTRY_ADDR`` unset, otherwise
> +OP-TEE will not correctly return to barebox after startup. Since OP-TEE in the
> +default configuration also modifies the device tree, don't pass the barebox
> +internal device tree, instead copy it into a different memory location and pass
> +it to OP-TEE afterwards. The modified device tree can then be passed to the
> +main barebox start function.

.. note:: Modification of the device tree usually makes it bigger.
  Some spare space must be left after the end of the device tree to
  accommodate this.

Cheers,
Ahmad

-- 
Pengutronix e.K.                  |                             |
Steuerwalder Str. 21              | http://www.pengutronix.de/  |
31137 Hildesheim, Germany         | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686  | Fax:   +49-5121-206917-5555 |




More information about the barebox mailing list