As we mentioned in our last blog post about OP-TEE 3.16, Bootlin planned to and contributed some interesting features in the recently released OP-TEE 3.17 ! Here is a short presentation of our contributions to this release:
Summary
During this release cycle, Bootlin contributed the following features:
- Watchdog support
- Generic watchdog API
- OP-TEE Watchdog service compatible with
arm,smc-wdt
Linux driver - Microchip SAMA5D2 watchdog driver
- RTC support
- Generic RTC API
- OP-TEE RTC PTA to expose RTC to Linux
- Microchip SAMA5D2 RTC driver
- Linux driver for OP-TEE RTC
- Microchip SAMA5D2 suspend support
- Support for ULP0, ULP1, ULP0 Fast and backup modes of the SAMA5D2 processor
- PSCI support
- Fix Cortex-A5 suspend support in OP-TEE
- Microchip SAMA5D2 interrupt controller support
Watchdog
As part of our work on Microchip SAMA5D2 support in OP-TEE, we wanted to have support for the SAMA5D2 watchdog. Doing so without exposing the watchdog to Linux would have been useless and thus, we implemented and contributed a new generic watchdog API to OP-TEE. This interface allows registering a watchdog against the system and exposing it to Linux through a specific SMC handler that interfaces with the Linux arm,smc-wdt
compatible driver (see drivers/watchdog/arm_smc_wdt.c in the Linux kernel code). Our generic watchdog API is obviously used by the new watchdog driver for Microchip SAMA5D2, but was also quickly leveraged by ST who contributed a new watchdog driver for stm32mp1 based on this new watchdog API.
RTC
On Microchip SAMA5D2, the RTC is part of the system controller which needs to be secured since it contains critical features. Once in the secure world, the RTC is not available to the normal world. In order to expose this RTC device to the normal world (and particularly for Linux RTC subsystem), a new Pseudo Trusted Application (PTA) was added. This PTA communicates with a Linux OP-TEE compatible RTC driver and allows to get/set the date and time. This driver is generic and will allow any vendor which adds RTC support to OP-TEE to expose it transparently to Linux.
Contribution details
A total of 29 commits were contributed for OP-TEE 3.17:
- core: pm: add documentation for callback name parameter
- arm32: add suspend/resume support for cortex-A5
- plat-sam: use more mmap regions
- plat-sam: set sram0 as secure
- plat-sam: matrix: add suspend support
- drivers: clk: sam: add suspend support
- drivers: pm: sam: add suspend support
- drivers: atmel_shdwc: add call to suspend init
- plat-sam: psci: add support for suspend and idle
- drivers: atmel_saic: add SAIC driver
- plat-sam: add support for SAIC init
- plat-sam: add sm_platform_handler() stub
- plat-sam: pm: add support for setting suspend mode
- drivers: wdt: add watchdog interface
- drivers: wdt: add SMC handler for arm-smc-wdt Linux driver
- core: sm: call wdt_sm_handler()
- delay: allow udelay() function to work without generic timers
- dts: sama5d2: add clocks for cpu
- plat-sam: disable CFG_CORE_HAS_GENERIC_TIMER
- dts: sama5d2: set the watchdog as secure
- drivers: atmel_wdt: add atmel watchdog timer driver
- plat-sam: enable watchdog support in configuration
- drivers: rtc: add RTC API
- pta: add PTA for RTC
- driver: atmel_rtc: add driver for atmel RTC
- dts: sama5d2: set RTC as secure
- plat-sam: enable RTC support
- core: dt_driver: allow parsing of phandle == 0
- drivers: clk: Fix check for assigned-clock-rates index
Next steps
Bootlin still have some features planned to be contributed to OP-TEE:
- Pinctrl support
- Microchip SAMA5D2 PIO driver
- Pinmuxing API for providers and consumers
- Device-tree pinmux parsing
- SCMI clock support based on the clk framework
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.