mbox series

[v4,0/5] stm32mp: Enable OP-TEE and TZC support in SPL

Message ID 20210531174314.1395666-1-mr.nuke.me@gmail.com
Headers show
Series stm32mp: Enable OP-TEE and TZC support in SPL | expand

Message

Alexandru Gagniuc May 31, 2021, 5:43 p.m. UTC
The purpose of this series is to allow booting an OP-TEE image from
SPL, by corectly configuring the TrustZone (TZC) memory regions.

Although TZC400 is a generic silicon logic that could apply to other
mach- families, support is currently restricted to stm32mp. I have
neither a feasible way nor interest in validating this for other
chips. It's fairly trivial to move the code from mach- to arch/,
should another use case arise.

The configuration of the memory regions is devicetree-driven, so there
isn't much to hardcode, However the delineation between OP-TEE secure
memory and shared memory is not given in the devicetree. This is the
one thing that has to be hardcoded.

Changes since v3:
  - Pass a "phys_size_t *" to ofnode_get_addr_size() to resolve warning
  - s/u-boot,dm-pre-reloc/u-boot,dm-spl/ in devicetree for clarity

Changes since v2:
  - Use ram_get_info() instead of ofnode_read("st,mem-size")
  - Only hardcode shared memory size instead of TZDRAM size
  - Use log_info() instead of pr_info()

Changes since v1:
  - Removed "Weak functions are stupid" comment
  - Addressed blank line complaints from checkpatch

Alexandru Gagniuc (5):
  spl: mmc: Support OP-TEE payloads in Falcon mode
  spl: Introduce spl_board_prepare_for_optee() hook
  arm: stm32mp: Implement support for TZC 400 controller
  stm32mp1: spl: Configure TrustZone controller for OP-TEE
  ARM: dts: stm32mp: Add OP-TEE reserved memory to SPL dtb

 arch/arm/dts/stm32mp157a-dk1-u-boot.dtsi |   3 +
 arch/arm/mach-stm32mp/Makefile           |   1 +
 arch/arm/mach-stm32mp/include/mach/tzc.h |  33 ++++++
 arch/arm/mach-stm32mp/spl.c              |  92 +++++++++++++++
 arch/arm/mach-stm32mp/tzc400.c           | 136 +++++++++++++++++++++++
 common/spl/spl.c                         |   5 +
 common/spl/spl_mmc.c                     |   6 +-
 include/spl.h                            |  14 +++
 8 files changed, 288 insertions(+), 2 deletions(-)
 create mode 100644 arch/arm/mach-stm32mp/include/mach/tzc.h
 create mode 100644 arch/arm/mach-stm32mp/tzc400.c

Comments

Alexandru Gagniuc July 6, 2021, 3:18 p.m. UTC | #1
On 5/31/21 12:43 PM, Alexandru Gagniuc wrote:
> The purpose of this series is to allow booting an OP-TEE image from
> SPL, by corectly configuring the TrustZone (TZC) memory regions.

Any chance we could have this hit the merge window?

Alex
Tom Rini July 6, 2021, 3:45 p.m. UTC | #2
On Tue, Jul 06, 2021 at 10:18:44AM -0500, Alex G. wrote:

> On 5/31/21 12:43 PM, Alexandru Gagniuc wrote:
> > The purpose of this series is to allow booting an OP-TEE image from
> > SPL, by corectly configuring the TrustZone (TZC) memory regions.
> 
> Any chance we could have this hit the merge window?

For clarity, does this series depend on anything that's not already
merged?
Alexandru Gagniuc July 6, 2021, 3:55 p.m. UTC | #3
On 7/6/21 10:45 AM, Tom Rini wrote:
> On Tue, Jul 06, 2021 at 10:18:44AM -0500, Alex G. wrote:
> 
>> On 5/31/21 12:43 PM, Alexandru Gagniuc wrote:
>>> The purpose of this series is to allow booting an OP-TEE image from
>>> SPL, by corectly configuring the TrustZone (TZC) memory regions.
>>
>> Any chance we could have this hit the merge window?
> 
> For clarity, does this series depend on anything that's not already
> merged?

Negative. This series can be applied standalone.

Alex