TrustZone in Hikey board


#1

I bought a Hikey board recently(CPU-Hi6220V;SoC-Kirin 620) and was ready to test its TrustZone feature. I find one doc in this official repo.

Unfortunately, there is no detailed description on how to use TrustZone feature in the doc <i>Hi6220V100_Multi-Mode_Application_Processor_Function_Description.pdf</i>. For example, in chapter 1.3.2, it says “Each interrupt source can be set to secure interrupt source or non-secure interrupt source.” But it doesn’t tell me how to do it, e.g. which bit in what register should be set. This seems to be the only documentation available so far.

Does anyone know some other docs about how to use TrustZone in Hikey? Any help would be appreciated.
Thanks in advance.
Tgn


#2

It’s not as easy as writing a bit to a register. You’ve to understand the architecture and know how you want to design your system. E.g. for interrupts the recommended routing model is IRQ as a Normal world interrupt source, and FIQ as the Secure world source (ref http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.prd29-genc-009492c/CACCDCDH.html)

There doesn’t seem to be a list for all Trustzone related registers as they seem to be ‘spreaded’ out all over different places. There’s sample code here (http://www.arm.com/products/processors/technologies/trustzone/tee-smc.php > https://silver.arm.com/download/download.tm?pv=1451946) for how to develop a TEE and monitor code. You can see the different kinds of registers written to. https://github.com/ARM-software/arm-trusted-firmware/blob/master/docs/firmware-design.md and https://github.com/ARM-software/arm-trusted-firmware/blob/master/docs/interrupt-framework-design.md also talk about how ARM-TF is designed and related register settings.

Some other useful reference might be:
ARMv8-A Reference Manual
https://silver.arm.com/download/download.tm?pv=2113558

Cortex-A Series Programmer’s Guide for ARMv8-A
http://infocenter.arm.com/help/topic/com.arm.doc.den0024a/DEN0024A_v8_architecture_PG.pdf

hth