Last year, Bootlin started contributing to the OP-TEE project, which is an open source Trusted Execution Environment (TEE) implemented using the Arm TrustZone technology. We published a blog post about our contribution of a generic clock framework to OP-TEE, and also presented a talk OP-TEE: When Linux Loses Control (slides, video).
As part of this work, Bootlin engineer Clément Léger contributed to the OP-TEE project, and many of his contributions have already been merged, and released as part of the 3.15 and 3.16 OP-TEE releases. In this blog post, we present some details of our contributions to OP-TEE so far, and our next steps.
Summary
Since then, we contributed a number of features and improvements to OP-TEE. First, a number of generic, HW-agnostic contributions:
- Interrupts property parsing from device-tree
- Clock framework and fixed-clock driver, sSee our previous post about the OP-TEE clock framework
The Microchip SAMA5D2 platform support was also greatly improved with the following improvements:
- Cleanup of existing SAMA5D2 support
- Rework of the memory layout
- Device Tree support
- Board support for sama5d27-som1-ek1
- Clock tree support: includes drivers for all the clocks available on sama5d2 SoC
- TRNG driver
- Reset and shutdown controller drivers
- PSCI support for reset and shutdown
Contribution details
We contributed 11 commits to OP-TEE 3.15.0:
- plat-sam: remove useless function in sam_pl310.c
- plat-sam: move pl310 related code to its own file
- plat-sam: move secure zone to 0x20000000
- plat-sam: switch to generic_ram_layout.h
- plat-sam: rename peripheral security function
- plat-sam: set correct name for ID 1 which is PMC
- plat-sam: matrix: remove wrong quirk for matrix id
- core: dt: add option to generate DTB overlay at boot
- core: dt: remove 0x in reserved memory node unit name
- drivers: scmi-msg: fix typo
- core: Fix r7 clobbering in reset_primary
We contributed 48 commits to OP-TEE 3.16.0. This level of contribution makes Bootlin engineer Clément Léger the second most active contributor by number of commits for this OP-TEE release.
- plat-sam: enable PSCI shutdown support
- plat-sam: enable PSCI reset support
- plat-sam: enable PSCI_ARM32, ATMEL_SHDWC and ATMEL_RSTC
- plat-sam: set QSPI memories as non secure
- drivers: atmel-shdwc: add atmel shdwc driver
- drivers: sam: add at91_ddr.h file with DDR register definition
- drivers: clk: sam: expose at91_pmc_get_base
- driver: atmel_trng: remove wrong assertion
- drivers: atmel-rstc: add support for reset controller
- plat-sam: enable Atmel TRNG driver
- drivers: add Atmel TRNG driver
- plat-sam: include sama5d2.h file necessary for some values
- plat-sam: enable clock framework support
- drivers: add sub.mk for sam
- drivers: sam: add sama5d2 clock description
- drivers: sam: add at91 clock interface
- drivers: sam: add pmc clock registering
- drivers: sam: add at91_system clock driver
- drivers: sam: add at91_utmi clock driver
- drivers: sam: add at91_usb clock driver
- drivers: sam: add at91_sckc clock driver
- drivers: sam: add at91_programmable clock driver
- drivers: sam: add at91_plldiv clock driver
- drivers: sam: add at91_pll clock driver
- drivers: sam: add at91_peripheral clock driver
- drivers: sam: add at91_master clock driver
- drivers: sam: add at91_main clock driver
- drivers: sam: add at91_i2s_mux clock driver
- drivers: sam: add at91_h32mx clock driver
- drivers: sam: add at91_generated clock driver
- drivers: sam: add at91_audio_pll clock driver
- drivers: sam: add PMC definitions
- dts: at91: removed useless definition
- ext: include: add DIV_ROUND_UP function
- plat-sam: enable CFG_GENERATE_DTB_OVERLAY by default
- plat-sam: remove unused CFG_DRAM_SIZE config option
- plat-sam: allow using sama5d2_xplained instead of sama5d2xult
- plat-sam: add sama5d27-som1-ek board support and change default platform
- plat-sam: add support to build embedded dtb
- dts: at91: add device tree for sama5d27_som1_ek board
- dts: at91: add device trees for sama5d2_xplained
- MAINTAINERS: add clock driver interface entry
- drivers: clk: add fixed-clock driver
- drivers: clk: add devicetree support
- drivers: clk: add generic clock framework
- drivers: add type field to dt_driver struct
- core: kernel: interrupt: add type and prio for interrupts
- core: kernel: interrupt: rename len argument of dt_get_irq to count
Next steps
We will continue our effort on sam5d2 support on OP-TEE and as part of this, there will be contributions on several generic subsystems as well as SAMA5D2 support:
- Watchdog support
- Generic watchdog API
- OP-TEE Watchdog service compatible with
arm,smc-wdt
Linux driver - Sama5d2 watchdog driver
- RTC support
- Generic RTC API
- OP-TEE RTC PTA to expose RTC to Linux
- sama5d2 RTC driver
- Linux driver for OP-TEE RTC
- SAMA5D2 suspend support
- Support forULP0, ULP1, ULP0 Fast and backup modes
- PSCI support
- SAMA5D2 interrupt controller support
Do not hesitate to contact us if you need help and support to integrate or deploy OP-TEE on your platform, either Microchip platforms, but also other ARM32 or ARM64 platforms.